diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index bf1f9bfb704..9d29223fc7e 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -673,7 +673,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_RANGE` -Export a property with :ref:`@GlobalScope.PROPERTY_USAGE_STORAGE` flag. The property is not displayed in the editor, but it is serialized and stored in the scene or resource file. This can be useful for :ref:`@tool` scripts. Also the property value is copied when :ref:`Resource.duplicate` or :ref:`Node.duplicate` is called, unlike non-exported variables. +Export a property with :ref:`@GlobalScope.PROPERTY_USAGE_STORAGE` flag. The property is not displayed in the editor, but it is serialized and stored in the scene or resource file. This can be useful for :ref:`@tool` scripts. Also the property value is copied when :ref:`Resource.duplicate()` or :ref:`Node.duplicate()` is called, unlike non-exported variables. :: @@ -732,7 +732,7 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_SUBGROUP` property as a clickable button with the label ``text``. When the button is pressed, the callable is called. -If ``icon`` is specified, it is used to fetch an icon for the button via :ref:`Control.get_theme_icon`, from the ``"EditorIcons"`` theme type. If ``icon`` is omitted, the default ``"Callable"`` icon is used instead. +If ``icon`` is specified, it is used to fetch an icon for the button via :ref:`Control.get_theme_icon()`, from the ``"EditorIcons"`` theme type. If ``icon`` is omitted, the default ``"Callable"`` icon is used instead. Consider using the :ref:`EditorUndoRedoManager` to allow the action to be reverted safely. @@ -759,13 +759,13 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_TOOL_BUTTON` flag because a :ref:`Callable` cannot be properly serialized and stored in a file. -\ **Note:** In an exported project neither :ref:`EditorInterface` nor :ref:`EditorUndoRedoManager` exist, which may cause some scripts to break. To prevent this, you can use :ref:`Engine.get_singleton` and omit the static type from the variable declaration: +\ **Note:** In an exported project neither :ref:`EditorInterface` nor :ref:`EditorUndoRedoManager` exist, which may cause some scripts to break. To prevent this, you can use :ref:`Engine.get_singleton()` and omit the static type from the variable declaration: :: var undo_redo = Engine.get_singleton(&"EditorInterface").get_editor_undo_redo() -\ **Note:** Avoid storing lambda callables in member variables of :ref:`RefCounted`-based classes (e.g. resources), as this can lead to memory leaks. Use only method callables and optionally :ref:`Callable.bind` or :ref:`Callable.unbind`. +\ **Note:** Avoid storing lambda callables in member variables of :ref:`RefCounted`-based classes (e.g. resources), as this can lead to memory leaks. Use only method callables and optionally :ref:`Callable.bind()` or :ref:`Callable.unbind()`. .. rst-class:: classref-item-separator @@ -799,7 +799,7 @@ Add a custom icon to the current script. The icon specified at ``icon_path`` is **@onready**\ (\ ) :ref:`πŸ”—` -Mark the following property as assigned when the :ref:`Node` is ready. Values for these properties are not assigned immediately when the node is initialized (:ref:`Object._init`), and instead are computed and stored right before :ref:`Node._ready`. +Mark the following property as assigned when the :ref:`Node` is ready. Values for these properties are not assigned immediately when the node is initialized (:ref:`Object._init()`), and instead are computed and stored right before :ref:`Node._ready()`. :: @@ -817,9 +817,9 @@ Mark the following property as assigned when the :ref:`Node` is read Mark the following method for remote procedure calls. See :doc:`High-level multiplayer <../tutorials/networking/high_level_multiplayer>`. -If ``mode`` is set as ``"any_peer"``, allows any peer to call this RPC function. Otherwise, only the authority peer is allowed to call it and ``mode`` should be kept as ``"authority"``. When configuring functions as RPCs with :ref:`Node.rpc_config`, each of these modes respectively corresponds to the :ref:`MultiplayerAPI.RPC_MODE_AUTHORITY` and :ref:`MultiplayerAPI.RPC_MODE_ANY_PEER` RPC modes. See :ref:`RPCMode`. If a peer that is not the authority tries to call a function that is only allowed for the authority, the function will not be executed. If the error can be detected locally (when the RPC configuration is consistent between the local and the remote peer), an error message will be displayed on the sender peer. Otherwise, the remote peer will detect the error and print an error there. +If ``mode`` is set as ``"any_peer"``, allows any peer to call this RPC function. Otherwise, only the authority peer is allowed to call it and ``mode`` should be kept as ``"authority"``. When configuring functions as RPCs with :ref:`Node.rpc_config()`, each of these modes respectively corresponds to the :ref:`MultiplayerAPI.RPC_MODE_AUTHORITY` and :ref:`MultiplayerAPI.RPC_MODE_ANY_PEER` RPC modes. See :ref:`RPCMode`. If a peer that is not the authority tries to call a function that is only allowed for the authority, the function will not be executed. If the error can be detected locally (when the RPC configuration is consistent between the local and the remote peer), an error message will be displayed on the sender peer. Otherwise, the remote peer will detect the error and print an error there. -If ``sync`` is set as ``"call_remote"``, the function will only be executed on the remote peer, but not locally. To run this function locally too, set ``sync`` to ``"call_local"``. When configuring functions as RPCs with :ref:`Node.rpc_config`, this is equivalent to setting ``call_local`` to ``true``. +If ``sync`` is set as ``"call_remote"``, the function will only be executed on the remote peer, but not locally. To run this function locally too, set ``sync`` to ``"call_local"``. When configuring functions as RPCs with :ref:`Node.rpc_config()`, this is equivalent to setting ``call_local`` to ``true``. The ``transfer_mode`` accepted values are ``"unreliable"``, ``"unreliable_ordered"``, or ``"reliable"``. It sets the transfer mode of the underlying :ref:`MultiplayerPeer`. See :ref:`MultiplayerPeer.transfer_mode`. @@ -950,7 +950,9 @@ Method Descriptions :ref:`Color` **Color8**\ (\ r8\: :ref:`int`, g8\: :ref:`int`, b8\: :ref:`int`, a8\: :ref:`int` = 255\ ) :ref:`πŸ”—` -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. Using :ref:`Color8` instead of the standard :ref:`Color` constructor is useful when you need to match exact color values in an :ref:`Image`. +**Deprecated:** Use :ref:`Color.from_rgba8()` instead. + +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. Using :ref:`Color8()` instead of the standard :ref:`Color` constructor is useful when you need to match exact color values in an :ref:`Image`. :: @@ -958,7 +960,7 @@ Returns a :ref:`Color` constructed from red (``r8``), green (``g8`` 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). -\ **Note:** Due to the lower precision of :ref:`Color8` compared to the standard :ref:`Color` constructor, a color created with :ref:`Color8` will generally not be equal to the same color created with the standard :ref:`Color` constructor. Use :ref:`Color.is_equal_approx` for comparisons to avoid issues with floating-point precision error. +\ **Note:** Due to the lower precision of :ref:`Color8()` compared to the standard :ref:`Color` constructor, a color created with :ref:`Color8()` will generally not be equal to the same color created with the standard :ref:`Color` constructor. Use :ref:`Color.is_equal_approx()` for comparisons to avoid issues with floating-point precision error. .. rst-class:: classref-item-separator @@ -970,11 +972,11 @@ Returns a :ref:`Color` constructed from red (``r8``), green (``g8`` |void| **assert**\ (\ condition\: :ref:`bool`, message\: :ref:`String` = ""\ ) :ref:`πŸ”—` -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. +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. 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. -\ **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. +\ **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. :: @@ -985,7 +987,7 @@ An optional ``message`` can be shown in addition to the generic "Assertion faile assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check. assert(speed < 20, "the speed limit is 20") # Show a message. -\ **Note:** :ref:`assert` is a keyword, not a function. So you cannot access it as a :ref:`Callable` or use it inside expressions. +\ **Note:** :ref:`assert()` is a keyword, not a function. So you cannot access it as a :ref:`Callable` or use it inside expressions. .. rst-class:: classref-item-separator @@ -1015,7 +1017,7 @@ Returns a single character (as a :ref:`String`) of the given Unico :ref:`Variant` **convert**\ (\ what\: :ref:`Variant`, type\: :ref:`Variant.Type`\ ) :ref:`πŸ”—` -**Deprecated:** Use :ref:`@GlobalScope.type_convert` instead. +**Deprecated:** Use :ref:`@GlobalScope.type_convert()` instead. Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :ref:`Variant.Type` values. @@ -1038,7 +1040,9 @@ Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :r :ref:`Object` **dict_to_inst**\ (\ dictionary\: :ref:`Dictionary`\ ) :ref:`πŸ”—` -Converts a ``dictionary`` (created with :ref:`inst_to_dict`) back to an Object instance. Can be useful for deserializing. +**Deprecated:** Consider using :ref:`JSON.to_native()` or :ref:`Object.get_property_list()` instead. + +Converts a ``dictionary`` (created with :ref:`inst_to_dict()`) back to an Object instance. Can be useful for deserializing. .. rst-class:: classref-item-separator @@ -1050,7 +1054,7 @@ Converts a ``dictionary`` (created with :ref:`inst_to_dict` **get_stack**\ (\ ) :ref:`πŸ”—` -Returns an array of dictionaries representing the current call stack. See also :ref:`print_stack`. +Returns an array of dictionaries representing the current call stack. See also :ref:`print_stack()`. :: @@ -1069,7 +1073,7 @@ 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:** 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:** 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:** Calling this function from a :ref:`Thread` is not supported. Doing so will return an empty array. @@ -1083,9 +1087,9 @@ Starting from ``_ready()``, ``bar()`` would print: :ref:`Dictionary` **inst_to_dict**\ (\ instance\: :ref:`Object`\ ) :ref:`πŸ”—` -Returns the passed ``instance`` converted to a Dictionary. Can be useful for serializing. +**Deprecated:** Consider using :ref:`JSON.from_native()` or :ref:`Object.get_property_list()` instead. -\ **Note:** Cannot be used to serialize objects with built-in scripts attached or objects allocated within built-in scripts. +Returns the passed ``instance`` converted to a Dictionary. Can be useful for serializing. :: @@ -1102,6 +1106,10 @@ Prints out: [@subpath, @path, foo] [, res://test.gd, bar] +\ **Note:** This function can only be used to serialize objects with an attached :ref:`GDScript` stored in a separate file. Objects without an attached script, with a script written in another language, or with a built-in script are not supported. + +\ **Note:** This function is not recursive, which means that nested objects will not be represented as dictionaries. Also, properties passed by reference (:ref:`Object`, :ref:`Dictionary`, :ref:`Array`, and packed arrays) are copied by reference, not duplicated. + .. rst-class:: classref-item-separator ---- @@ -1131,9 +1139,9 @@ Unlike the right operand of the ``is`` operator, ``type`` can be a non-constant print(is_instance_of(a, MyClass)) print(is_instance_of(a, MyClass.InnerClass)) -\ **Note:** If ``value`` and/or ``type`` are freed objects (see :ref:`@GlobalScope.is_instance_valid`), or ``type`` is not one of the above options, this method will raise a runtime error. +\ **Note:** If ``value`` and/or ``type`` are freed objects (see :ref:`@GlobalScope.is_instance_valid()`), or ``type`` is not one of the above options, this method will raise a runtime error. -See also :ref:`@GlobalScope.typeof`, :ref:`type_exists`, :ref:`Array.is_same_typed` (and other :ref:`Array` methods). +See also :ref:`@GlobalScope.typeof()`, :ref:`type_exists()`, :ref:`Array.is_same_typed()` (and other :ref:`Array` methods). .. rst-class:: classref-item-separator @@ -1165,7 +1173,7 @@ Returns the length of the given Variant ``var``. The length can be the character :ref:`Resource` **load**\ (\ path\: :ref:`String`\ ) :ref:`πŸ”—` -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`. This method is equivalent of using :ref:`ResourceLoader.load` with :ref:`ResourceLoader.CACHE_MODE_REUSE`. +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()`. This method is equivalent of using :ref:`ResourceLoader.load()` with :ref:`ResourceLoader.CACHE_MODE_REUSE`. \ **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 current script. @@ -1176,11 +1184,11 @@ Returns a :ref:`Resource` from the filesystem located at the abs \ **Important:** Relative paths are *not* relative to the script calling this method, instead it is prefixed with ``"res://"``. Loading from relative paths might not work as expected. -This function 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:** 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`. +\ **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`. -\ **Note:** If :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary` is ``true``, :ref:`load` will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary` to ``false``. +\ **Note:** If :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary` is ``true``, :ref:`load()` will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary` to ``false``. .. rst-class:: classref-item-separator @@ -1192,7 +1200,7 @@ This function is a simplified version of :ref:`ResourceLoader.load` **preload**\ (\ path\: :ref:`String`\ ) :ref:`πŸ”—` -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`. +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 current script. @@ -1201,7 +1209,7 @@ Returns a :ref:`Resource` from the filesystem located at ``path` # Create instance of a scene. var diamond = preload("res://diamond.tscn").instantiate() -\ **Note:** :ref:`preload` is a keyword, not a function. So you cannot access it as a :ref:`Callable`. +\ **Note:** :ref:`preload()` is a keyword, not a function. So you cannot access it as a :ref:`Callable`. .. rst-class:: classref-item-separator @@ -1213,7 +1221,7 @@ Returns a :ref:`Resource` from the filesystem located at ``path` |void| **print_debug**\ (\ ...\ ) |vararg| :ref:`πŸ”—` -Like :ref:`@GlobalScope.print`, but includes the current stack frame when running with the debugger turned on. +Like :ref:`@GlobalScope.print()`, but includes the current stack frame when running with the debugger turned on. The output in the console may look like the following: @@ -1234,7 +1242,7 @@ The output in the console may look like the following: |void| **print_stack**\ (\ ) :ref:`πŸ”—` -Prints a stack trace at the current code location. See also :ref:`get_stack`. +Prints a stack trace at the current code location. See also :ref:`get_stack()`. The output in the console may look like the following: @@ -1242,7 +1250,7 @@ The output in the console may look like the following: Frame 0 - res://test.gd:16 in function '_process' -\ **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:** 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:** Calling this function from a :ref:`Thread` is not supported. Doing so will instead print the thread ID. @@ -1256,7 +1264,7 @@ The output in the console may look like the following: :ref:`Array` **range**\ (\ ...\ ) |vararg| :ref:`πŸ”—` -Returns an array with the given range. :ref:`range` can be called in three ways: +Returns an array with the given range. :ref:`range()` can be called in three ways: \ ``range(n: int)``: Starts from 0, increases by steps of 1, and stops *before* ``n``. The argument ``n`` is **exclusive**. @@ -1264,7 +1272,7 @@ Returns an array with the given range. :ref:`range \ ``range(b: int, n: int, s: int)``: Starts from ``b``, increases/decreases by steps of ``s``, and stops *before* ``n``. The arguments ``b`` and ``n`` are **inclusive** and **exclusive**, respectively. The argument ``s`` **can** be negative, but not ``0``. If ``s`` is ``0``, an error message is printed. -\ :ref:`range` converts all arguments to :ref:`int` before processing. +\ :ref:`range()` converts all arguments to :ref:`int` before processing. \ **Note:** Returns an empty array if no value meets the value constraint (e.g. ``range(2, 5, -1)`` or ``range(5, 5, 1)``). diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index ab1ee76ea6b..c62deeffdc9 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -305,6 +305,14 @@ Methods +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`seed`\ (\ base\: :ref:`int`\ ) | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`sigmoid`\ (\ x\: :ref:`float`\ ) | + +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`sigmoid_affine`\ (\ x\: :ref:`float`, amplitude\: :ref:`float`, y_translation\: :ref:`float`\ ) | + +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`sigmoid_affine_approx`\ (\ x\: :ref:`float`, amplitude\: :ref:`float`, y_translation\: :ref:`float`\ ) | + +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`sigmoid_approx`\ (\ x\: :ref:`float`\ ) | + +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`sign`\ (\ x\: :ref:`Variant`\ ) | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`signf`\ (\ x\: :ref:`float`\ ) | @@ -487,7 +495,7 @@ enum **ClockDirection**: :ref:`πŸ”—` :ref:`ClockDirection` **CLOCKWISE** = ``0`` -Clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90`). +Clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90()`). .. _class_@GlobalScope_constant_COUNTERCLOCKWISE: @@ -495,7 +503,7 @@ Clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90` **COUNTERCLOCKWISE** = ``1`` -Counter-clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90`). +Counter-clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90()`). .. rst-class:: classref-item-separator @@ -2329,7 +2337,7 @@ Key Code mask. .. rst-class:: classref-enumeration-constant -:ref:`KeyModifierMask` **KEY_MODIFIER_MASK** = ``532676608`` +:ref:`KeyModifierMask` **KEY_MODIFIER_MASK** = ``2130706432`` Modifier key mask. @@ -2407,7 +2415,7 @@ enum **KeyLocation**: :ref:`πŸ”—` Used for keys which only appear once, or when a comparison doesn't need to differentiate the ``LEFT`` and ``RIGHT`` versions. -For example, when using :ref:`InputEvent.is_match`, an event which has :ref:`KEY_LOCATION_UNSPECIFIED` will match any :ref:`KeyLocation` on the passed event. +For example, when using :ref:`InputEvent.is_match()`, an event which has :ref:`KEY_LOCATION_UNSPECIFIED` will match any :ref:`KeyLocation` on the passed event. .. _class_@GlobalScope_constant_KEY_LOCATION_LEFT: @@ -3995,7 +4003,7 @@ Editing the property prompts the user for restarting the editor. :ref:`PropertyUsageFlags` **PROPERTY_USAGE_SCRIPT_VARIABLE** = ``4096`` -The property is a script variable. :ref:`PROPERTY_USAGE_SCRIPT_VARIABLE` can be used to distinguish between exported script variables from built-in variables (which don't have this usage flag). By default, :ref:`PROPERTY_USAGE_SCRIPT_VARIABLE` is **not** applied to variables that are created by overriding :ref:`Object._get_property_list` in a script. +The property is a script variable. :ref:`PROPERTY_USAGE_SCRIPT_VARIABLE` can be used to distinguish between exported script variables from built-in variables (which don't have this usage flag). By default, :ref:`PROPERTY_USAGE_SCRIPT_VARIABLE` is **not** applied to variables that are created by overriding :ref:`Object._get_property_list()` in a script. .. _class_@GlobalScope_constant_PROPERTY_USAGE_STORE_IF_NULL: @@ -4053,7 +4061,7 @@ The property is an array. :ref:`PropertyUsageFlags` **PROPERTY_USAGE_ALWAYS_DUPLICATE** = ``524288`` -When duplicating a resource with :ref:`Resource.duplicate`, and this flag is set on a property of that resource, the property should always be duplicated, regardless of the ``subresources`` bool parameter. +When duplicating a resource with :ref:`Resource.duplicate()`, and this flag is set on a property of that resource, the property should always be duplicated, regardless of the ``subresources`` bool parameter. .. _class_@GlobalScope_constant_PROPERTY_USAGE_NEVER_DUPLICATE: @@ -4061,7 +4069,7 @@ When duplicating a resource with :ref:`Resource.duplicate` **PROPERTY_USAGE_NEVER_DUPLICATE** = ``1048576`` -When duplicating a resource with :ref:`Resource.duplicate`, and this flag is set on a property of that resource, the property should never be duplicated, regardless of the ``subresources`` bool parameter. +When duplicating a resource with :ref:`Resource.duplicate()`, and this flag is set on a property of that resource, the property should never be duplicated, regardless of the ``subresources`` bool parameter. .. _class_@GlobalScope_constant_PROPERTY_USAGE_HIGH_END_GFX: @@ -4217,7 +4225,15 @@ Flag for a static method. :ref:`MethodFlags` **METHOD_FLAG_OBJECT_CORE** = ``64`` -Used internally. Allows to not dump core virtual methods (such as :ref:`Object._notification`) to the JSON API. +Used internally. Allows to not dump core virtual methods (such as :ref:`Object._notification()`) to the JSON API. + +.. _class_@GlobalScope_constant_METHOD_FLAG_VIRTUAL_REQUIRED: + +.. rst-class:: classref-enumeration-constant + +:ref:`MethodFlags` **METHOD_FLAG_VIRTUAL_REQUIRED** = ``128`` + +Flag for a virtual method that is required. .. _class_@GlobalScope_constant_METHOD_FLAGS_DEFAULT: @@ -5269,7 +5285,7 @@ Returns the absolute value of a :ref:`Variant` parameter ``x`` (i var f = abs(Vector3i(-7, -8, -9)) # f is (7, 8, 9) -\ **Note:** For better type safety, use :ref:`absf`, :ref:`absi`, :ref:`Vector2.abs`, :ref:`Vector2i.abs`, :ref:`Vector3.abs`, :ref:`Vector3i.abs`, :ref:`Vector4.abs`, or :ref:`Vector4i.abs`. +\ **Note:** For better type safety, use :ref:`absf()`, :ref:`absi()`, :ref:`Vector2.abs()`, :ref:`Vector2i.abs()`, :ref:`Vector3.abs()`, :ref:`Vector3i.abs()`, :ref:`Vector4.abs()`, or :ref:`Vector4i.abs()`. .. rst-class:: classref-item-separator @@ -5315,7 +5331,7 @@ Returns the absolute value of int parameter ``x`` (i.e. positive value). :ref:`float` **acos**\ (\ x\: :ref:`float`\ ) :ref:`πŸ”—` -Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x``. ``x`` will be clamped between ``-1.0`` and ``1.0`` (inclusive), in order to prevent :ref:`acos` from returning :ref:`@GDScript.NAN`. +Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x``. ``x`` will be clamped between ``-1.0`` and ``1.0`` (inclusive), in order to prevent :ref:`acos()` from returning :ref:`@GDScript.NAN`. :: @@ -5332,7 +5348,7 @@ Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x`` :ref:`float` **acosh**\ (\ x\: :ref:`float`\ ) :ref:`πŸ”—` -Returns the hyperbolic arc (also called inverse) cosine of ``x``, returning a value in radians. Use it to get the angle from an angle's cosine in hyperbolic space if ``x`` is larger or equal to 1. For values of ``x`` lower than 1, it will return 0, in order to prevent :ref:`acosh` from returning :ref:`@GDScript.NAN`. +Returns the hyperbolic arc (also called inverse) cosine of ``x``, returning a value in radians. Use it to get the angle from an angle's cosine in hyperbolic space if ``x`` is larger or equal to 1. For values of ``x`` lower than 1, it will return 0, in order to prevent :ref:`acosh()` from returning :ref:`@GDScript.NAN`. :: @@ -5363,7 +5379,7 @@ Returns the difference between the two angles (in radians), in the range of ``[- :ref:`float` **asin**\ (\ x\: :ref:`float`\ ) :ref:`πŸ”—` -Returns the arc sine of ``x`` in radians. Use to get the angle of sine ``x``. ``x`` will be clamped between ``-1.0`` and ``1.0`` (inclusive), in order to prevent :ref:`asin` from returning :ref:`@GDScript.NAN`. +Returns the arc sine of ``x`` in radians. Use to get the angle of sine ``x``. ``x`` will be clamped between ``-1.0`` and ``1.0`` (inclusive), in order to prevent :ref:`asin()` from returning :ref:`@GDScript.NAN`. :: @@ -5399,7 +5415,7 @@ Returns the hyperbolic arc (also called inverse) sine of ``x``, returning a valu Returns the arc tangent of ``x`` in radians. Use it to get the angle from an angle's tangent in trigonometry. -The method cannot know in which quadrant the angle should fall. See :ref:`atan2` if you have both ``y`` and ``x``. +The method cannot know in which quadrant the angle should fall. See :ref:`atan2()` if you have both ``y`` and ``x``. :: @@ -5437,7 +5453,7 @@ Important note: The Y coordinate comes first, by convention. Returns the hyperbolic arc (also called inverse) tangent of ``x``, returning a value in radians. Use it to get the angle from an angle's tangent in hyperbolic space if ``x`` is between -1 and 1 (non-inclusive). -In mathematics, the inverse hyperbolic tangent is only defined for -1 < ``x`` < 1 in the real set, so values equal or lower to -1 for ``x`` return negative :ref:`@GDScript.INF` and values equal or higher than 1 return positive :ref:`@GDScript.INF` in order to prevent :ref:`atanh` from returning :ref:`@GDScript.NAN`. +In mathematics, the inverse hyperbolic tangent is only defined for -1 < ``x`` < 1 in the real set, so values equal or lower to -1 for ``x`` return negative :ref:`@GDScript.INF` and values equal or higher than 1 return positive :ref:`@GDScript.INF` in order to prevent :ref:`atanh()` from returning :ref:`@GDScript.NAN`. :: @@ -5483,7 +5499,7 @@ Returns the point at the given ``t`` on a one-dimensional `BΓ©zier curve ` value, without decoding objects. -\ **Note:** If you need object deserialization, see :ref:`bytes_to_var_with_objects`. +\ **Note:** If you need object deserialization, see :ref:`bytes_to_var_with_objects()`. .. rst-class:: classref-item-separator @@ -5516,9 +5532,9 @@ Rounds ``x`` upward (towards positive infinity), returning the smallest whole nu var i = ceil(1.45) # i is 2.0 i = ceil(1.001) # i is 2.0 -See also :ref:`floor`, :ref:`round`, and :ref:`snapped`. +See also :ref:`floor()`, :ref:`round()`, and :ref:`snapped()`. -\ **Note:** For better type safety, use :ref:`ceilf`, :ref:`ceili`, :ref:`Vector2.ceil`, :ref:`Vector3.ceil`, or :ref:`Vector4.ceil`. +\ **Note:** For better type safety, use :ref:`ceilf()`, :ref:`ceili()`, :ref:`Vector2.ceil()`, :ref:`Vector3.ceil()`, or :ref:`Vector4.ceil()`. .. rst-class:: classref-item-separator @@ -5532,7 +5548,7 @@ See also :ref:`floor`, :ref:`round`, returning a :ref:`float`. +A type-safe version of :ref:`ceil()`, returning a :ref:`float`. .. rst-class:: classref-item-separator @@ -5546,7 +5562,7 @@ A type-safe version of :ref:`ceil`, returning a Rounds ``x`` upward (towards positive infinity), returning the smallest whole number that is not less than ``x``. -A type-safe version of :ref:`ceil`, returning an :ref:`int`. +A type-safe version of :ref:`ceil()`, returning an :ref:`int`. .. rst-class:: classref-item-separator @@ -5568,7 +5584,7 @@ Clamps the ``value``, returning a :ref:`Variant` not less than `` var b = clamp(8.1, 0.9, 5.5) # b is 5.5 -\ **Note:** For better type safety, use :ref:`clampf`, :ref:`clampi`, :ref:`Vector2.clamp`, :ref:`Vector2i.clamp`, :ref:`Vector3.clamp`, :ref:`Vector3i.clamp`, :ref:`Vector4.clamp`, :ref:`Vector4i.clamp`, or :ref:`Color.clamp` (not currently supported by this method). +\ **Note:** For better type safety, use :ref:`clampf()`, :ref:`clampi()`, :ref:`Vector2.clamp()`, :ref:`Vector2i.clamp()`, :ref:`Vector3.clamp()`, :ref:`Vector3i.clamp()`, :ref:`Vector4.clamp()`, :ref:`Vector4i.clamp()`, or :ref:`Color.clamp()` (not currently supported by this method). \ **Note:** When using this on vectors it will *not* perform component-wise clamping, and will pick ``min`` if ``value < min`` or ``max`` if ``value > max``. To perform component-wise clamping use the methods listed above. @@ -5668,7 +5684,7 @@ Cubic interpolates between two values by the factor defined in ``weight`` with ` :ref:`float` **cubic_interpolate_angle**\ (\ from\: :ref:`float`, to\: :ref:`float`, pre\: :ref:`float`, post\: :ref:`float`, weight\: :ref:`float`\ ) :ref:`πŸ”—` -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()`. .. rst-class:: classref-item-separator @@ -5680,9 +5696,9 @@ Cubic interpolates between two rotation values with shortest path by the factor :ref:`float` **cubic_interpolate_angle_in_time**\ (\ 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\: :ref:`float`\ ) :ref:`πŸ”—` -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 :ref:`cubic_interpolate` by the time values. +It can perform smoother interpolation than :ref:`cubic_interpolate()` by the time values. .. rst-class:: classref-item-separator @@ -5696,7 +5712,7 @@ It can perform smoother interpolation than :ref:`cubic_interpolate` by the time values. +It can perform smoother interpolation than :ref:`cubic_interpolate()` by the time values. .. rst-class:: classref-item-separator @@ -5750,7 +5766,7 @@ Returns an "eased" value of ``x`` based on an easing function defined with ``cur \ `ease() curve values cheatsheet `__\ -See also :ref:`smoothstep`. If you need to perform more advanced transitions, use :ref:`Tween.interpolate_value`. +See also :ref:`smoothstep()`. If you need to perform more advanced transitions, use :ref:`Tween.interpolate_value()`. .. rst-class:: classref-item-separator @@ -5767,9 +5783,9 @@ Returns a human-readable name for the given :ref:`Error :: 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 + print(error_string(OK)) # Prints "OK" + print(error_string(ERR_BUSY)) # Prints "Busy" + print(error_string(ERR_OUT_OF_MEMORY)) # Prints "Out of memory" .. rst-class:: classref-item-separator @@ -5785,7 +5801,7 @@ The natural exponential function. It raises the mathematical constant *e* to the \ *e* has an approximate value of 2.71828, and can be obtained with ``exp(1)``. -For exponents to other bases use the method :ref:`pow`. +For exponents to other bases use the method :ref:`pow()`. :: @@ -5808,9 +5824,9 @@ Rounds ``x`` downward (towards negative infinity), returning the largest whole n 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`. +See also :ref:`ceil()`, :ref:`round()`, and :ref:`snapped()`. -\ **Note:** For better type safety, use :ref:`floorf`, :ref:`floori`, :ref:`Vector2.floor`, :ref:`Vector3.floor`, or :ref:`Vector4.floor`. +\ **Note:** For better type safety, use :ref:`floorf()`, :ref:`floori()`, :ref:`Vector2.floor()`, :ref:`Vector3.floor()`, or :ref:`Vector4.floor()`. .. rst-class:: classref-item-separator @@ -5824,7 +5840,7 @@ See also :ref:`ceil`, :ref:`round`, returning a :ref:`float`. +A type-safe version of :ref:`floor()`, returning a :ref:`float`. .. rst-class:: classref-item-separator @@ -5838,7 +5854,7 @@ A type-safe version of :ref:`floor`, returning Rounds ``x`` downward (towards negative infinity), returning the largest whole number that is not more than ``x``. -A type-safe version of :ref:`floor`, returning an :ref:`int`. +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. @@ -5927,31 +5943,31 @@ Returns the integer hash of the passed ``variable``. :ref:`Object` **instance_from_id**\ (\ instance_id\: :ref:`int`\ ) :ref:`πŸ”—` -Returns the :ref:`Object` that corresponds to ``instance_id``. All Objects have a unique instance ID. See also :ref:`Object.get_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()`. .. tabs:: .. code-tab:: gdscript - var foo = "bar" + var drink = "water" func _ready(): var id = get_instance_id() - var inst = instance_from_id(id) - print(inst.foo) # Prints bar + var instance = instance_from_id(id) + print(instance.foo) # Prints "water" .. code-tab:: csharp public partial class MyNode : Node { - public string Foo { get; set; } = "bar"; + public string Drink { get; set; } = "water"; public override void _Ready() { ulong id = GetInstanceId(); - var inst = (MyNode)InstanceFromId(Id); - GD.Print(inst.Foo); // Prints bar + var instance = (MyNode)InstanceFromId(Id); + GD.Print(instance.Drink); // Prints "water" } } @@ -5967,7 +5983,7 @@ Returns the :ref:`Object` that corresponds to ``instance_id``. All :ref:`float` **inverse_lerp**\ (\ from\: :ref:`float`, to\: :ref:`float`, weight\: :ref:`float`\ ) :ref:`πŸ”—` -Returns an interpolation or extrapolation factor considering the range specified in ``from`` and ``to``, and the interpolated value specified in ``weight``. The returned value will be between ``0.0`` and ``1.0`` if ``weight`` is between ``from`` and ``to`` (inclusive). If ``weight`` is located outside this range, then an extrapolation factor will be returned (return value lower than ``0.0`` or greater than ``1.0``). Use :ref:`clamp` on the result of :ref:`inverse_lerp` if this is not desired. +Returns an interpolation or extrapolation factor considering the range specified in ``from`` and ``to``, and the interpolated value specified in ``weight``. The returned value will be between ``0.0`` and ``1.0`` if ``weight`` is between ``from`` and ``to`` (inclusive). If ``weight`` is located outside this range, then an extrapolation factor will be returned (return value lower than ``0.0`` or greater than ``1.0``). Use :ref:`clamp()` on the result of :ref:`inverse_lerp()` if this is not desired. :: @@ -5979,7 +5995,7 @@ Returns an interpolation or extrapolation factor considering the range specified var ratio = inverse_lerp(20, 30, 27.5) # 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. .. rst-class:: classref-item-separator @@ -6101,7 +6117,7 @@ These are :ref:`Variant` reference types: :ref:`Object` with one value as zero. +This function is faster than using :ref:`is_equal_approx()` with one value as zero. .. rst-class:: classref-item-separator @@ -6113,7 +6129,7 @@ This function is faster than using :ref:`is_equal_approx` **lerp**\ (\ from\: :ref:`Variant`, to\: :ref:`Variant`, weight\: :ref:`Variant`\ ) :ref:`πŸ”—` -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` to limit ``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*. If this is not desired, use :ref:`clampf()` to limit ``weight``. Both ``from`` and ``to`` must be the same type. Supported types: :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`, :ref:`Color`, :ref:`Quaternion`, :ref:`Basis`, :ref:`Transform2D`, :ref:`Transform3D`. @@ -6121,9 +6137,9 @@ Both ``from`` and ``to`` must be the same type. Supported types: :ref:`int` 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. +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, use :ref:`lerpf`, :ref:`Vector2.lerp`, :ref:`Vector3.lerp`, :ref:`Vector4.lerp`, :ref:`Color.lerp`, :ref:`Quaternion.slerp`, :ref:`Basis.slerp`, :ref:`Transform2D.interpolate_with`, or :ref:`Transform3D.interpolate_with`. +\ **Note:** For better type safety, use :ref:`lerpf()`, :ref:`Vector2.lerp()`, :ref:`Vector3.lerp()`, :ref:`Vector4.lerp()`, :ref:`Color.lerp()`, :ref:`Quaternion.slerp()`, :ref:`Basis.slerp()`, :ref:`Transform2D.interpolate_with()`, or :ref:`Transform3D.interpolate_with()`. .. rst-class:: classref-item-separator @@ -6137,7 +6153,7 @@ See also :ref:`inverse_lerp` which perfo 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`. +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()`. :: @@ -6161,13 +6177,13 @@ Similar to :ref:`lerp`, but interpolates correct :ref:`float` **lerpf**\ (\ from\: :ref:`float`, to\: :ref:`float`, weight\: :ref:`float`\ ) :ref:`πŸ”—` -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. +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. :: lerpf(0, 4, 0.75) # Returns 3.0 -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:`inverse_lerp()` which performs the reverse of this operation. To perform eased interpolation with :ref:`lerp()`, combine it with :ref:`ease()` or :ref:`smoothstep()`. .. rst-class:: classref-item-separator @@ -6223,7 +6239,7 @@ Returns the maximum of the given numeric values. This function can take any numb max(1, 7, 3, -6, 5) # Returns 7 -\ **Note:** When using this on vectors it will *not* perform component-wise maximum, and will pick the largest value when compared using ``x < y``. To perform component-wise maximum, use :ref:`Vector2.max`, :ref:`Vector2i.max`, :ref:`Vector3.max`, :ref:`Vector3i.max`, :ref:`Vector4.max`, and :ref:`Vector4i.max`. +\ **Note:** When using this on vectors it will *not* perform component-wise maximum, and will pick the largest value when compared using ``x < y``. To perform component-wise maximum, use :ref:`Vector2.max()`, :ref:`Vector2i.max()`, :ref:`Vector3.max()`, :ref:`Vector3i.max()`, :ref:`Vector4.max()`, and :ref:`Vector4i.max()`. .. rst-class:: classref-item-separator @@ -6275,7 +6291,7 @@ Returns the minimum of the given numeric values. This function can take any numb min(1, 7, 3, -6, 5) # Returns -6 -\ **Note:** When using this on vectors it will *not* perform component-wise minimum, and will pick the smallest value when compared using ``x < y``. To perform component-wise minimum, use :ref:`Vector2.min`, :ref:`Vector2i.min`, :ref:`Vector3.min`, :ref:`Vector3i.min`, :ref:`Vector4.min`, and :ref:`Vector4i.min`. +\ **Note:** When using this on vectors it will *not* perform component-wise minimum, and will pick the smallest value when compared using ``x < y``. To perform component-wise minimum, use :ref:`Vector2.min()`, :ref:`Vector2i.min()`, :ref:`Vector3.min()`, :ref:`Vector3i.min()`, :ref:`Vector4.min()`, and :ref:`Vector4i.min()`. .. rst-class:: classref-item-separator @@ -6448,16 +6464,16 @@ Converts one or more arguments of any type to string in the best way possible an .. code-tab:: gdscript var a = [1, 2, 3] - print("a", "b", a) # Prints ab[1, 2, 3] + print("a", "b", a) # Prints "ab[1, 2, 3]" .. code-tab:: csharp - var a = new Godot.Collections.Array { 1, 2, 3 }; - GD.Print("a", "b", a); // Prints ab[1, 2, 3] + Godot.Collections.Array a = [1, 2, 3]; + GD.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` 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. See also :ref:`Engine.print_to_stdout` and :ref:`ProjectSettings.application/run/disable_stdout`. +\ **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. See also :ref:`Engine.print_to_stdout` and :ref:`ProjectSettings.application/run/disable_stdout`. .. rst-class:: classref-item-separator @@ -6482,19 +6498,19 @@ When printing to standard output, the supported subset of BBCode is converted to .. code-tab:: gdscript - print_rich("[color=green][b]Hello world![/b][/color]") # Prints out "Hello world!" in green with a bold font + print_rich("[color=green][b]Hello world![/b][/color]") # Prints "Hello world!", in green with a bold font. .. code-tab:: csharp - GD.PrintRich("[color=green][b]Hello world![/b][/color]"); // Prints out "Hello world!" in green with a bold font + GD.PrintRich("[color=green][b]Hello world![/b][/color]"); // Prints "Hello world!", in green with a bold font. -\ **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. +\ **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. \ **Note:** On Windows, only Windows 10 and later correctly displays ANSI escape codes in standard output. -\ **Note:** Output displayed in the editor supports clickable ``[url=address]text[/url]`` tags. The ``[url]`` tag's ``address`` value is handled by :ref:`OS.shell_open` when clicked. +\ **Note:** Output displayed in the editor supports clickable ``[url=address]text[/url]`` tags. The ``[url]`` tag's ``address`` value is handled by :ref:`OS.shell_open()` when clicked. .. rst-class:: classref-item-separator @@ -6506,7 +6522,7 @@ When printing to standard output, the supported subset of BBCode is converted to |void| **print_verbose**\ (\ ...\ ) |vararg| :ref:`πŸ”—` -If verbose mode is enabled (:ref:`OS.is_stdout_verbose` returning ``true``), converts one or more arguments of any type to string in the best way possible and prints them to the console. +If verbose mode is enabled (:ref:`OS.is_stdout_verbose()` returning ``true``), converts one or more arguments of any type to string in the best way possible and prints them to the console. .. rst-class:: classref-item-separator @@ -6543,7 +6559,7 @@ Prints one or more arguments to strings in the best way possible to standard err |void| **printraw**\ (\ ...\ ) |vararg| :ref:`πŸ”—` -Prints one or more arguments to strings in the best way possible to the OS terminal. Unlike :ref:`print`, no newline is automatically added at the end. +Prints one or more arguments to strings in the best way possible to the OS terminal. Unlike :ref:`print()`, no newline is automatically added at the end. \ **Note:** The OS terminal is *not* the same as the editor's Output dock. The output sent to the OS terminal can be seen when running Redot from a terminal. On Windows, this requires using the ``console.exe`` executable. @@ -6552,17 +6568,17 @@ Prints one or more arguments to strings in the best way possible to the OS termi .. code-tab:: gdscript + # Prints "ABC" to terminal. printraw("A") printraw("B") printraw("C") - # Prints ABC to terminal .. code-tab:: csharp + // Prints "ABC" to terminal. GD.PrintRaw("A"); GD.PrintRaw("B"); GD.PrintRaw("C"); - // Prints ABC to terminal @@ -6583,11 +6599,11 @@ Prints one or more arguments to the console with a space between each argument. .. code-tab:: gdscript - prints("A", "B", "C") # Prints A B C + prints("A", "B", "C") # Prints "A B C" .. code-tab:: csharp - GD.PrintS("A", "B", "C"); // Prints A B C + GD.PrintS("A", "B", "C"); // Prints "A B C" @@ -6608,11 +6624,11 @@ Prints one or more arguments to the console with a tab between each argument. .. code-tab:: gdscript - printt("A", "B", "C") # Prints A B C + printt("A", "B", "C") # Prints "A B C" .. code-tab:: csharp - GD.PrintT("A", "B", "C"); // Prints A B C + GD.PrintT("A", "B", "C"); // Prints "A B C" @@ -6633,11 +6649,11 @@ Pushes an error message to Redot's built-in debugger and to the OS terminal. .. code-tab:: gdscript - push_error("test error") # Prints "test error" to debugger and terminal as error call + push_error("test error") # Prints "test error" to debugger and terminal as an error. .. code-tab:: csharp - GD.PushError("test error"); // Prints "test error" to debugger and terminal as error call + GD.PushError("test error"); // Prints "test error" to debugger and terminal as an error. @@ -6660,11 +6676,11 @@ Pushes a warning message to Redot's built-in debugger and to the OS terminal. .. code-tab:: gdscript - push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call + push_warning("test warning") # Prints "test warning" to debugger and terminal as a warning. .. code-tab:: csharp - GD.PushWarning("test warning"); // Prints "test warning" to debugger and terminal as warning call + GD.PushWarning("test warning"); // Prints "test warning" to debugger and terminal as a warning. @@ -6843,7 +6859,7 @@ Returns a random signed 32-bit integer between ``from`` and ``to`` (inclusive). 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 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. +\ **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. .. rst-class:: classref-item-separator @@ -6855,7 +6871,7 @@ Randomizes the seed (or the internal state) of the random number generator. The :ref:`float` **remap**\ (\ value\: :ref:`float`, istart\: :ref:`float`, istop\: :ref:`float`, ostart\: :ref:`float`, ostop\: :ref:`float`\ ) :ref:`πŸ”—` -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. +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. :: @@ -6901,7 +6917,7 @@ Creates an RID from a ``base``. This is used mainly from native extensions to bu Rotates ``from`` toward ``to`` by the ``delta`` amount. Will not go past ``to``. -Similar to :ref:`move_toward`, but interpolates correctly when the angles wrap around :ref:`@GDScript.TAU`. +Similar to :ref:`move_toward()`, but interpolates correctly when the angles wrap around :ref:`@GDScript.TAU`. If ``delta`` is negative, this function will rotate away from ``to``, toward the opposite angle, and will not go past the opposite angle. @@ -6923,9 +6939,9 @@ Rounds ``x`` to the nearest whole number, with halfway cases rounded away from 0 round(2.5) # Returns 3 round(2.6) # Returns 3 -See also :ref:`floor`, :ref:`ceil`, and :ref:`snapped`. +See also :ref:`floor()`, :ref:`ceil()`, and :ref:`snapped()`. -\ **Note:** For better type safety, use :ref:`roundf`, :ref:`roundi`, :ref:`Vector2.round`, :ref:`Vector3.round`, or :ref:`Vector4.round`. +\ **Note:** For better type safety, use :ref:`roundf()`, :ref:`roundi()`, :ref:`Vector2.round()`, :ref:`Vector3.round()`, or :ref:`Vector4.round()`. .. rst-class:: classref-item-separator @@ -6939,7 +6955,7 @@ See also :ref:`floor`, :ref:`ceil`, returning a :ref:`float`. +A type-safe version of :ref:`round()`, returning a :ref:`float`. .. rst-class:: classref-item-separator @@ -6953,7 +6969,7 @@ A type-safe version of :ref:`round`, returning Rounds ``x`` to the nearest whole number, with halfway cases rounded away from 0. -A type-safe version of :ref:`round`, returning an :ref:`int`. +A type-safe version of :ref:`round()`, returning an :ref:`int`. .. rst-class:: classref-item-separator @@ -6990,6 +7006,118 @@ Sets the seed for the random number generator to ``base``. Setting the seed manu +.. rst-class:: classref-item-separator + +---- + +.. _class_@GlobalScope_method_sigmoid: + +.. rst-class:: classref-method + +:ref:`float` **sigmoid**\ (\ x\: :ref:`float`\ ) :ref:`πŸ”—` + +Computes the sigmoid for ``x``, which maps the input value into the range (0, 1). + +The sigmoid function is defined as: + +:: + + sigmoid(x) = 1 / (1 + exp(-x)) + +This is the most accurate implementation of the sigmoid. + +:: + + var result = sigmoid(0.0) # result is 0.5 + var result = sigmoid(1.0) # result is approximately 0.7310 + var result = sigmoid(-1.0) # result is approximately 0.2689 + var result = sigmoid(5.0) # result is approximately 0.9933 + +\ **Note:** For faster but less accurate approximation, see :ref:`sigmoid_approx()`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_@GlobalScope_method_sigmoid_affine: + +.. rst-class:: classref-method + +:ref:`float` **sigmoid_affine**\ (\ x\: :ref:`float`, amplitude\: :ref:`float`, y_translation\: :ref:`float`\ ) :ref:`πŸ”—` + +Computes an affine-transformed sigmoid for ``x``, which allows scaling by ``amplitude`` and translation by ``y_translation``. + +The affine sigmoid function is defined as: + +:: + + sigmoid_affine(x, amplitude, y_translation) = (amplitude / (1 + exp(-x))) + y_translation + +This function modifies the standard sigmoid by introducing scaling and vertical translation. + +:: + + var result = sigmoid_affine(0.0, 1.0, 0.0) # result is 0.5 + var result = sigmoid_affine(1.0, 2.0, -1.0) # result is approximately 0.4621 + var result = sigmoid_affine(-1.0, 3.0, 2.0) # result is approximately 2.8068 + var result = sigmoid_affine(1.0, 2.0, 2.5) # result is approximately 3.9621 + +\ **Note:** This is a more accurate but computationally heavier version of the affine sigmoid. For faster approximations, see :ref:`sigmoid_affine_approx()`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_@GlobalScope_method_sigmoid_affine_approx: + +.. rst-class:: classref-method + +:ref:`float` **sigmoid_affine_approx**\ (\ x\: :ref:`float`, amplitude\: :ref:`float`, y_translation\: :ref:`float`\ ) :ref:`πŸ”—` + +Computes an approximation of the affine-transformed sigmoid function for ``x``, allowing scaling by ``amplitude`` and translation by ``y_translation``. + +The approximation function is defined as: + +:: + + affine_sigmoid_approx(x, amplitude, y_translation) = amplitude * (0.5 + (x / (4 + abs(x)))) + y_translation + +This function approximates the affine sigmoid, offering faster computation at the cost of some precision. It is useful in performance-sensitive environments where both transformation and speed are needed. + +:: + + var result = sigmoid_affine_approx(0.0, 1.0, 0.0) # result is 0.5 + var result = sigmoid_affine_approx(2.0, 2.0, 1.0) # result is approximately 2.6667 + var result = sigmoid_affine_approx(-1.0, 3.0, 0.5) # result is 1.4 + var result = sigmoid_affine_approx(1.0, 2.0, 2.5) # result is 3.9 + +.. rst-class:: classref-item-separator + +---- + +.. _class_@GlobalScope_method_sigmoid_approx: + +.. rst-class:: classref-method + +:ref:`float` **sigmoid_approx**\ (\ x\: :ref:`float`\ ) :ref:`πŸ”—` + +Computes an approximation of the sigmoid function for ``x``, which maps the input value into the range (0, 1). + +The approximation function is defined as: + +:: + + sigmoid_approx(x) = 0.5 + (x / (4 + abs(x))) + +This function is faster than the standard :ref:`sigmoid()`, especially useful in performance-sensitive environments where a balance between accuracy and speed is desired. + +:: + + var result = sigmoid_approx(0.0) # result is 0.5 + var result = sigmoid_approx(2.0) # result is approximately 0.8333 + var result = sigmoid_approx(-1.0) # result is 0.3 + var result = sigmoid_approx(5.0) # result is approximately 1.0555 + .. rst-class:: classref-item-separator ---- @@ -7013,7 +7141,7 @@ Supported types: :ref:`int`, :ref:`float`, :ref:`Vector2 sign(Vector3(-6.0, 0.0, 6.0)) # Returns (-1, 0, 1) -\ **Note:** For better type safety, use :ref:`signf`, :ref:`signi`, :ref:`Vector2.sign`, :ref:`Vector2i.sign`, :ref:`Vector3.sign`, :ref:`Vector3i.sign`, :ref:`Vector4.sign`, or :ref:`Vector4i.sign`. +\ **Note:** For better type safety, use :ref:`signf()`, :ref:`signi()`, :ref:`Vector2.sign()`, :ref:`Vector2i.sign()`, :ref:`Vector3.sign()`, :ref:`Vector3i.sign()`, :ref:`Vector4.sign()`, or :ref:`Vector4i.sign()`. .. rst-class:: classref-item-separator @@ -7111,7 +7239,7 @@ This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - smoothstep(0, 2, 1.0) # Returns 0.5 smoothstep(0, 2, 2.0) # Returns 1.0 -Compared to :ref:`ease` with a curve value of ``-1.6521``, :ref:`smoothstep` returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. +Compared to :ref:`ease()` with a curve value of ``-1.6521``, :ref:`smoothstep()` returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. \ `Comparison between smoothstep() and ease(x, -1.6521) return values `__\ @@ -7138,9 +7266,9 @@ The returned value is the same type of :ref:`Variant` as ``step`` snapped(Vector2(34, 70), Vector2(8, 8)) # Returns (32, 72) -See also :ref:`ceil`, :ref:`floor`, and :ref:`round`. +See also :ref:`ceil()`, :ref:`floor()`, and :ref:`round()`. -\ **Note:** For better type safety, use :ref:`snappedf`, :ref:`snappedi`, :ref:`Vector2.snapped`, :ref:`Vector2i.snapped`, :ref:`Vector3.snapped`, :ref:`Vector3i.snapped`, :ref:`Vector4.snapped`, or :ref:`Vector4i.snapped`. +\ **Note:** For better type safety, use :ref:`snappedf()`, :ref:`snappedi()`, :ref:`Vector2.snapped()`, :ref:`Vector2i.snapped()`, :ref:`Vector3.snapped()`, :ref:`Vector3i.snapped()`, :ref:`Vector4.snapped()`, or :ref:`Vector4i.snapped()`. .. rst-class:: classref-item-separator @@ -7154,7 +7282,7 @@ See also :ref:`ceil`, :ref:`floor`, returning a :ref:`float`. +A type-safe version of :ref:`snapped()`, returning a :ref:`float`. :: @@ -7173,7 +7301,7 @@ A type-safe version of :ref:`snapped`, return Returns the multiple of ``step`` that is the closest to ``x``. -A type-safe version of :ref:`snapped`, returning an :ref:`int`. +A type-safe version of :ref:`snapped()`, returning an :ref:`int`. :: @@ -7247,7 +7375,7 @@ Converts one or more arguments of any :ref:`Variant` type to a :r :ref:`Variant` **str_to_var**\ (\ string\: :ref:`String`\ ) :ref:`πŸ”—` -Converts a formatted ``string`` that was returned by :ref:`var_to_str` to the original :ref:`Variant`. +Converts a formatted ``string`` that was returned by :ref:`var_to_str()` to the original :ref:`Variant`. .. tabs:: @@ -7337,11 +7465,11 @@ Returns a human-readable name of the given ``type``, using the :ref:`Variant.Typ :: - print(TYPE_INT) # Prints 2. - print(type_string(TYPE_INT)) # Prints "int". - print(type_string(TYPE_STRING)) # Prints "String". + print(TYPE_INT) # Prints 2 + print(type_string(TYPE_INT)) # Prints "int" + print(type_string(TYPE_STRING)) # Prints "String" -See also :ref:`typeof`. +See also :ref:`typeof()`. .. rst-class:: classref-item-separator @@ -7360,12 +7488,12 @@ Returns the internal type of the given ``variable``, using the :ref:`Variant.Typ var json = JSON.new() json.parse('["a", "b", "c"]') var result = json.get_data() - if typeof(result) == TYPE_ARRAY: - print(result[0]) # Prints a + if result is Array: + print(result[0]) # Prints "a" else: - print("Unexpected result") + print("Unexpected result!") -See also :ref:`type_string`. +See also :ref:`type_string()`. .. rst-class:: classref-item-separator @@ -7377,9 +7505,9 @@ See also :ref:`type_string`. :ref:`PackedByteArray` **var_to_bytes**\ (\ variable\: :ref:`Variant`\ ) :ref:`πŸ”—` -Encodes a :ref:`Variant` value to a byte array, without encoding objects. Deserialization can be done with :ref:`bytes_to_var`. +Encodes a :ref:`Variant` value to a byte array, without encoding objects. Deserialization can be done with :ref:`bytes_to_var()`. -\ **Note:** If you need object serialization, see :ref:`var_to_bytes_with_objects`. +\ **Note:** If you need object serialization, see :ref:`var_to_bytes_with_objects()`. \ **Note:** Encoding :ref:`Callable` is not supported and will result in an empty value, regardless of the data. @@ -7393,7 +7521,7 @@ Encodes a :ref:`Variant` value to a byte array, without encoding :ref:`PackedByteArray` **var_to_bytes_with_objects**\ (\ variable\: :ref:`Variant`\ ) :ref:`πŸ”—` -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`. +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()`. \ **Note:** Encoding :ref:`Callable` is not supported and will result in an empty value, regardless of the data. @@ -7407,7 +7535,7 @@ Encodes a :ref:`Variant` value to a byte array. Encoding objects :ref:`String` **var_to_str**\ (\ variable\: :ref:`Variant`\ ) :ref:`πŸ”—` -Converts a :ref:`Variant` ``variable`` to a formatted :ref:`String` that can then 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()`. .. tabs:: @@ -7501,9 +7629,9 @@ Wraps the float ``value`` between ``min`` and ``max``. Can be used for creating # Infinite rotation (in radians) angle = wrapf(angle + 0.1, -PI, PI) -\ **Note:** If ``min`` is ``0``, this is equivalent to :ref:`fposmod`, so prefer using that instead. +\ **Note:** If ``min`` is ``0``, this is equivalent to :ref:`fposmod()`, so prefer using that instead. -\ :ref:`wrapf` is more flexible than using the :ref:`fposmod` approach by giving the user control over the minimum value. +\ :ref:`wrapf()` is more flexible than using the :ref:`fposmod()` approach by giving the user control over the minimum value. .. rst-class:: classref-item-separator diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 40a2d498fa0..a028c3f8f3e 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -17,11 +17,11 @@ A 3D axis-aligned bounding box. Description ----------- -The **AABB** built-in :ref:`Variant` type represents an axis-aligned bounding box in a 3D space. It is defined by its :ref:`position` and :ref:`size`, which are :ref:`Vector3`. It is frequently used for fast overlap tests (see :ref:`intersects`). Although **AABB** itself is axis-aligned, it can be combined with :ref:`Transform3D` to represent a rotated or skewed bounding box. +The **AABB** built-in :ref:`Variant` type represents an axis-aligned bounding box in a 3D space. It is defined by its :ref:`position` and :ref:`size`, which are :ref:`Vector3`. It is frequently used for fast overlap tests (see :ref:`intersects()`). Although **AABB** itself is axis-aligned, it can be combined with :ref:`Transform3D` to represent a rotated or skewed bounding box. It uses floating-point coordinates. The 2D counterpart to **AABB** is :ref:`Rect2`. There is no version of **AABB** that uses integer coordinates. -\ **Note:** Negative values for :ref:`size` are not supported. With negative size, most **AABB** methods do not work correctly. Use :ref:`abs` to get an equivalent **AABB** with a non-negative size. +\ **Note:** Negative values for :ref:`size` are not supported. With negative size, most **AABB** methods do not work correctly. Use :ref:`abs()` to get an equivalent **AABB** with a non-negative size. \ **Note:** In a boolean context, a **AABB** evaluates to ``false`` if both :ref:`position` and :ref:`size` are zero (equal to :ref:`Vector3.ZERO`). Otherwise, it always evaluates to ``true``. @@ -189,7 +189,7 @@ The origin point. This is usually the corner on the bottom-left and forward of t The bounding box's width, height, and depth starting from :ref:`position`. Setting this value also affects the :ref:`end` point. -\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Redot assume that the :ref:`position` is the bottom-left-forward corner, and the :ref:`end` is the top-right-back corner. To get an equivalent bounding box with non-negative size, use :ref:`abs`. +\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Redot assume that the :ref:`position` is the bottom-left-forward corner, and the :ref:`end` is the top-right-back corner. To get an equivalent bounding box with non-negative size, use :ref:`abs()`. .. rst-class:: classref-section-separator @@ -401,7 +401,7 @@ Returns the longest normalized axis of this bounding box's :ref:`size` and :ref:`get_longest_axis_size`. +See also :ref:`get_longest_axis_index()` and :ref:`get_longest_axis_size()`. .. rst-class:: classref-item-separator @@ -415,7 +415,7 @@ See also :ref:`get_longest_axis_index` Returns the index to the longest axis of this bounding box's :ref:`size` (see :ref:`Vector3.AXIS_X`, :ref:`Vector3.AXIS_Y`, and :ref:`Vector3.AXIS_Z`). -For an example, see :ref:`get_longest_axis`. +For an example, see :ref:`get_longest_axis()`. .. rst-class:: classref-item-separator @@ -429,7 +429,7 @@ For an example, see :ref:`get_longest_axis`. Returns the longest dimension of this bounding box's :ref:`size`. -For an example, see :ref:`get_longest_axis`. +For an example, see :ref:`get_longest_axis()`. .. rst-class:: classref-item-separator @@ -464,7 +464,7 @@ Returns the shortest normalized axis of this bounding box's :ref:`size` and :ref:`get_shortest_axis_size`. +See also :ref:`get_shortest_axis_index()` and :ref:`get_shortest_axis_size()`. .. rst-class:: classref-item-separator @@ -478,7 +478,7 @@ See also :ref:`get_shortest_axis_index` (see :ref:`Vector3.AXIS_X`, :ref:`Vector3.AXIS_Y`, and :ref:`Vector3.AXIS_Z`). -For an example, see :ref:`get_shortest_axis`. +For an example, see :ref:`get_shortest_axis()`. .. rst-class:: classref-item-separator @@ -492,7 +492,7 @@ For an example, see :ref:`get_shortest_axis Returns the shortest dimension of this bounding box's :ref:`size`. -For an example, see :ref:`get_shortest_axis`. +For an example, see :ref:`get_shortest_axis()`. .. rst-class:: classref-item-separator @@ -516,7 +516,7 @@ Returns the vertex's position of this bounding box that's the farthest in the gi :ref:`float` **get_volume**\ (\ ) |const| :ref:`πŸ”—` -Returns the bounding box's volume. This is equivalent to ``size.x * size.y * size.z``. See also :ref:`has_volume`. +Returns the bounding box's volume. This is equivalent to ``size.x * size.y * size.z``. See also :ref:`has_volume()`. .. rst-class:: classref-item-separator @@ -567,7 +567,7 @@ Returns a copy of this bounding box extended on all sides by the given amount `` Returns ``true`` if the bounding box contains the given ``point``. By convention, points exactly on the right, top, and front sides are **not** included. -\ **Note:** This method is not reliable for **AABB** with a *negative* :ref:`size`. Use :ref:`abs` first to get a valid bounding box. +\ **Note:** This method is not reliable for **AABB** with a *negative* :ref:`size`. Use :ref:`abs()` first to get a valid bounding box. .. rst-class:: classref-item-separator @@ -591,7 +591,7 @@ Returns ``true`` if this bounding box has a surface or a length, that is, at lea :ref:`bool` **has_volume**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this bounding box's width, height, and depth are all positive. See also :ref:`get_volume`. +Returns ``true`` if this bounding box's width, height, and depth are all positive. See also :ref:`get_volume()`. .. rst-class:: classref-item-separator @@ -603,7 +603,7 @@ Returns ``true`` if this bounding box's width, height, and depth are all positiv :ref:`AABB` **intersection**\ (\ with\: :ref:`AABB`\ ) |const| :ref:`πŸ”—` -Returns the intersection between this bounding box and ``with``. If the boxes do not intersect, returns an empty **AABB**. If the boxes intersect at the edge, returns a flat **AABB** with no volume (see :ref:`has_surface` and :ref:`has_volume`). +Returns the intersection between this bounding box and ``with``. If the boxes do not intersect, returns an empty **AABB**. If the boxes intersect at the edge, returns a flat **AABB** with no volume (see :ref:`has_surface()` and :ref:`has_volume()`). .. tabs:: @@ -628,7 +628,7 @@ Returns the intersection between this bounding box and ``with``. If the boxes do -\ **Note:** If you only need to know whether two bounding boxes are intersecting, use :ref:`intersects`, instead. +\ **Note:** If you only need to know whether two bounding boxes are intersecting, use :ref:`intersects()`, instead. .. rst-class:: classref-item-separator @@ -692,7 +692,7 @@ The segment begins at ``from`` and ends at ``to``. :ref:`bool` **is_equal_approx**\ (\ aabb\: :ref:`AABB`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this bounding box and ``aabb`` are approximately equal, by calling :ref:`Vector3.is_equal_approx` on the :ref:`position` and the :ref:`size`. +Returns ``true`` if this bounding box and ``aabb`` are approximately equal, by calling :ref:`Vector3.is_equal_approx()` on the :ref:`position` and the :ref:`size`. .. rst-class:: classref-item-separator @@ -704,7 +704,7 @@ Returns ``true`` if this bounding box and ``aabb`` are approximately equal, by c :ref:`bool` **is_finite**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this bounding box's values are finite, by calling :ref:`Vector3.is_finite` on the :ref:`position` and the :ref:`size`. +Returns ``true`` if this bounding box's values are finite, by calling :ref:`Vector3.is_finite()` on the :ref:`position` and the :ref:`size`. .. rst-class:: classref-item-separator @@ -716,7 +716,7 @@ Returns ``true`` if this bounding box's values are finite, by calling :ref:`Vect :ref:`AABB` **merge**\ (\ with\: :ref:`AABB`\ ) |const| :ref:`πŸ”—` -Returns an **AABB** that encloses both this bounding box and ``with`` around the edges. See also :ref:`encloses`. +Returns an **AABB** that encloses both this bounding box and ``with`` around the edges. See also :ref:`encloses()`. .. rst-class:: classref-section-separator @@ -735,7 +735,7 @@ Operator Descriptions Returns ``true`` if the :ref:`position` or :ref:`size` of both bounding boxes are not equal. -\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. rst-class:: classref-item-separator @@ -749,9 +749,9 @@ Returns ``true`` if the :ref:`position` or :ref:`s Inversely transforms (multiplies) the **AABB** by the given :ref:`Transform3D` transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not). -\ ``aabb * transform`` is equivalent to ``transform.inverse() * aabb``. See :ref:`Transform3D.inverse`. +\ ``aabb * transform`` is equivalent to ``transform.inverse() * aabb``. See :ref:`Transform3D.inverse()`. -For transforming by inverse of an affine transformation (e.g. with scaling) ``transform.affine_inverse() * aabb`` can be used instead. See :ref:`Transform3D.affine_inverse`. +For transforming by inverse of an affine transformation (e.g. with scaling) ``transform.affine_inverse() * aabb`` can be used instead. See :ref:`Transform3D.affine_inverse()`. .. rst-class:: classref-item-separator @@ -765,7 +765,7 @@ For transforming by inverse of an affine transformation (e.g. with scaling) ``tr Returns ``true`` if both :ref:`position` and :ref:`size` of the bounding boxes are exactly equal, respectively. -\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. |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_acceptdialog.rst b/classes/class_acceptdialog.rst index af919102802..94cddf18b4c 100644 --- a/classes/class_acceptdialog.rst +++ b/classes/class_acceptdialog.rst @@ -21,7 +21,7 @@ A base dialog used for user notification. Description ----------- -The default use of **AcceptDialog** is to allow it to only be accepted or closed, with the same result. However, the :ref:`confirmed` and :ref:`canceled` signals allow to make the two actions different, and the :ref:`add_button` method allows to add custom buttons and actions. +The default use of **AcceptDialog** is to allow it to only be accepted or closed, with the same result. However, the :ref:`confirmed` and :ref:`canceled` signals allow to make the two actions different, and the :ref:`add_button()` method allows to add custom buttons and actions. .. rst-class:: classref-reftable-group @@ -110,7 +110,7 @@ Signals **canceled**\ (\ ) :ref:`πŸ”—` -Emitted when the dialog is closed or the button created with :ref:`add_cancel_button` is pressed. +Emitted when the dialog is closed or the button created with :ref:`add_cancel_button()` is pressed. .. rst-class:: classref-item-separator @@ -134,7 +134,7 @@ Emitted when the dialog is accepted, i.e. the OK button is pressed. **custom_action**\ (\ action\: :ref:`StringName`\ ) :ref:`πŸ”—` -Emitted when a custom button is pressed. See :ref:`add_button`. +Emitted when a custom button is pressed. See :ref:`add_button()`. .. rst-class:: classref-section-separator @@ -226,7 +226,7 @@ The text displayed by the dialog. - |void| **set_ok_button_text**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_ok_button_text**\ (\ ) -The text displayed by the OK button (see :ref:`get_ok_button`). +The text displayed by the OK button (see :ref:`get_ok_button()`). .. rst-class:: classref-section-separator @@ -247,7 +247,7 @@ Adds a button with label ``text`` and a custom ``action`` to the dialog and retu If ``true``, ``right`` will place the button to the right of any sibling buttons. -You can use :ref:`remove_button` method to remove a button created with this method from the dialog. +You can use :ref:`remove_button()` method to remove a button created with this method from the dialog. .. rst-class:: classref-item-separator @@ -261,7 +261,7 @@ You can use :ref:`remove_button` method Adds a button with label ``name`` and a cancel action to the dialog and returns the created button. -You can use :ref:`remove_button` method to remove a button created with this method from the dialog. +You can use :ref:`remove_button()` method to remove a button created with this method from the dialog. .. rst-class:: classref-item-separator @@ -313,7 +313,7 @@ Registers a :ref:`LineEdit` in the dialog. When the enter key is |void| **remove_button**\ (\ button\: :ref:`Button`\ ) :ref:`πŸ”—` -Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button` added with :ref:`add_button` or :ref:`add_cancel_button` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action` or :ref:`canceled` signals. +Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button` added with :ref:`add_button()` or :ref:`add_cancel_button()` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action` or :ref:`canceled` signals. .. rst-class:: classref-section-separator diff --git a/classes/class_aescontext.rst b/classes/class_aescontext.rst index eee208b5c2d..548be3b2145 100644 --- a/classes/class_aescontext.rst +++ b/classes/class_aescontext.rst @@ -184,7 +184,7 @@ Method Descriptions |void| **finish**\ (\ ) :ref:`πŸ”—` -Close this AES context so it can be started again. See :ref:`start`. +Close this AES context so it can be started again. See :ref:`start()`. .. rst-class:: classref-item-separator @@ -196,7 +196,7 @@ Close this AES context so it can be started again. See :ref:`start` **get_iv_state**\ (\ ) :ref:`πŸ”—` -Get the current IV state for this context (IV gets updated when calling :ref:`update`). You normally don't need this function. +Get the current IV state for this context (IV gets updated when calling :ref:`update()`). You normally don't need this function. \ **Note:** This function only makes sense when the context is started with :ref:`MODE_CBC_ENCRYPT` or :ref:`MODE_CBC_DECRYPT`. @@ -222,7 +222,7 @@ Start the AES context in the given ``mode``. A ``key`` of either 16 or 32 bytes :ref:`PackedByteArray` **update**\ (\ src\: :ref:`PackedByteArray`\ ) :ref:`πŸ”—` -Run the desired operation for this AES context. Will return a :ref:`PackedByteArray` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`start` for mode of operation. +Run the desired operation for this AES context. Will return a :ref:`PackedByteArray` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`start()` for mode of operation. \ **Note:** The size of ``src`` must be a multiple of 16. Apply some padding if needed. diff --git a/classes/class_animatablebody2d.rst b/classes/class_animatablebody2d.rst index b340bb7c53c..16144325307 100644 --- a/classes/class_animatablebody2d.rst +++ b/classes/class_animatablebody2d.rst @@ -55,7 +55,7 @@ Property Descriptions - |void| **set_sync_to_physics**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_sync_to_physics_enabled**\ (\ ) -If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody2D.move_and_collide`. +If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody2D.move_and_collide()`. .. |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_animatablebody3d.rst b/classes/class_animatablebody3d.rst index 24aeddf877d..0f686b25afe 100644 --- a/classes/class_animatablebody3d.rst +++ b/classes/class_animatablebody3d.rst @@ -66,7 +66,7 @@ Property Descriptions - |void| **set_sync_to_physics**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_sync_to_physics_enabled**\ (\ ) -If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody3D.move_and_collide`. +If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody3D.move_and_collide()`. .. |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_animatedsprite2d.rst b/classes/class_animatedsprite2d.rst index e888e1f645c..8a4e84839ac 100644 --- a/classes/class_animatedsprite2d.rst +++ b/classes/class_animatedsprite2d.rst @@ -258,7 +258,7 @@ If ``true``, texture is flipped vertically. - |void| **set_frame**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_frame**\ (\ ) -The displayed animation frame's index. Setting this property also resets :ref:`frame_progress`. If this is not desired, use :ref:`set_frame_and_progress`. +The displayed animation frame's index. Setting this property also resets :ref:`frame_progress`. If this is not desired, use :ref:`set_frame_and_progress()`. .. rst-class:: classref-item-separator @@ -345,7 +345,7 @@ Method Descriptions :ref:`float` **get_playing_speed**\ (\ ) |const| :ref:`πŸ”—` -Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. +Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play()` method. Returns a negative value if the current animation is playing backwards. @@ -371,9 +371,9 @@ Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale |void| **pause**\ (\ ) :ref:`πŸ”—` -Pauses the currently playing animation. The :ref:`frame` and :ref:`frame_progress` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments will resume the animation from the current playback position. +Pauses the currently playing animation. The :ref:`frame` and :ref:`frame_progress` will be kept and calling :ref:`play()` or :ref:`play_backwards()` without arguments will resume the animation from the current playback position. -See also :ref:`stop`. +See also :ref:`stop()`. .. rst-class:: classref-item-separator @@ -385,7 +385,7 @@ See also :ref:`stop`. |void| **play**\ (\ name\: :ref:`StringName` = &"", custom_speed\: :ref:`float` = 1.0, from_end\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Plays the animation with key ``name``. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards`). +Plays the animation with key ``name``. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards()`). If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused. @@ -401,7 +401,7 @@ If this method is called with that same animation ``name``, or with no ``name`` Plays the animation with key ``name`` in reverse. -This method is a shorthand for :ref:`play` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. +This method is a shorthand for :ref:`play()` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. .. rst-class:: classref-item-separator @@ -439,7 +439,7 @@ Sets :ref:`frame` the :ref:`frame_progres |void| **stop**\ (\ ) :ref:`πŸ”—` -Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause`. +Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause()`. .. |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_animatedsprite3d.rst b/classes/class_animatedsprite3d.rst index 955ff4b2422..bed10d964b2 100644 --- a/classes/class_animatedsprite3d.rst +++ b/classes/class_animatedsprite3d.rst @@ -195,7 +195,7 @@ The key of the animation to play when the scene loads. - |void| **set_frame**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_frame**\ (\ ) -The displayed animation frame's index. Setting this property also resets :ref:`frame_progress`. If this is not desired, use :ref:`set_frame_and_progress`. +The displayed animation frame's index. Setting this property also resets :ref:`frame_progress`. If this is not desired, use :ref:`set_frame_and_progress()`. .. rst-class:: classref-item-separator @@ -265,7 +265,7 @@ Method Descriptions :ref:`float` **get_playing_speed**\ (\ ) |const| :ref:`πŸ”—` -Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. +Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play()` method. Returns a negative value if the current animation is playing backwards. @@ -291,9 +291,9 @@ Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale |void| **pause**\ (\ ) :ref:`πŸ”—` -Pauses the currently playing animation. The :ref:`frame` and :ref:`frame_progress` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments will resume the animation from the current playback position. +Pauses the currently playing animation. The :ref:`frame` and :ref:`frame_progress` will be kept and calling :ref:`play()` or :ref:`play_backwards()` without arguments will resume the animation from the current playback position. -See also :ref:`stop`. +See also :ref:`stop()`. .. rst-class:: classref-item-separator @@ -305,7 +305,7 @@ See also :ref:`stop`. |void| **play**\ (\ name\: :ref:`StringName` = &"", custom_speed\: :ref:`float` = 1.0, from_end\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Plays the animation with key ``name``. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards`). +Plays the animation with key ``name``. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards()`). If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused. @@ -321,7 +321,7 @@ If this method is called with that same animation ``name``, or with no ``name`` Plays the animation with key ``name`` in reverse. -This method is a shorthand for :ref:`play` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. +This method is a shorthand for :ref:`play()` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. .. rst-class:: classref-item-separator @@ -359,7 +359,7 @@ Sets :ref:`frame` the :ref:`frame_progres |void| **stop**\ (\ ) :ref:`πŸ”—` -Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause`. +Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause()`. .. |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_animatedtexture.rst b/classes/class_animatedtexture.rst index 88e6f86fdff..deee373a06c 100644 --- a/classes/class_animatedtexture.rst +++ b/classes/class_animatedtexture.rst @@ -23,7 +23,7 @@ Description **AnimatedTexture** is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike :ref:`AnimationPlayer` or :ref:`AnimatedSprite2D`, it isn't a :ref:`Node`, but has the advantage of being usable anywhere a :ref:`Texture2D` resource can be used, e.g. in a :ref:`TileSet`. -The playback of the animation is controlled by the :ref:`speed_scale` property, as well as each frame's duration (see :ref:`set_frame_duration`). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. +The playback of the animation is controlled by the :ref:`speed_scale` property, as well as each frame's duration (see :ref:`set_frame_duration()`). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. \ **AnimatedTexture** currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. @@ -125,7 +125,7 @@ Sets the currently visible frame of the texture. Setting this frame while playin - |void| **set_frames**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_frames**\ (\ ) -Number of frames to use in the animation. While you can create the frames independently with :ref:`set_frame_texture`, you need to set this value for the animation to take new frames into account. The maximum number of frames is :ref:`MAX_FRAMES`. +Number of frames to use in the animation. While you can create the frames independently with :ref:`set_frame_texture()`, you need to set this value for the animation to take new frames into account. The maximum number of frames is :ref:`MAX_FRAMES`. .. rst-class:: classref-item-separator diff --git a/classes/class_animation.rst b/classes/class_animation.rst index 6b36f7834d9..bd059169a33 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -416,7 +416,7 @@ Update at the keyframes. :ref:`UpdateMode` **UPDATE_CAPTURE** = ``2`` -Same as :ref:`UPDATE_CONTINUOUS` but works as a flag to capture the value of the current object and perform interpolation in some methods. See also :ref:`AnimationMixer.capture`, :ref:`AnimationPlayer.playback_auto_capture`, and :ref:`AnimationPlayer.play_with_capture`. +Same as :ref:`UPDATE_CONTINUOUS` but works as a flag to capture the value of the current object and perform interpolation in some methods. See also :ref:`AnimationMixer.capture()`, :ref:`AnimationPlayer.playback_auto_capture`, and :ref:`AnimationPlayer.play_with_capture()`. .. rst-class:: classref-item-separator @@ -917,7 +917,7 @@ Clear the animation (clear all tracks and reset all). |void| **compress**\ (\ page_size\: :ref:`int` = 8192, fps\: :ref:`int` = 120, split_tolerance\: :ref:`float` = 4.0\ ) :ref:`πŸ”—` -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. +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. @@ -1261,7 +1261,7 @@ Returns the time at which the key is located. :ref:`float` **track_get_key_transition**\ (\ track_idx\: :ref:`int`, key_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease`). +Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease()`). .. rst-class:: classref-item-separator @@ -1285,7 +1285,7 @@ Returns the value of a given key in a given track. :ref:`NodePath` **track_get_path**\ (\ track_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Gets the path of a track. For more information on the path format, see :ref:`track_set_path`. +Gets the path of a track. For more information on the path format, see :ref:`track_set_path()`. .. rst-class:: classref-item-separator @@ -1321,7 +1321,7 @@ Inserts a generic key in a given track. Returns the key index. :ref:`bool` **track_is_compressed**\ (\ track_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the track is compressed, ``false`` otherwise. See also :ref:`compress`. +Returns ``true`` if the track is compressed, ``false`` otherwise. See also :ref:`compress()`. .. rst-class:: classref-item-separator @@ -1477,7 +1477,7 @@ Sets the time of an existing key. |void| **track_set_key_transition**\ (\ track_idx\: :ref:`int`, key_idx\: :ref:`int`, transition\: :ref:`float`\ ) :ref:`πŸ”—` -Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease`). +Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease()`). .. rst-class:: classref-item-separator @@ -1541,7 +1541,7 @@ Returns the update mode of a value track. Returns the interpolated value at the given time (in seconds). The ``track_idx`` must be the index of a value track. -A ``backward`` mainly affects the direction of key retrieval of the track with :ref:`UPDATE_DISCRETE` converted by :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS` to match the result with :ref:`track_find_key`. +A ``backward`` mainly affects the direction of key retrieval of the track with :ref:`UPDATE_DISCRETE` converted by :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS` to match the result with :ref:`track_find_key()`. .. rst-class:: classref-item-separator diff --git a/classes/class_animationmixer.rst b/classes/class_animationmixer.rst index 9bab5d9b10c..30a5c0bf39e 100644 --- a/classes/class_animationmixer.rst +++ b/classes/class_animationmixer.rst @@ -179,7 +179,7 @@ Notifies when an animation starts playing. **caches_cleared**\ (\ ) :ref:`πŸ”—` -Notifies when the caches have been cleared, either automatically, or manually via :ref:`clear_caches`. +Notifies when the caches have been cleared, either automatically, or manually via :ref:`clear_caches()`. .. rst-class:: classref-item-separator @@ -242,7 +242,7 @@ Process animation during process frames (see :ref:`Node.NOTIFICATION_INTERNAL_PR :ref:`AnimationCallbackModeProcess` **ANIMATION_CALLBACK_MODE_PROCESS_MANUAL** = ``2`` -Do not process animation. Use :ref:`advance` to process the animation manually. +Do not process animation. Use :ref:`advance()` to process the animation manually. .. rst-class:: classref-item-separator @@ -487,7 +487,7 @@ This makes it more convenient to preview and edit animations in the editor, as c - |void| **set_root_motion_local**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_root_motion_local**\ (\ ) -If ``true``, :ref:`get_root_motion_position` value is extracted as a local translation value before blending. In other words, it is treated like the translation is done after the rotation. +If ``true``, :ref:`get_root_motion_position()` value is extracted as a local translation value before blending. In other words, it is treated like the translation is done after the rotation. .. rst-class:: classref-item-separator @@ -504,9 +504,9 @@ If ``true``, :ref:`get_root_motion_position`\ ) - :ref:`NodePath` **get_root_motion_track**\ (\ ) -The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. The :ref:`root_motion_track` uses the same format as :ref:`Animation.track_set_path`, but note that a bone must be specified. +The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. The :ref:`root_motion_track` uses the same format as :ref:`Animation.track_set_path()`, but note that a bone must be specified. -If the track has type :ref:`Animation.TYPE_POSITION_3D`, :ref:`Animation.TYPE_ROTATION_3D`, or :ref:`Animation.TYPE_SCALE_3D` the transformation will be canceled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_position`, :ref:`get_root_motion_rotation`, :ref:`get_root_motion_scale`, and :ref:`RootMotionView`. +If the track has type :ref:`Animation.TYPE_POSITION_3D`, :ref:`Animation.TYPE_ROTATION_3D`, or :ref:`Animation.TYPE_SCALE_3D` the transformation will be canceled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_position()`, :ref:`get_root_motion_rotation()`, :ref:`get_root_motion_scale()`, and :ref:`RootMotionView`. .. rst-class:: classref-item-separator @@ -604,7 +604,7 @@ You can specify ``trans_type`` as the curve for the interpolation. For better re |void| **clear_caches**\ (\ ) :ref:`πŸ”—` -**AnimationMixer** caches animated nodes. It may not notice if a node disappears; :ref:`clear_caches` forces it to update the cache again. +**AnimationMixer** caches animated nodes. It may not notice if a node disappears; :ref:`clear_caches()` forces it to update the cache again. .. rst-class:: classref-item-separator @@ -715,7 +715,7 @@ The most basic example is applying position to :ref:`CharacterBody3D`, you can apply the root motion position more correctly to account for the rotation of the node. +By using this in combination with :ref:`get_root_motion_rotation_accumulator()`, you can apply the root motion position more correctly to account for the rotation of the node. .. tabs:: @@ -828,7 +828,7 @@ The most basic example is applying rotation to :ref:`CharacterBody3D` as a :ref:`Quaternion` that can be used elsewhere. -This is necessary to apply the root motion position correctly, taking rotation into account. See also :ref:`get_root_motion_position`. +This is necessary to apply the root motion position correctly, taking rotation into account. See also :ref:`get_root_motion_position()`. Also, this is useful in cases where you want to respect the initial key values of the animation. diff --git a/classes/class_animationnode.rst b/classes/class_animationnode.rst index f4a0255037f..ed1e4dc8d05 100644 --- a/classes/class_animationnode.rst +++ b/classes/class_animationnode.rst @@ -283,7 +283,7 @@ When inheriting from :ref:`AnimationRootNode`, implemen :ref:`Array` **_get_parameter_list**\ (\ ) |virtual| |const| :ref:`πŸ”—` -When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return a list of the properties on this animation node. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list`. +When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return a list of the properties on this animation node. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list()`. .. rst-class:: classref-item-separator @@ -323,7 +323,7 @@ When inheriting from :ref:`AnimationRootNode`, implemen When inheriting from :ref:`AnimationRootNode`, implement this virtual method to run some code when this animation node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute. -Here, call the :ref:`blend_input`, :ref:`blend_node` or :ref:`blend_animation` functions. You can also use :ref:`get_parameter` and :ref:`set_parameter` to modify local memory. +Here, call the :ref:`blend_input()`, :ref:`blend_node()` or :ref:`blend_animation()` functions. You can also use :ref:`get_parameter()` and :ref:`set_parameter()` to modify local memory. This function should return the delta. @@ -437,7 +437,7 @@ Gets the value of a parameter. Parameters are custom local memory used for your Returns the object id of the :ref:`AnimationTree` that owns this node. -\ **Note:** This method should only be called from within the :ref:`AnimationNodeExtension._process_animation_node` method, and will return an invalid id otherwise. +\ **Note:** This method should only be called from within the :ref:`AnimationNodeExtension._process_animation_node()` method, and will return an invalid id otherwise. .. rst-class:: classref-item-separator diff --git a/classes/class_animationnodeanimation.rst b/classes/class_animationnodeanimation.rst index dc8fd4cf175..72c72173231 100644 --- a/classes/class_animationnodeanimation.rst +++ b/classes/class_animationnodeanimation.rst @@ -111,7 +111,7 @@ Property Descriptions If ``true``, on receiving a request to play an animation from the start, the first frame is not drawn, but only processed, and playback starts from the next frame. -See also the notes of :ref:`AnimationPlayer.play`. +See also the notes of :ref:`AnimationPlayer.play()`. .. rst-class:: classref-item-separator @@ -147,7 +147,7 @@ Animation to use as an output. It is one of the animations provided by :ref:`Ani If :ref:`use_custom_timeline` is ``true``, override the loop settings of the original :ref:`Animation` resource with the value. -\ **Note:** If the :ref:`Animation.loop_mode` isn't set to looping, the :ref:`Animation.track_set_interpolation_loop_wrap` option will not be respected. If you cannot get the expected behavior, consider duplicating the :ref:`Animation` resource and changing the loop settings. +\ **Note:** If the :ref:`Animation.loop_mode` isn't set to looping, the :ref:`Animation.track_set_interpolation_loop_wrap()` option will not be respected. If you cannot get the expected behavior, consider duplicating the :ref:`Animation` resource and changing the loop settings. .. rst-class:: classref-item-separator diff --git a/classes/class_animationnodeblendspace1d.rst b/classes/class_animationnodeblendspace1d.rst index 8c7183c18ce..ecc0999374e 100644 --- a/classes/class_animationnodeblendspace1d.rst +++ b/classes/class_animationnodeblendspace1d.rst @@ -21,7 +21,7 @@ Description A resource used by :ref:`AnimationNodeBlendTree`. -\ **AnimationNodeBlendSpace1D** represents a virtual axis on which any type of :ref:`AnimationRootNode`\ s can be added using :ref:`add_blend_point`. Outputs the linear blend of the two :ref:`AnimationRootNode`\ s adjacent to the current value. +\ **AnimationNodeBlendSpace1D** represents a virtual axis on which any type of :ref:`AnimationRootNode`\ s can be added using :ref:`add_blend_point()`. Outputs the linear blend of the two :ref:`AnimationRootNode`\ s adjacent to the current value. You can set the extents of the axis with :ref:`min_space` and :ref:`max_space`. @@ -154,7 +154,7 @@ Controls the interpolation between animations. See :ref:`BlendMode`\ ) - :ref:`float` **get_max_space**\ (\ ) -The blend space's axis's upper limit for the points' position. See :ref:`add_blend_point`. +The blend space's axis's upper limit for the points' position. See :ref:`add_blend_point()`. .. rst-class:: classref-item-separator @@ -171,7 +171,7 @@ The blend space's axis's upper limit for the points' position. See :ref:`add_ble - |void| **set_min_space**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_min_space**\ (\ ) -The blend space's axis's lower limit for the points' position. See :ref:`add_blend_point`. +The blend space's axis's lower limit for the points' position. See :ref:`add_blend_point()`. .. rst-class:: classref-item-separator diff --git a/classes/class_animationnodeblendspace2d.rst b/classes/class_animationnodeblendspace2d.rst index e653157a7f2..a01f7c5d574 100644 --- a/classes/class_animationnodeblendspace2d.rst +++ b/classes/class_animationnodeblendspace2d.rst @@ -23,7 +23,7 @@ A resource used by :ref:`AnimationNodeBlendTree`. \ **AnimationNodeBlendSpace2D** represents a virtual 2D space on which :ref:`AnimationRootNode`\ s are placed. Outputs the linear blend of the three adjacent animations using a :ref:`Vector2` weight. Adjacent in this context means the three :ref:`AnimationRootNode`\ s making up the triangle that contains the current value. -You can add vertices to the blend space with :ref:`add_blend_point` and automatically triangulate it by setting :ref:`auto_triangles` to ``true``. Otherwise, use :ref:`add_triangle` and :ref:`remove_triangle` to triangulate the blend space by hand. +You can add vertices to the blend space with :ref:`add_blend_point()` and automatically triangulate it by setting :ref:`auto_triangles` to ``true``. Otherwise, use :ref:`add_triangle()` and :ref:`remove_triangle()` to triangulate the blend space by hand. .. rst-class:: classref-introduction-group @@ -168,7 +168,7 @@ Property Descriptions - |void| **set_auto_triangles**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_auto_triangles**\ (\ ) -If ``true``, the blend space is triangulated automatically. The mesh updates every time you add or remove points with :ref:`add_blend_point` and :ref:`remove_blend_point`. +If ``true``, the blend space is triangulated automatically. The mesh updates every time you add or remove points with :ref:`add_blend_point()` and :ref:`remove_blend_point()`. .. rst-class:: classref-item-separator @@ -202,7 +202,7 @@ Controls the interpolation between animations. See :ref:`BlendMode`\ ) - :ref:`Vector2` **get_max_space**\ (\ ) -The blend space's X and Y axes' upper limit for the points' position. See :ref:`add_blend_point`. +The blend space's X and Y axes' upper limit for the points' position. See :ref:`add_blend_point()`. .. rst-class:: classref-item-separator @@ -219,7 +219,7 @@ The blend space's X and Y axes' upper limit for the points' position. See :ref:` - |void| **set_min_space**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_min_space**\ (\ ) -The blend space's X and Y axes' lower limit for the points' position. See :ref:`add_blend_point`. +The blend space's X and Y axes' lower limit for the points' position. See :ref:`add_blend_point()`. .. rst-class:: classref-item-separator diff --git a/classes/class_animationnodeextension.rst b/classes/class_animationnodeextension.rst index 3d835dd0d0e..9ec68213cf7 100644 --- a/classes/class_animationnodeextension.rst +++ b/classes/class_animationnodeextension.rst @@ -54,7 +54,7 @@ Method Descriptions :ref:`PackedFloat32Array` **_process_animation_node**\ (\ playback_info\: :ref:`PackedFloat64Array`, test_only\: :ref:`bool`\ ) |virtual| :ref:`πŸ”—` -A version of the :ref:`AnimationNode._process` method that is meant to be overridden by custom nodes. It returns a :ref:`PackedFloat32Array` with the processed animation data. +A version of the :ref:`AnimationNode._process()` method that is meant to be overridden by custom nodes. It returns a :ref:`PackedFloat32Array` with the processed animation data. The :ref:`PackedFloat64Array` parameter contains the playback information, containing the following values encoded as floating point numbers (in order): playback time and delta, start and end times, whether a seek was requested (encoded as a float greater than ``0``), whether the seek request was externally requested (encoded as a float greater than ``0``), the current :ref:`LoopedFlag` (encoded as a float), and the current blend weight. diff --git a/classes/class_animationnodestatemachine.rst b/classes/class_animationnodestatemachine.rst index 5489e848d41..1d52484f910 100644 --- a/classes/class_animationnodestatemachine.rst +++ b/classes/class_animationnodestatemachine.rst @@ -166,7 +166,7 @@ Property Descriptions - |void| **set_allow_transition_to_self**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_allow_transition_to_self**\ (\ ) -If ``true``, allows teleport to the self state with :ref:`AnimationNodeStateMachinePlayback.travel`. When the reset option is enabled in :ref:`AnimationNodeStateMachinePlayback.travel`, the animation is restarted. If ``false``, nothing happens on the teleportation to the self state. +If ``true``, allows teleport to the self state with :ref:`AnimationNodeStateMachinePlayback.travel()`. When the reset option is enabled in :ref:`AnimationNodeStateMachinePlayback.travel()`, the animation is restarted. If ``false``, nothing happens on the teleportation to the self state. .. rst-class:: classref-item-separator diff --git a/classes/class_animationnodestatemachinetransition.rst b/classes/class_animationnodestatemachinetransition.rst index dc914535acf..ffbe7bdabfa 100644 --- a/classes/class_animationnodestatemachinetransition.rst +++ b/classes/class_animationnodestatemachinetransition.rst @@ -19,7 +19,7 @@ A transition within an :ref:`AnimationNodeStateMachine` is limited to the nodes connected by **AnimationNodeStateMachineTransition**. +The path generated when using :ref:`AnimationNodeStateMachinePlayback.travel()` is limited to the nodes connected by **AnimationNodeStateMachineTransition**. You can set the timing and conditions of the transition in detail. @@ -138,7 +138,7 @@ Don't use this transition. :ref:`AdvanceMode` **ADVANCE_MODE_ENABLED** = ``1`` -Only use this transition during :ref:`AnimationNodeStateMachinePlayback.travel`. +Only use this transition during :ref:`AnimationNodeStateMachinePlayback.travel()`. .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_AUTO: @@ -215,7 +215,7 @@ Use an expression as a condition for state machine transitions. It is possible t - |void| **set_advance_mode**\ (\ value\: :ref:`AdvanceMode`\ ) - :ref:`AdvanceMode` **get_advance_mode**\ (\ ) -Determines whether the transition should be disabled, enabled when using :ref:`AnimationNodeStateMachinePlayback.travel`, or traversed automatically if the :ref:`advance_condition` and :ref:`advance_expression` checks are ``true`` (if assigned). +Determines whether the transition should be disabled, enabled when using :ref:`AnimationNodeStateMachinePlayback.travel()`, or traversed automatically if the :ref:`advance_condition` and :ref:`advance_expression` checks are ``true`` (if assigned). .. rst-class:: classref-item-separator @@ -249,7 +249,7 @@ If ``true``, breaks the loop at the end of the loop cycle for transition, even i - |void| **set_priority**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_priority**\ (\ ) -Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel` or :ref:`advance_mode` is set to :ref:`ADVANCE_MODE_AUTO`. +Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel()` or :ref:`advance_mode` is set to :ref:`ADVANCE_MODE_AUTO`. .. rst-class:: classref-item-separator diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index 7af9683c637..07e494d9a72 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -159,9 +159,9 @@ Signals **animation_changed**\ (\ old_name\: :ref:`StringName`, new_name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Emitted when a queued animation plays after the previous animation finished. See also :ref:`queue`. +Emitted when a queued animation plays after the previous animation finished. See also :ref:`queue()`. -\ **Note:** The signal is not emitted when the animation is changed via :ref:`play` or by an :ref:`AnimationTree`. +\ **Note:** The signal is not emitted when the animation is changed via :ref:`play()` or by an :ref:`AnimationTree`. .. rst-class:: classref-item-separator @@ -304,7 +304,7 @@ The key of the animation to play when the scene loads. - |void| **set_current_animation**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_current_animation**\ (\ ) -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. +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`. @@ -355,7 +355,7 @@ The position (in seconds) of the currently playing animation. - |void| **set_movie_quit_on_finish_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_movie_quit_on_finish_enabled**\ (\ ) -If ``true`` and the engine is running in Movie Maker mode (see :ref:`MovieWriter`), exits the engine with :ref:`SceneTree.quit` as soon as an animation is done playing in this **AnimationPlayer**. A message is printed when the engine quits for this reason. +If ``true`` and the engine is running in Movie Maker mode (see :ref:`MovieWriter`), exits the engine with :ref:`SceneTree.quit()` as soon as an animation is done playing in this **AnimationPlayer**. A message is printed when the engine quits for this reason. \ **Note:** This obeys the same logic as the :ref:`AnimationMixer.animation_finished` signal, so it will not quit the engine if the animation is set to be looping. @@ -374,7 +374,7 @@ If ``true`` and the engine is running in Movie Maker mode (see :ref:`MovieWriter - |void| **set_auto_capture**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_auto_capture**\ (\ ) -If ``true``, performs :ref:`AnimationMixer.capture` before playback automatically. This means just :ref:`play_with_capture` is executed with default arguments instead of :ref:`play`. +If ``true``, performs :ref:`AnimationMixer.capture()` before playback automatically. This means just :ref:`play_with_capture()` is executed with default arguments instead of :ref:`play()`. \ **Note:** Capture interpolation is only performed if the animation contains a capture track. See also :ref:`Animation.UPDATE_CAPTURE`. @@ -393,7 +393,7 @@ If ``true``, performs :ref:`AnimationMixer.capture`\ ) - :ref:`float` **get_auto_capture_duration**\ (\ ) -See also :ref:`play_with_capture` and :ref:`AnimationMixer.capture`. +See also :ref:`play_with_capture()` and :ref:`AnimationMixer.capture()`. If :ref:`playback_auto_capture_duration` is negative value, the duration is set to the interval between the current position and the first key. @@ -544,7 +544,7 @@ Returns the call mode used for "Call Method" tracks. :ref:`float` **get_playing_speed**\ (\ ) |const| :ref:`πŸ”—` -Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. +Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play()` method. Returns a negative value if the current animation is playing backwards. @@ -646,9 +646,9 @@ Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale |void| **pause**\ (\ ) :ref:`πŸ”—` -Pauses the currently playing animation. The :ref:`current_animation_position` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments or with the same animation name as :ref:`assigned_animation` will resume the animation. +Pauses the currently playing animation. The :ref:`current_animation_position` will be kept and calling :ref:`play()` or :ref:`play_backwards()` without arguments or with the same animation name as :ref:`assigned_animation` will resume the animation. -See also :ref:`stop`. +See also :ref:`stop()`. .. rst-class:: classref-item-separator @@ -662,7 +662,7 @@ See also :ref:`stop`. Plays the animation with key ``name``. Custom blend times and speed can be set. -The ``from_end`` option only affects when switching to a new animation track, or if the same track but at the start or end. It does not affect resuming playback that was paused in the middle of an animation. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards`). +The ``from_end`` option only affects when switching to a new animation track, or if the same track but at the start or end. It does not affect resuming playback that was paused in the middle of an animation. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards()`). The **AnimationPlayer** keeps track of its current or last played animation with :ref:`assigned_animation`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused. @@ -680,7 +680,7 @@ The **AnimationPlayer** keeps track of its current or last played animation with Plays the animation with key ``name`` in reverse. -This method is a shorthand for :ref:`play` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. +This method is a shorthand for :ref:`play()` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. .. rst-class:: classref-item-separator @@ -692,7 +692,7 @@ This method is a shorthand for :ref:`play` wi |void| **play_section**\ (\ name\: :ref:`StringName` = &"", start_time\: :ref:`float` = -1, end_time\: :ref:`float` = -1, custom_blend\: :ref:`float` = -1, custom_speed\: :ref:`float` = 1.0, from_end\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Plays the animation with key ``name`` and the section starting from ``start_time`` and ending on ``end_time``. See also :ref:`play`. +Plays the animation with key ``name`` and the section starting from ``start_time`` and ending on ``end_time``. See also :ref:`play()`. Setting ``start_time`` to a value outside the range of the animation means the start of the animation will be used instead, and setting ``end_time`` to a value outside the range of the animation means the end of the animation will be used instead. ``start_time`` cannot be equal to ``end_time``. @@ -708,7 +708,7 @@ Setting ``start_time`` to a value outside the range of the animation means the s Plays the animation with key ``name`` and the section starting from ``start_time`` and ending on ``end_time`` in reverse. -This method is a shorthand for :ref:`play_section` with ``custom_speed = -1.0`` and ``from_end = true``, see its description for more information. +This method is a shorthand for :ref:`play_section()` with ``custom_speed = -1.0`` and ``from_end = true``, see its description for more information. .. rst-class:: classref-item-separator @@ -722,7 +722,7 @@ This method is a shorthand for :ref:`play_section`. +If the start marker is empty, the section starts from the beginning of the animation. If the end marker is empty, the section ends on the end of the animation. See also :ref:`play()`. .. rst-class:: classref-item-separator @@ -736,7 +736,7 @@ If the start marker is empty, the section starts from the beginning of the anima Plays the animation with key ``name`` and the section starting from ``start_marker`` and ending on ``end_marker`` in reverse. -This method is a shorthand for :ref:`play_section_with_markers` with ``custom_speed = -1.0`` and ``from_end = true``, see its description for more information. +This method is a shorthand for :ref:`play_section_with_markers()` with ``custom_speed = -1.0`` and ``from_end = true``, see its description for more information. .. rst-class:: classref-item-separator @@ -748,7 +748,7 @@ This method is a shorthand for :ref:`play_section_with_markers` = &"", duration\: :ref:`float` = -1.0, custom_blend\: :ref:`float` = -1, custom_speed\: :ref:`float` = 1.0, from_end\: :ref:`bool` = false, trans_type\: :ref:`TransitionType` = 0, ease_type\: :ref:`EaseType` = 0\ ) :ref:`πŸ”—` -See also :ref:`AnimationMixer.capture`. +See also :ref:`AnimationMixer.capture()`. You can use this method to use more detailed options for capture than those performed by :ref:`playback_auto_capture`. When :ref:`playback_auto_capture` is ``false``, this method is almost the same as the following: @@ -803,7 +803,7 @@ Seeks the animation to the ``seconds`` point in time (in seconds). If ``update`` If ``update_only`` is ``true``, the method / audio / animation playback tracks will not be processed. -\ **Note:** Seeking to the end of the animation doesn't emit :ref:`AnimationMixer.animation_finished`. If you want to skip animation and emit the signal, use :ref:`AnimationMixer.advance`. +\ **Note:** Seeking to the end of the animation doesn't emit :ref:`AnimationMixer.animation_finished`. If you want to skip animation and emit the signal, use :ref:`AnimationMixer.advance()`. .. rst-class:: classref-item-separator @@ -869,7 +869,7 @@ Sets the node which node path references will travel from. |void| **set_section**\ (\ start_time\: :ref:`float` = -1, end_time\: :ref:`float` = -1\ ) :ref:`πŸ”—` -Changes the start and end times of the section being played. The current playback position will be clamped within the new section. See also :ref:`play_section`. +Changes the start and end times of the section being played. The current playback position will be clamped within the new section. See also :ref:`play_section()`. .. rst-class:: classref-item-separator @@ -881,7 +881,7 @@ Changes the start and end times of the section being played. The current playbac |void| **set_section_with_markers**\ (\ start_marker\: :ref:`StringName` = &"", end_marker\: :ref:`StringName` = &""\ ) :ref:`πŸ”—` -Changes the start and end markers of the section being played. The current playback position will be clamped within the new section. See also :ref:`play_section_with_markers`. +Changes the start and end markers of the section being played. The current playback position will be clamped within the new section. See also :ref:`play_section_with_markers()`. If the argument is empty, the section uses the beginning or end of the animation. If both are empty, it means that the section is not set. @@ -895,7 +895,7 @@ If the argument is empty, the section uses the beginning or end of the animation |void| **stop**\ (\ keep_state\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause`. +Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause()`. If ``keep_state`` is ``true``, the animation state is not updated visually. diff --git a/classes/class_array.rst b/classes/class_array.rst index 1dd896a3070..ef3fdbb4c95 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -35,22 +35,22 @@ An array data structure that can contain a sequence of elements of any :ref:`Var .. code-tab:: csharp - var array = new Godot.Collections.Array{"First", 2, 3, "Last"}; + Godot.Collections.Array array = ["First", 2, 3, "Last"]; GD.Print(array[0]); // Prints "First" GD.Print(array[2]); // Prints 3 - GD.Print(array[array.Count - 1]); // Prints "Last" + GD.Print(array[^1]); // Prints "Last" - array[2] = "Second"; + array[1] = "Second"; GD.Print(array[1]); // Prints "Second" - GD.Print(array[array.Count - 3]); // Prints "Second" + GD.Print(array[^3]); // Prints "Second" -\ **Note:** Arrays are always passed by **reference**. To get a copy of an array that can be modified independently of the original array, use :ref:`duplicate`. +\ **Note:** Arrays are always passed by **reference**. To get a copy of an array that can be modified independently of the original array, use :ref:`duplicate()`. \ **Note:** Erasing elements while iterating over arrays is **not** supported and will result in unpredictable behavior. -\ **Differences between packed arrays, typed arrays, and untyped arrays:** Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. :ref:`PackedInt64Array` versus ``Array[int]``). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as :ref:`map`. Typed arrays are in turn faster to iterate on and modify than untyped arrays. +\ **Differences between packed arrays, typed arrays, and untyped arrays:** Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. :ref:`PackedInt64Array` versus ``Array[int]``). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as :ref:`map()`. Typed arrays are in turn faster to iterate on and modify than untyped arrays. .. note:: @@ -257,7 +257,7 @@ Creates a typed array from the ``base`` array. A typed array can only contain el - ``type`` is the built-in :ref:`Variant` type, as one the :ref:`Variant.Type` constants. -- ``class_name`` is the built-in class name (see :ref:`Object.get_class`). +- ``class_name`` is the built-in class name (see :ref:`Object.get_class()`). - ``script`` is the associated script. It must be a :ref:`Script` instance or ``null``. @@ -297,7 +297,7 @@ In GDScript, this constructor is usually not necessary, as it is possible to cre :ref:`Array` **Array**\ (\ from\: :ref:`Array`\ ) -Returns the same array as ``from``. If you need a copy of the array, use :ref:`duplicate`. +Returns the same array as ``from``. If you need a copy of the array, use :ref:`duplicate()`. .. rst-class:: classref-item-separator @@ -459,9 +459,9 @@ The ``method`` should take one :ref:`Variant` parameter (the curr -See also :ref:`any`, :ref:`filter`, :ref:`map` and :ref:`reduce`. +See also :ref:`any()`, :ref:`filter()`, :ref:`map()` and :ref:`reduce()`. -\ **Note:** Unlike relying on the size of an array returned by :ref:`filter`, this method will return as early as possible to improve performance (especially with large arrays). +\ **Note:** Unlike relying on the size of an array returned by :ref:`filter()`, this method will return as early as possible to improve performance (especially with large arrays). \ **Note:** For an empty array, this method `always `__ returns ``true``. @@ -493,9 +493,9 @@ The ``method`` should take one :ref:`Variant` parameter (the curr # Same as the first line above, but using a lambda function. print([6, 10, 6].any(func(number): return number > 5)) # Prints true -See also :ref:`all`, :ref:`filter`, :ref:`map` and :ref:`reduce`. +See also :ref:`all()`, :ref:`filter()`, :ref:`map()` and :ref:`reduce()`. -\ **Note:** Unlike relying on the size of an array returned by :ref:`filter`, this method will return as early as possible to improve performance (especially with large arrays). +\ **Note:** Unlike relying on the size of an array returned by :ref:`filter()`, this method will return as early as possible to improve performance (especially with large arrays). \ **Note:** For an empty array, this method always returns ``false``. @@ -509,7 +509,7 @@ See also :ref:`all`, :ref:`filter`\ ) :ref:`πŸ”—` -Appends ``value`` at the end of the array (alias of :ref:`push_back`). +Appends ``value`` at the end of the array (alias of :ref:`push_back()`). .. rst-class:: classref-item-separator @@ -552,7 +552,7 @@ Assigns elements of another ``array`` into the array. Resizes the array to match :ref:`Variant` **back**\ (\ ) |const| :ref:`πŸ”—` -Returns the last element of the array. If the array is empty, fails and returns ``null``. See also :ref:`front`. +Returns the last element of the array. If the array is empty, fails and returns ``null``. See also :ref:`front()`. \ **Note:** Unlike with the ``[]`` operator (``array[-1]``), an error is generated without stopping project execution. @@ -582,7 +582,7 @@ If ``before`` is ``true`` (as by default), the returned index comes before all e print(fruits.bsearch("Lemon", true)) # Prints 1, points at the first "Lemon". print(fruits.bsearch("Lemon", false)) # Prints 3, points at "Orange". -\ **Note:** Calling :ref:`bsearch` on an *unsorted* array will result in unexpected behavior. Use :ref:`sort` before calling this method. +\ **Note:** Calling :ref:`bsearch()` on an *unsorted* array will result in unexpected behavior. Use :ref:`sort()` before calling this method. .. rst-class:: classref-item-separator @@ -596,7 +596,7 @@ If ``before`` is ``true`` (as by default), the returned index comes before all e Returns the index of ``value`` in the sorted array. If it cannot be found, returns where ``value`` should be inserted to keep the array sorted (using ``func`` for the comparisons). The algorithm used is `binary search `__. -Similar to :ref:`sort_custom`, ``func`` is called as many times as necessary, receiving one array element and ``value`` as arguments. The function should return ``true`` if the array element should be *behind* ``value``, otherwise it should return ``false``. +Similar to :ref:`sort_custom()`, ``func`` is called as many times as necessary, receiving one array element and ``value`` as arguments. The function should return ``true`` if the array element should be *behind* ``value``, otherwise it should return ``false``. If ``before`` is ``true`` (as by default), the returned index comes before all existing elements equal to ``value`` in the array. @@ -621,7 +621,7 @@ If ``before`` is ``true`` (as by default), the returned index comes before all e # Prints [["Tomato", 2], ["Apple", 5], ["Kiwi", 5], ["Banana", 5], ["Rice", 9]] print(my_items) -\ **Note:** Calling :ref:`bsearch_custom` on an *unsorted* array will result in unexpected behavior. Use :ref:`sort_custom` with ``func`` before calling this method. +\ **Note:** Calling :ref:`bsearch_custom()` on an *unsorted* array will result in unexpected behavior. Use :ref:`sort_custom()` with ``func`` before calling this method. .. rst-class:: classref-item-separator @@ -633,7 +633,7 @@ If ``before`` is ``true`` (as by default), the returned index comes before all e |void| **clear**\ (\ ) :ref:`πŸ”—` -Removes all elements from the array. This is equivalent to using :ref:`resize` with a size of ``0``. +Removes all elements from the array. This is equivalent to using :ref:`resize()` with a size of ``0``. .. rst-class:: classref-item-separator @@ -647,7 +647,7 @@ Removes all elements from the array. This is equivalent to using :ref:`resize`. +To count how many elements in an array satisfy a condition, see :ref:`reduce()`. .. rst-class:: classref-item-separator @@ -675,7 +675,7 @@ If ``deep`` is ``true``, a **deep** copy is returned: all nested arrays and dict |void| **erase**\ (\ value\: :ref:`Variant`\ ) :ref:`πŸ”—` -Finds and removes the first occurrence of ``value`` from the array. If ``value`` does not exist in the array, nothing happens. To remove an element by index, use :ref:`remove_at` instead. +Finds and removes the first occurrence of ``value`` from the array. If ``value`` does not exist in the array, nothing happens. To remove an element by index, use :ref:`remove_at()` instead. \ **Note:** This method shifts every element's index after the removed ``value`` back, which may have a noticeable performance cost, especially on larger arrays. @@ -693,7 +693,7 @@ Finds and removes the first occurrence of ``value`` from the array. If ``value`` Assigns the given ``value`` to all elements in the array. -This method can often be combined with :ref:`resize` to create an array with a given size and initialized elements: +This method can often be combined with :ref:`resize()` to create an array with a given size and initialized elements: .. tabs:: @@ -707,7 +707,7 @@ This method can often be combined with :ref:`resize` .. code-tab:: csharp - var array = new Godot.Collections.Array(); + Godot.Collections.Array array = []; array.Resize(5); array.Fill(2); GD.Print(array); // Prints [2, 2, 2, 2, 2] @@ -741,7 +741,7 @@ The ``method`` receives one of the array elements as an argument, and should ret # Same as above, but using a lambda function. print([1, 4, 5, 8].filter(func(number): return number % 2 == 0)) -See also :ref:`any`, :ref:`all`, :ref:`map` and :ref:`reduce`. +See also :ref:`any()`, :ref:`all()`, :ref:`map()` and :ref:`reduce()`. .. rst-class:: classref-item-separator @@ -755,7 +755,7 @@ See also :ref:`any`, :ref:`all`, Returns the index of the **first** occurrence of ``what`` in this array, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the end of the array. -\ **Note:** If you just want to know whether the array contains ``what``, use :ref:`has` (``Contains`` in C#). In GDScript, you may also use the ``in`` operator. +\ **Note:** If you just want to know whether the array contains ``what``, use :ref:`has()` (``Contains`` in C#). In GDScript, you may also use the ``in`` operator. \ **Note:** For performance reasons, the search is affected by ``what``'s :ref:`Variant.Type`. For example, ``7`` (:ref:`int`) and ``7.0`` (:ref:`float`) are not considered equal for this method. @@ -773,7 +773,7 @@ Returns the index of the **first** element in the array that causes ``method`` t \ ``method`` is a callable that takes an element of the array, and returns a :ref:`bool`. -\ **Note:** If you just want to know whether the array contains *anything* that satisfies ``method``, use :ref:`any`. +\ **Note:** If you just want to know whether the array contains *anything* that satisfies ``method``, use :ref:`any()`. .. tabs:: @@ -784,7 +784,7 @@ Returns the index of the **first** element in the array that causes ``method`` t return number % 2 == 0 func _ready(): - print([1, 3, 4, 7].find_custom(is_even.bind())) # prints 2 + print([1, 3, 4, 7].find_custom(is_even.bind())) # Prints 2 @@ -798,7 +798,7 @@ Returns the index of the **first** element in the array that causes ``method`` t :ref:`Variant` **front**\ (\ ) |const| :ref:`πŸ”—` -Returns the first element of the array. If the array is empty, fails and returns ``null``. See also :ref:`back`. +Returns the first element of the array. If the array is empty, fails and returns ``null``. See also :ref:`back()`. \ **Note:** Unlike with the ``[]`` operator (``array[0]``), an error is generated without stopping project execution. @@ -824,7 +824,7 @@ Returns the element at the given ``index`` in the array. This is the same as usi :ref:`int` **get_typed_builtin**\ (\ ) |const| :ref:`πŸ”—` -Returns the built-in :ref:`Variant` type of the typed array as a :ref:`Variant.Type` constant. If the array is not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed`. +Returns the built-in :ref:`Variant` type of the typed array as a :ref:`Variant.Type` constant. If the array is not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed()`. .. rst-class:: classref-item-separator @@ -836,7 +836,7 @@ Returns the built-in :ref:`Variant` type of the typed array as a :ref:`StringName` **get_typed_class_name**\ (\ ) |const| :ref:`πŸ”—` -Returns the **built-in** class name of the typed array, if the built-in :ref:`Variant` type :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed` and :ref:`Object.get_class`. +Returns the **built-in** class name of the typed array, if the built-in :ref:`Variant` type :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed()` and :ref:`Object.get_class()`. .. rst-class:: classref-item-separator @@ -848,7 +848,7 @@ Returns the **built-in** class name of the typed array, if the built-in :ref:`Va :ref:`Variant` **get_typed_script**\ (\ ) |const| :ref:`πŸ”—` -Returns the :ref:`Script` instance associated with this typed array, or ``null`` if it does not exist. See also :ref:`is_typed`. +Returns the :ref:`Script` instance associated with this typed array, or ``null`` if it does not exist. See also :ref:`is_typed()`. .. rst-class:: classref-item-separator @@ -874,7 +874,7 @@ Returns ``true`` if the array contains the given ``value``. .. code-tab:: csharp - var arr = new Godot.Collections.Array { "inside", 7 }; + Godot.Collections.Array arr = ["inside", 7]; // By C# convention, this method is renamed to `Contains`. GD.Print(arr.Contains("inside")); // Prints True GD.Print(arr.Contains("outside")); // Prints False @@ -916,7 +916,7 @@ Returns a hashed 32-bit integer value representing the array and its contents. :ref:`int` **insert**\ (\ position\: :ref:`int`, value\: :ref:`Variant`\ ) :ref:`πŸ”—` -Inserts a new element (``value``) at a given index (``position``) in the array. ``position`` should be between ``0`` and the array's :ref:`size`. +Inserts a new element (``value``) at a given index (``position``) in the array. ``position`` should be between ``0`` and the array's :ref:`size()`. Returns :ref:`@GlobalScope.OK` on success, or one of the other :ref:`Error` constants if this method fails. @@ -932,7 +932,7 @@ Returns :ref:`@GlobalScope.OK` on success, or on :ref:`bool` **is_empty**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the array is empty (``[]``). See also :ref:`size`. +Returns ``true`` if the array is empty (``[]``). See also :ref:`size()`. .. rst-class:: classref-item-separator @@ -944,7 +944,7 @@ Returns ``true`` if the array is empty (``[]``). See also :ref:`size` **is_read_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the array is read-only. See :ref:`make_read_only`. +Returns ``true`` if the array is read-only. See :ref:`make_read_only()`. In GDScript, arrays are automatically read-only if declared with the ``const`` keyword. @@ -958,7 +958,7 @@ In GDScript, arrays are automatically read-only if declared with the ``const`` k :ref:`bool` **is_same_typed**\ (\ array\: :ref:`Array`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this array is typed the same as the given ``array``. See also :ref:`is_typed`. +Returns ``true`` if this array is typed the same as the given ``array``. See also :ref:`is_typed()`. .. rst-class:: classref-item-separator @@ -1018,7 +1018,7 @@ The ``method`` should take one :ref:`Variant` parameter (the curr # Same as above, but using a lambda function. print([1, 2, 3].map(func(element): return element * 2)) -See also :ref:`filter`, :ref:`reduce`, :ref:`any` and :ref:`all`. +See also :ref:`filter()`, :ref:`reduce()`, :ref:`any()` and :ref:`all()`. .. rst-class:: classref-item-separator @@ -1030,9 +1030,9 @@ See also :ref:`filter`, :ref:`reduce` **max**\ (\ ) |const| :ref:`πŸ”—` -Returns the maximum value contained in the array, if all elements can be compared. Otherwise, returns ``null``. See also :ref:`min`. +Returns the maximum value contained in the array, if all elements can be compared. Otherwise, returns ``null``. See also :ref:`min()`. -To find the maximum value using a custom comparator, you can use :ref:`reduce`. +To find the maximum value using a custom comparator, you can use :ref:`reduce()`. .. rst-class:: classref-item-separator @@ -1044,7 +1044,7 @@ To find the maximum value using a custom comparator, you can use :ref:`reduce` **min**\ (\ ) |const| :ref:`πŸ”—` -Returns the minimum value contained in the array, if all elements can be compared. Otherwise, returns ``null``. See also :ref:`max`. +Returns the minimum value contained in the array, if all elements can be compared. Otherwise, returns ``null``. See also :ref:`max()`. .. rst-class:: classref-item-separator @@ -1068,12 +1068,12 @@ Returns a random element from the array. Generates an error and returns ``null`` .. code-tab:: csharp - var array = new Godot.Collections.Array { 1, 2, 3.25f, "Hi" }; + Godot.Collections.Array array = [1, 2, 3.25f, "Hi"]; GD.Print(array.PickRandom()); // May print 1, 2, 3.25, or "Hi". -\ **Note:** Like many similar functions in the engine (such as :ref:`@GlobalScope.randi` or :ref:`shuffle`), this method uses a common, global random seed. To get a predictable outcome from this method, see :ref:`@GlobalScope.seed`. +\ **Note:** Like many similar functions in the engine (such as :ref:`@GlobalScope.randi()` or :ref:`shuffle()`), this method uses a common, global random seed. To get a predictable outcome from this method, see :ref:`@GlobalScope.seed()`. .. rst-class:: classref-item-separator @@ -1099,7 +1099,7 @@ Removes and returns the element of the array at index ``position``. If negative, :ref:`Variant` **pop_back**\ (\ ) :ref:`πŸ”—` -Removes and returns the last element of the array. Returns ``null`` if the array is empty, without generating an error. See also :ref:`pop_front`. +Removes and returns the last element of the array. Returns ``null`` if the array is empty, without generating an error. See also :ref:`pop_front()`. .. rst-class:: classref-item-separator @@ -1111,7 +1111,7 @@ Removes and returns the last element of the array. Returns ``null`` if the array :ref:`Variant` **pop_front**\ (\ ) :ref:`πŸ”—` -Removes and returns the first element of the array. Returns ``null`` if the array is empty, without generating an error. See also :ref:`pop_back`. +Removes and returns the first element of the array. Returns ``null`` if the array is empty, without generating an error. See also :ref:`pop_back()`. \ **Note:** This method shifts every other element's index back, which may have a noticeable performance cost, especially on larger arrays. @@ -1125,7 +1125,7 @@ Removes and returns the first element of the array. Returns ``null`` if the arra |void| **push_back**\ (\ value\: :ref:`Variant`\ ) :ref:`πŸ”—` -Appends an element at the end of the array. See also :ref:`push_front`. +Appends an element at the end of the array. See also :ref:`push_front()`. .. rst-class:: classref-item-separator @@ -1137,7 +1137,7 @@ Appends an element at the end of the array. See also :ref:`push_front`\ ) :ref:`πŸ”—` -Adds an element at the beginning of the array. See also :ref:`push_back`. +Adds an element at the beginning of the array. See also :ref:`push_back()`. \ **Note:** This method shifts every other element's index forward, which may have a noticeable performance cost, especially on larger arrays. @@ -1167,20 +1167,20 @@ The ``method`` takes two arguments: the current value of ``accum`` and the curre # Same as above, but using a lambda function. print([1, 2, 3].reduce(func(accum, number): return accum + number, 10)) -If :ref:`max` is not desirable, this method may also be used to implement a custom comparator: +If :ref:`max()` is not desirable, this method may also be used to implement a custom comparator: :: func _ready(): - var arr = [Vector2(5, 0), Vector2(3, 4), Vector2(1, 2)] + var arr = [Vector2i(5, 0), Vector2i(3, 4), Vector2i(1, 2)] var longest_vec = arr.reduce(func(max, vec): return vec if is_length_greater(vec, max) else max) - print(longest_vec) # Prints Vector2(3, 4). + print(longest_vec) # Prints (3, 4) func is_length_greater(a, b): return a.length() > b.length() -This method can also be used to count how many elements in an array satisfy a certain condition, similar to :ref:`count`: +This method can also be used to count how many elements in an array satisfy a certain condition, similar to :ref:`count()`: :: @@ -1189,11 +1189,11 @@ This method can also be used to count how many elements in an array satisfy a ce func _ready(): var arr = [1, 2, 3, 4, 5] - # Increment count if it's even, else leaves count the same. + # If the current element is even, increment count, otherwise leave count the same. var even_count = arr.reduce(func(count, next): return count + 1 if is_even(next) else count, 0) print(even_count) # Prints 2 -See also :ref:`map`, :ref:`filter`, :ref:`any` and :ref:`all`. +See also :ref:`map()`, :ref:`filter()`, :ref:`any()`, and :ref:`all()`. .. rst-class:: classref-item-separator @@ -1207,7 +1207,7 @@ See also :ref:`map`, :ref:`filter`. To remove an element by value, use :ref:`erase` instead. +If you need to return the removed element, use :ref:`pop_at()`. To remove an element by value, use :ref:`erase()` instead. \ **Note:** This method shifts every element's index after ``position`` back, which may have a noticeable performance cost, especially on larger arrays. @@ -1227,7 +1227,7 @@ Sets the array's number of elements to ``size``. If ``size`` is smaller than the Returns :ref:`@GlobalScope.OK` on success, or one of the other :ref:`Error` constants if this method fails. -\ **Note:** Calling this method once and assigning the new values is faster than calling :ref:`append` for every new element. +\ **Note:** Calling this method once and assigning the new values is faster than calling :ref:`append()` for every new element. .. rst-class:: classref-item-separator @@ -1251,7 +1251,7 @@ Reverses the order of all elements in the array. :ref:`int` **rfind**\ (\ what\: :ref:`Variant`, from\: :ref:`int` = -1\ ) |const| :ref:`πŸ”—` -Returns the index of the **last** occurrence of ``what`` in this array, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the array. This method is the reverse of :ref:`find`. +Returns the index of the **last** occurrence of ``what`` in this array, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the array. This method is the reverse of :ref:`find()`. .. rst-class:: classref-item-separator @@ -1263,7 +1263,7 @@ Returns the index of the **last** occurrence of ``what`` in this array, or ``-1` :ref:`int` **rfind_custom**\ (\ method\: :ref:`Callable`, from\: :ref:`int` = -1\ ) |const| :ref:`πŸ”—` -Returns the index of the **last** element of the array that causes ``method`` to return ``true``, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the array. This method is the reverse of :ref:`find_custom`. +Returns the index of the **last** element of the array that causes ``method`` to return ``true``, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the array. This method is the reverse of :ref:`find_custom()`. .. rst-class:: classref-item-separator @@ -1289,7 +1289,7 @@ Sets the value of the element at the given ``index`` to the given ``value``. Thi Shuffles all elements of the array in a random order. -\ **Note:** Like many similar functions in the engine (such as :ref:`@GlobalScope.randi` or :ref:`pick_random`), this method uses a common, global random seed. To get a predictable outcome from this method, see :ref:`@GlobalScope.seed`. +\ **Note:** Like many similar functions in the engine (such as :ref:`@GlobalScope.randi()` or :ref:`pick_random()`), this method uses a common, global random seed. To get a predictable outcome from this method, see :ref:`@GlobalScope.seed()`. .. rst-class:: classref-item-separator @@ -1301,7 +1301,7 @@ Shuffles all elements of the array in a random order. :ref:`int` **size**\ (\ ) |const| :ref:`πŸ”—` -Returns the number of elements in the array. Empty arrays (``[]``) always return ``0``. See also :ref:`is_empty`. +Returns the number of elements in the array. Empty arrays (``[]``) always return ``0``. See also :ref:`is_empty()`. .. rst-class:: classref-item-separator @@ -1319,7 +1319,7 @@ If either ``begin`` or ``end`` are negative, their value is relative to the end If ``step`` is negative, this method iterates through the array in reverse, returning a slice ordered backwards. For this to work, ``begin`` must be greater than ``end``. -If ``deep`` is ``true``, all nested **Array** and :ref:`Dictionary` elements in the slice are duplicated from the original, recursively. See also :ref:`duplicate`). +If ``deep`` is ``true``, all nested **Array** and :ref:`Dictionary` elements in the slice are duplicated from the original, recursively. See also :ref:`duplicate()`). :: @@ -1355,13 +1355,13 @@ Sorts the array in ascending order. The final order is dependent on the "less th .. code-tab:: csharp - var numbers = new Godot.Collections.Array { 10, 5, 2.5, 8 }; + Godot.Collections.Array numbers = [10, 5, 2.5, 8]; numbers.Sort(); GD.Print(numbers); // Prints [2.5, 5, 8, 10] -\ **Note:** The sorting algorithm used is not `stable `__. This means that equivalent elements (such as ``2`` and ``2.0``) may have their order changed when calling :ref:`sort`. +\ **Note:** The sorting algorithm used is not `stable `__. This means that equivalent elements (such as ``2`` and ``2.0``) may have their order changed when calling :ref:`sort()`. .. rst-class:: classref-item-separator @@ -1393,7 +1393,7 @@ Sorts the array using a custom :ref:`Callable`. my_items.sort_custom(func(a, b): return a[1] > b[1]) print(my_items) # Prints [["Apple", 9], ["Tomato", 5], ["Rice", 4]] -It may also be necessary to use this method to sort strings by natural order, with :ref:`String.naturalnocasecmp_to`, as in the following example: +It may also be necessary to use this method to sort strings by natural order, with :ref:`String.naturalnocasecmp_to()`, as in the following example: :: @@ -1448,13 +1448,13 @@ Appends the ``right`` array to the left operand, creating a new **Array**. This .. code-tab:: csharp // Note that concatenation is not possible with C#'s native Array type. - var array1 = new Godot.Collections.Array{"One", 2}; - var array2 = new Godot.Collections.Array{3, "Four"}; + Godot.Collections.Array array1 = ["One", 2]; + Godot.Collections.Array array2 = [3, "Four"]; GD.Print(array1 + array2); // Prints ["One", 2, 3, "Four"] -\ **Note:** For existing arrays, :ref:`append_array` is much more efficient than concatenation and assignment with the ``+=`` operator. +\ **Note:** For existing arrays, :ref:`append_array()` is much more efficient than concatenation and assignment with the ``+=`` operator. .. rst-class:: classref-item-separator diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index a536b5e3b51..3f41ebf9864 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -46,16 +46,16 @@ The most basic example is the creation of a single triangle: .. code-tab:: csharp - var vertices = new Vector3[] - { + Vector3[] vertices = + [ new Vector3(0, 1, 0), new Vector3(1, 0, 0), new Vector3(0, 0, 1), - }; + ]; // Initialize the ArrayMesh. var arrMesh = new ArrayMesh(); - var arrays = new Godot.Collections.Array(); + Godot.Collections.Array arrays = []; arrays.Resize((int)Mesh.ArrayType.Max); arrays[(int)Mesh.ArrayType.Vertex] = vertices; @@ -218,7 +218,7 @@ Method Descriptions |void| **add_blend_shape**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Adds name for a blend shape that will be added with :ref:`add_surface_from_arrays`. Must be called before surface is added. +Adds name for a blend shape that will be added with :ref:`add_surface_from_arrays()`. Must be called before surface is added. .. rst-class:: classref-item-separator @@ -230,7 +230,7 @@ Adds name for a blend shape that will be added with :ref:`add_surface_from_array |void| **add_surface_from_arrays**\ (\ primitive\: :ref:`PrimitiveType`, arrays\: :ref:`Array`, blend_shapes\: :ref:`Array`\[:ref:`Array`\] = [], lods\: :ref:`Dictionary` = {}, flags\: |bitfield|\[:ref:`ArrayFormat`\] = 0\ ) :ref:`πŸ”—` -Creates a new surface. :ref:`Mesh.get_surface_count` will become the ``surf_idx`` for this new surface. +Creates a new surface. :ref:`Mesh.get_surface_count()` will become the ``surf_idx`` for this new surface. Surfaces are created to be rendered using a ``primitive``, which may be any of the values defined in :ref:`PrimitiveType`. @@ -240,7 +240,7 @@ The ``blend_shapes`` argument is an array of vertex data for each blend shape. E The ``lods`` argument is a dictionary with :ref:`float` keys and :ref:`PackedInt32Array` values. Each entry in the dictionary represents an LOD level of the surface, where the value is the :ref:`Mesh.ARRAY_INDEX` array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of an LOD also increases the distance that the objects has to be from the camera before the LOD is used. -The ``flags`` argument is the bitwise or of, as required: One value of :ref:`ArrayCustomFormat` left shifted by ``ARRAY_FORMAT_CUSTOMn_SHIFT`` for each custom channel in use, :ref:`Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE`, :ref:`Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS`, or :ref:`Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY`. +The ``flags`` argument is the bitwise OR of, as required: One value of :ref:`ArrayCustomFormat` left shifted by ``ARRAY_FORMAT_CUSTOMn_SHIFT`` for each custom channel in use, :ref:`Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE`, :ref:`Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS`, or :ref:`Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY`. \ **Note:** When using indices, it is recommended to only use points, lines, or triangles. @@ -350,7 +350,7 @@ Returns the index of the first surface with this name held within this **ArrayMe :ref:`int` **surface_get_array_index_len**\ (\ surf_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns the length in indices of the index array in the requested surface (see :ref:`add_surface_from_arrays`). +Returns the length in indices of the index array in the requested surface (see :ref:`add_surface_from_arrays()`). .. rst-class:: classref-item-separator @@ -362,7 +362,7 @@ Returns the length in indices of the index array in the requested surface (see : :ref:`int` **surface_get_array_len**\ (\ surf_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns the length in vertices of the vertex array in the requested surface (see :ref:`add_surface_from_arrays`). +Returns the length in vertices of the vertex array in the requested surface (see :ref:`add_surface_from_arrays()`). .. rst-class:: classref-item-separator @@ -374,7 +374,7 @@ Returns the length in vertices of the vertex array in the requested surface (see |bitfield|\[:ref:`ArrayFormat`\] **surface_get_format**\ (\ surf_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays`). +Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays()`). .. rst-class:: classref-item-separator @@ -398,7 +398,7 @@ Gets the name assigned to this surface. :ref:`PrimitiveType` **surface_get_primitive_type**\ (\ surf_idx\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays`). +Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays()`). .. rst-class:: classref-item-separator diff --git a/classes/class_arrayoccluder3d.rst b/classes/class_arrayoccluder3d.rst index 8fd397dc36d..4c6278bfbae 100644 --- a/classes/class_arrayoccluder3d.rst +++ b/classes/class_arrayoccluder3d.rst @@ -78,7 +78,7 @@ Property Descriptions The occluder's index position. Indices determine which points from the :ref:`vertices` array should be drawn, and in which order. -\ **Note:** The occluder is always updated after setting this value. If creating occluders procedurally, consider using :ref:`set_arrays` instead to avoid updating the occluder twice when it's created. +\ **Note:** The occluder is always updated after setting this value. If creating occluders procedurally, consider using :ref:`set_arrays()` instead to avoid updating the occluder twice when it's created. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. @@ -99,7 +99,7 @@ The occluder's index position. Indices determine which points from the :ref:`ver The occluder's vertex positions in local 3D coordinates. -\ **Note:** The occluder is always updated after setting this value. If creating occluders procedurally, consider using :ref:`set_arrays` instead to avoid updating the occluder twice when it's created. +\ **Note:** The occluder is always updated after setting this value. If creating occluders procedurally, consider using :ref:`set_arrays()` instead to avoid updating the occluder twice when it's created. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedVector3Array` for more details. diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst index dc870e3ff3a..52f0e004bd1 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -128,7 +128,7 @@ Note that this function is hidden in the default **AStar2D** class. Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater. -The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. +The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost()` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. .. tabs:: @@ -337,7 +337,7 @@ If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` :ref:`int` **get_point_capacity**\ (\ ) |const| :ref:`πŸ”—` -Returns the capacity of the structure backing the points, useful in conjunction with :ref:`reserve_space`. +Returns the capacity of the structure backing the points, useful in conjunction with :ref:`reserve_space()`. .. rst-class:: classref-item-separator @@ -530,7 +530,7 @@ Sets the ``position`` for the point with the given ``id``. |void| **set_point_weight_scale**\ (\ id\: :ref:`int`, weight_scale\: :ref:`float`\ ) :ref:`πŸ”—` -Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. +Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost()` when determining the overall cost of traveling across a segment from a neighboring point to this point. .. |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_astar3d.rst b/classes/class_astar3d.rst index c18872fff7f..60150657baa 100644 --- a/classes/class_astar3d.rst +++ b/classes/class_astar3d.rst @@ -21,9 +21,9 @@ Description A\* (A star) is a computer algorithm used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Redot's A\* implementation uses points in 3D space and Euclidean distances by default. -You must add points manually with :ref:`add_point` and create segments manually with :ref:`connect_points`. Once done, you can test if there is a path between two points with the :ref:`are_points_connected` function, get a path containing indices by :ref:`get_id_path`, or one containing actual coordinates with :ref:`get_point_path`. +You must add points manually with :ref:`add_point()` and create segments manually with :ref:`connect_points()`. Once done, you can test if there is a path between two points with the :ref:`are_points_connected()` function, get a path containing indices by :ref:`get_id_path()`, or one containing actual coordinates with :ref:`get_point_path()`. -It is also possible to use non-Euclidean distances. To do so, create a script that extends **AStar3D** and override the methods :ref:`_compute_cost` and :ref:`_estimate_cost`. Both should take two point IDs and return the distance between the corresponding points. +It is also possible to use non-Euclidean distances. To do so, create a script that extends **AStar3D** and override the methods :ref:`_compute_cost()` and :ref:`_estimate_cost()`. Both should take two point IDs and return the distance between the corresponding points. \ **Example:** Use Manhattan distance instead of Euclidean distance: @@ -70,9 +70,9 @@ It is also possible to use non-Euclidean distances. To do so, create a script th -\ :ref:`_estimate_cost` should return a lower bound of the distance, i.e. ``_estimate_cost(u, v) <= _compute_cost(u, v)``. This serves as a hint to the algorithm because the custom :ref:`_compute_cost` might be computation-heavy. If this is not the case, make :ref:`_estimate_cost` return the same value as :ref:`_compute_cost` to provide the algorithm with the most accurate information. +\ :ref:`_estimate_cost()` should return a lower bound of the distance, i.e. ``_estimate_cost(u, v) <= _compute_cost(u, v)``. This serves as a hint to the algorithm because the custom :ref:`_compute_cost()` might be computation-heavy. If this is not the case, make :ref:`_estimate_cost()` return the same value as :ref:`_compute_cost()` to provide the algorithm with the most accurate information. -If the default :ref:`_estimate_cost` and :ref:`_compute_cost` methods are used, or if the supplied :ref:`_estimate_cost` method returns a lower bound of the cost, then the paths returned by A\* will be the lowest-cost paths. Here, the cost of a path equals the sum of the :ref:`_compute_cost` results of all segments in the path multiplied by the ``weight_scale``\ s of the endpoints of the respective segments. If the default methods are used and the ``weight_scale``\ s of all points are set to ``1.0``, then this equals the sum of Euclidean distances of all segments in the path. +If the default :ref:`_estimate_cost()` and :ref:`_compute_cost()` methods are used, or if the supplied :ref:`_estimate_cost()` method returns a lower bound of the cost, then the paths returned by A\* will be the lowest-cost paths. Here, the cost of a path equals the sum of the :ref:`_compute_cost()` results of all segments in the path multiplied by the ``weight_scale``\ s of the endpoints of the respective segments. If the default methods are used and the ``weight_scale``\ s of all points are set to ``1.0``, then this equals the sum of Euclidean distances of all segments in the path. .. rst-class:: classref-reftable-group @@ -179,7 +179,7 @@ Note that this function is hidden in the default **AStar3D** class. Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater. -The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. +The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost()` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. .. tabs:: @@ -387,7 +387,7 @@ If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` :ref:`int` **get_point_capacity**\ (\ ) |const| :ref:`πŸ”—` -Returns the capacity of the structure backing the points, useful in conjunction with :ref:`reserve_space`. +Returns the capacity of the structure backing the points, useful in conjunction with :ref:`reserve_space()`. .. rst-class:: classref-item-separator @@ -579,7 +579,7 @@ Sets the ``position`` for the point with the given ``id``. |void| **set_point_weight_scale**\ (\ id\: :ref:`int`, weight_scale\: :ref:`float`\ ) :ref:`πŸ”—` -Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. +Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost()` when determining the overall cost of traveling across a segment from a neighboring point to this point. .. |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_astargrid2d.rst b/classes/class_astargrid2d.rst index c7e8641207e..d5246c44cb3 100644 --- a/classes/class_astargrid2d.rst +++ b/classes/class_astargrid2d.rst @@ -21,7 +21,7 @@ Description **AStarGrid2D** is a variant of :ref:`AStar2D` that is specialized for partial 2D grids. It is simpler to use because it doesn't require you to manually create points and connect them together. This class also supports multiple types of heuristics, modes for diagonal movement, and a jumping mode to speed up calculations. -To use **AStarGrid2D**, you only need to set the :ref:`region` of the grid, optionally set the :ref:`cell_size`, and then call the :ref:`update` method: +To use **AStarGrid2D**, you only need to set the :ref:`region` of the grid, optionally set the :ref:`cell_size`, and then call the :ref:`update()` method: .. tabs:: @@ -41,12 +41,12 @@ To use **AStarGrid2D**, you only need to set the :ref:`region`. +To remove a point from the pathfinding grid, it must be set as "solid" with :ref:`set_point_solid()`. .. rst-class:: classref-reftable-group @@ -318,7 +318,7 @@ Property Descriptions - |void| **set_cell_shape**\ (\ value\: :ref:`CellShape`\ ) - :ref:`CellShape` **get_cell_shape**\ (\ ) -The cell shape. Affects how the positions are placed in the grid. If changed, :ref:`update` needs to be called before finding the next path. +The cell shape. Affects how the positions are placed in the grid. If changed, :ref:`update()` needs to be called before finding the next path. .. rst-class:: classref-item-separator @@ -335,7 +335,7 @@ The cell shape. Affects how the positions are placed in the grid. If changed, :r - |void| **set_cell_size**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_cell_size**\ (\ ) -The size of the point cell which will be applied to calculate the resulting point position returned by :ref:`get_point_path`. If changed, :ref:`update` needs to be called before finding the next path. +The size of the point cell which will be applied to calculate the resulting point position returned by :ref:`get_point_path()`. If changed, :ref:`update()` needs to be called before finding the next path. .. rst-class:: classref-item-separator @@ -352,7 +352,7 @@ The size of the point cell which will be applied to calculate the resulting poin - |void| **set_default_compute_heuristic**\ (\ value\: :ref:`Heuristic`\ ) - :ref:`Heuristic` **get_default_compute_heuristic**\ (\ ) -The default :ref:`Heuristic` which will be used to calculate the cost between two points if :ref:`_compute_cost` was not overridden. +The default :ref:`Heuristic` which will be used to calculate the cost between two points if :ref:`_compute_cost()` was not overridden. .. rst-class:: classref-item-separator @@ -369,7 +369,7 @@ The default :ref:`Heuristic` which will be used to c - |void| **set_default_estimate_heuristic**\ (\ value\: :ref:`Heuristic`\ ) - :ref:`Heuristic` **get_default_estimate_heuristic**\ (\ ) -The default :ref:`Heuristic` which will be used to calculate the cost between the point and the end point if :ref:`_estimate_cost` was not overridden. +The default :ref:`Heuristic` which will be used to calculate the cost between the point and the end point if :ref:`_estimate_cost()` was not overridden. .. rst-class:: classref-item-separator @@ -439,7 +439,7 @@ The maximum number of points to traverse before giving up. If set to ``0``, the - |void| **set_offset**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_offset**\ (\ ) -The offset of the grid which will be applied to calculate the resulting point position returned by :ref:`get_point_path`. If changed, :ref:`update` needs to be called before finding the next path. +The offset of the grid which will be applied to calculate the resulting point position returned by :ref:`get_point_path()`. If changed, :ref:`update()` needs to be called before finding the next path. .. rst-class:: classref-item-separator @@ -456,7 +456,7 @@ The offset of the grid which will be applied to calculate the resulting point po - |void| **set_region**\ (\ value\: :ref:`Rect2i`\ ) - :ref:`Rect2i` **get_region**\ (\ ) -The region of grid cells available for pathfinding. If changed, :ref:`update` needs to be called before finding the next path. +The region of grid cells available for pathfinding. If changed, :ref:`update()` needs to be called before finding the next path. .. rst-class:: classref-item-separator @@ -475,7 +475,7 @@ The region of grid cells available for pathfinding. If changed, :ref:`update` instead. -The size of the grid (number of cells of size :ref:`cell_size` on each axis). If changed, :ref:`update` needs to be called before finding the next path. +The size of the grid (number of cells of size :ref:`cell_size` on each axis). If changed, :ref:`update()` needs to be called before finding the next path. .. rst-class:: classref-section-separator @@ -534,7 +534,7 @@ Clears the grid and sets the :ref:`region` to Fills the given ``region`` on the grid with the specified value for the solid flag. -\ **Note:** Calling :ref:`update` is not needed after the call of this function. +\ **Note:** Calling :ref:`update()` is not needed after the call of this function. .. rst-class:: classref-item-separator @@ -548,7 +548,7 @@ Fills the given ``region`` on the grid with the specified value for the solid fl Fills the given ``region`` on the grid with the specified value for the weight scale. -\ **Note:** Calling :ref:`update` is not needed after the call of this function. +\ **Note:** Calling :ref:`update()` is not needed after the call of this function. .. rst-class:: classref-item-separator @@ -630,7 +630,7 @@ Returns the weight scale of the point associated with the given ``id``. :ref:`bool` **is_dirty**\ (\ ) |const| :ref:`πŸ”—` -Indicates that the grid parameters were changed and :ref:`update` needs to be called. +Indicates that the grid parameters were changed and :ref:`update()` needs to be called. .. rst-class:: classref-item-separator @@ -680,7 +680,7 @@ Returns ``true`` if a point is disabled for pathfinding. By default, all points Disables or enables the specified point for pathfinding. Useful for making an obstacle. By default, all points are enabled. -\ **Note:** Calling :ref:`update` is not needed after the call of this function. +\ **Note:** Calling :ref:`update()` is not needed after the call of this function. .. rst-class:: classref-item-separator @@ -692,9 +692,9 @@ Disables or enables the specified point for pathfinding. Useful for making an ob |void| **set_point_weight_scale**\ (\ id\: :ref:`Vector2i`, weight_scale\: :ref:`float`\ ) :ref:`πŸ”—` -Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. +Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost()` when determining the overall cost of traveling across a segment from a neighboring point to this point. -\ **Note:** Calling :ref:`update` is not needed after the call of this function. +\ **Note:** Calling :ref:`update()` is not needed after the call of this function. .. rst-class:: classref-item-separator @@ -706,7 +706,7 @@ Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scal |void| **update**\ (\ ) :ref:`πŸ”—` -Updates the internal state of the grid according to the parameters to prepare it to search the path. Needs to be called if parameters like :ref:`region`, :ref:`cell_size` or :ref:`offset` are changed. :ref:`is_dirty` will return ``true`` if this is the case and this needs to be called. +Updates the internal state of the grid according to the parameters to prepare it to search the path. Needs to be called if parameters like :ref:`region`, :ref:`cell_size` or :ref:`offset` are changed. :ref:`is_dirty()` will return ``true`` if this is the case and this needs to be called. \ **Note:** All point data (solidity and weight scale) will be cleared. diff --git a/classes/class_audioeffect.rst b/classes/class_audioeffect.rst index ce194fd05af..246ecb36cfe 100644 --- a/classes/class_audioeffect.rst +++ b/classes/class_audioeffect.rst @@ -21,7 +21,7 @@ Base class for audio effect resources. Description ----------- -The base :ref:`Resource` for every audio effect. In the editor, an audio effect can be added to the current bus layout through the Audio panel. At run-time, it is also possible to manipulate audio effects through :ref:`AudioServer.add_bus_effect`, :ref:`AudioServer.remove_bus_effect`, and :ref:`AudioServer.get_bus_effect`. +The base :ref:`Resource` for every audio effect. In the editor, an audio effect can be added to the current bus layout through the Audio panel. At run-time, it is also possible to manipulate audio effects through :ref:`AudioServer.add_bus_effect()`, :ref:`AudioServer.remove_bus_effect()`, and :ref:`AudioServer.get_bus_effect()`. When applied on a bus, an audio effect creates a corresponding :ref:`AudioEffectInstance`. The instance is directly responsible for manipulating the sound, based on the original audio effect's properties. @@ -61,7 +61,7 @@ Method Descriptions :ref:`AudioEffectInstance` **_instantiate**\ (\ ) |virtual| :ref:`πŸ”—` -Override this method to customize the :ref:`AudioEffectInstance` created when this effect is applied on a bus in the editor's Audio panel, or through :ref:`AudioServer.add_bus_effect`. +Override this method to customize the :ref:`AudioEffectInstance` created when this effect is applied on a bus in the editor's Audio panel, or through :ref:`AudioServer.add_bus_effect()`. :: diff --git a/classes/class_audioeffectamplify.rst b/classes/class_audioeffectamplify.rst index 4c40139661f..c983ca17ee1 100644 --- a/classes/class_audioeffectamplify.rst +++ b/classes/class_audioeffectamplify.rst @@ -81,7 +81,7 @@ Amount of amplification in decibels. Positive values make the sound louder, nega Amount of amplification as a linear value. -\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db` on a value. +\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear()` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db()` on a value. .. |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_audioeffectcapture.rst b/classes/class_audioeffectcapture.rst index 0d71c927ac4..5d81c4e7fee 100644 --- a/classes/class_audioeffectcapture.rst +++ b/classes/class_audioeffectcapture.rst @@ -21,7 +21,7 @@ Description AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer. -Application code should consume these audio frames from this ring buffer using :ref:`get_buffer` and process it as needed, for example to capture data from an :ref:`AudioStreamMicrophone`, implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating-point PCM. +Application code should consume these audio frames from this ring buffer using :ref:`get_buffer()` and process it as needed, for example to capture data from an :ref:`AudioStreamMicrophone`, implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating-point PCM. Unlike :ref:`AudioEffectRecord`, this effect only returns the raw audio samples instead of encoding them into an :ref:`AudioStream`. @@ -171,7 +171,7 @@ Returns the number of audio frames discarded from the audio bus due to full buff :ref:`int` **get_frames_available**\ (\ ) |const| :ref:`πŸ”—` -Returns the number of frames available to read using :ref:`get_buffer`. +Returns the number of frames available to read using :ref:`get_buffer()`. .. rst-class:: classref-item-separator diff --git a/classes/class_audioeffectinstance.rst b/classes/class_audioeffectinstance.rst index 260d0797be6..a887a778bef 100644 --- a/classes/class_audioeffectinstance.rst +++ b/classes/class_audioeffectinstance.rst @@ -21,7 +21,7 @@ Manipulates the audio it receives for a given effect. Description ----------- -An audio effect instance manipulates the audio it receives for a given effect. This instance is automatically created by an :ref:`AudioEffect` when it is added to a bus, and should usually not be created directly. If necessary, it can be fetched at run-time with :ref:`AudioServer.get_bus_effect_instance`. +An audio effect instance manipulates the audio it receives for a given effect. This instance is automatically created by an :ref:`AudioEffect` when it is added to a bus, and should usually not be created directly. If necessary, it can be fetched at run-time with :ref:`AudioServer.get_bus_effect_instance()`. .. rst-class:: classref-introduction-group @@ -59,7 +59,7 @@ Method Descriptions |void| **_process**\ (\ src_buffer\: ``const void*``, dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int`\ ) |virtual| :ref:`πŸ”—` -Called by the :ref:`AudioServer` to process this effect. When :ref:`_process_silence` is not overridden or it returns ``false``, this method is called only when the bus is active. +Called by the :ref:`AudioServer` to process this effect. When :ref:`_process_silence()` is not overridden or it returns ``false``, this method is called only when the bus is active. \ **Note:** It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it. @@ -75,7 +75,7 @@ Called by the :ref:`AudioServer` to process this effect. When Override this method to customize the processing behavior of this effect instance. -Should return ``true`` to force the :ref:`AudioServer` to always call :ref:`_process`, even if the bus has been muted or cannot otherwise be heard. +Should return ``true`` to force the :ref:`AudioServer` to always call :ref:`_process()`, even if the bus has been muted or cannot otherwise be heard. .. |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_audioeffectspectrumanalyzer.rst b/classes/class_audioeffectspectrumanalyzer.rst index 815bc382db7..cce3433c472 100644 --- a/classes/class_audioeffectspectrumanalyzer.rst +++ b/classes/class_audioeffectspectrumanalyzer.rst @@ -21,7 +21,7 @@ Description This audio effect does not affect sound output, but can be used for real-time audio visualizations. -This resource configures an :ref:`AudioEffectSpectrumAnalyzerInstance`, which performs the actual analysis at runtime. An instance can be obtained with :ref:`AudioServer.get_bus_effect_instance`. +This resource configures an :ref:`AudioEffectSpectrumAnalyzerInstance`, which performs the actual analysis at runtime. An instance can be obtained with :ref:`AudioServer.get_bus_effect_instance()`. See also :ref:`AudioStreamGenerator` for procedurally generating sounds. diff --git a/classes/class_audioeffectspectrumanalyzerinstance.rst b/classes/class_audioeffectspectrumanalyzerinstance.rst index c921e8674a5..bca722fbf68 100644 --- a/classes/class_audioeffectspectrumanalyzerinstance.rst +++ b/classes/class_audioeffectspectrumanalyzerinstance.rst @@ -21,7 +21,7 @@ Description The runtime part of an :ref:`AudioEffectSpectrumAnalyzer`, which can be used to query the magnitude of a frequency range on its host bus. -An instance of this class can be obtained with :ref:`AudioServer.get_bus_effect_instance`. +An instance of this class can be obtained with :ref:`AudioServer.get_bus_effect_instance()`. .. rst-class:: classref-introduction-group diff --git a/classes/class_audiolistener2d.rst b/classes/class_audiolistener2d.rst index 20aeb83275a..18deec5933a 100644 --- a/classes/class_audiolistener2d.rst +++ b/classes/class_audiolistener2d.rst @@ -22,7 +22,7 @@ Overrides the location sounds are heard from. Description ----------- -Once added to the scene tree and enabled using :ref:`make_current`, this node will override the location sounds are heard from. Only one **AudioListener2D** can be current. Using :ref:`make_current` will disable the previous **AudioListener2D**. +Once added to the scene tree and enabled using :ref:`make_current()`, this node will override the location sounds are heard from. Only one **AudioListener2D** can be current. Using :ref:`make_current()` will disable the previous **AudioListener2D**. If there is no active **AudioListener2D** in the current :ref:`Viewport`, center of the screen will be used as a hearing point for the audio. **AudioListener2D** needs to be inside :ref:`SceneTree` to function. diff --git a/classes/class_audiolistener3d.rst b/classes/class_audiolistener3d.rst index c985ec7f0fb..a2867d90f2c 100644 --- a/classes/class_audiolistener3d.rst +++ b/classes/class_audiolistener3d.rst @@ -22,7 +22,7 @@ Overrides the location sounds are heard from. Description ----------- -Once added to the scene tree and enabled using :ref:`make_current`, this node will override the location sounds are heard from. This can be used to listen from a location different from the :ref:`Camera3D`. +Once added to the scene tree and enabled using :ref:`make_current()`, this node will override the location sounds are heard from. This can be used to listen from a location different from the :ref:`Camera3D`. .. rst-class:: classref-reftable-group @@ -81,7 +81,7 @@ Returns the listener's global orthonormalized :ref:`Transform3D` **is_current**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the listener was made current using :ref:`make_current`, ``false`` otherwise. +Returns ``true`` if the listener was made current using :ref:`make_current()`, ``false`` otherwise. \ **Note:** There may be more than one AudioListener3D marked as "current" in the scene tree, but only the one that was made current last will be used. diff --git a/classes/class_audioserver.rst b/classes/class_audioserver.rst index c0f40d3357b..01305e0fc71 100644 --- a/classes/class_audioserver.rst +++ b/classes/class_audioserver.rst @@ -319,7 +319,7 @@ Number of available audio buses. - |void| **set_input_device**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_input_device**\ (\ ) -Name of the current device for audio input (see :ref:`get_input_device_list`). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value ``"Default"`` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to ``"Default"``. +Name of the current device for audio input (see :ref:`get_input_device_list()`). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value ``"Default"`` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to ``"Default"``. \ **Note:** :ref:`ProjectSettings.audio/driver/enable_input` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. @@ -338,7 +338,7 @@ Name of the current device for audio input (see :ref:`get_input_device_list`\ ) - :ref:`String` **get_output_device**\ (\ ) -Name of the current device for audio output (see :ref:`get_output_device_list`). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value ``"Default"`` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to ``"Default"``. +Name of the current device for audio output (see :ref:`get_output_device_list()`). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value ``"Default"`` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to ``"Default"``. .. rst-class:: classref-item-separator @@ -530,7 +530,7 @@ Returns the volume of the bus at index ``bus_idx`` in dB. Returns the volume of the bus at index ``bus_idx`` as a linear value. -\ **Note:** The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear` on the result of :ref:`get_bus_volume_db`. +\ **Note:** The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear()` on the result of :ref:`get_bus_volume_db()`. .. rst-class:: classref-item-separator @@ -606,7 +606,7 @@ Returns the names of all audio output devices detected on the system. Returns the audio driver's effective output latency. This is based on :ref:`ProjectSettings.audio/driver/output_latency`, but the exact returned value will differ depending on the operating system and audio driver. -\ **Note:** This can be expensive; it is not recommended to call :ref:`get_output_latency` every frame. +\ **Note:** This can be expensive; it is not recommended to call :ref:`get_output_latency()` every frame. .. rst-class:: classref-item-separator @@ -706,7 +706,7 @@ If ``true``, the bus at index ``bus_idx`` is in solo mode. If ``true``, the stream is registered as a sample. The engine will not have to register it before playing the sample. -If ``false``, the stream will have to be registered before playing it. To prevent lag spikes, register the stream as sample with :ref:`register_stream_as_sample`. +If ``false``, the stream will have to be registered before playing it. To prevent lag spikes, register the stream as sample with :ref:`register_stream_as_sample()`. .. rst-class:: classref-item-separator @@ -882,7 +882,7 @@ Sets the volume in decibels of the bus at index ``bus_idx`` to ``volume_db``. Sets the volume as a linear value of the bus at index ``bus_idx`` to ``volume_linear``. -\ **Note:** Using this method is equivalent to calling :ref:`set_bus_volume_db` with the result of :ref:`@GlobalScope.linear_to_db` on a value. +\ **Note:** Using this method is equivalent to calling :ref:`set_bus_volume_db()` with the result of :ref:`@GlobalScope.linear_to_db()` on a value. .. rst-class:: classref-item-separator @@ -894,7 +894,7 @@ Sets the volume as a linear value of the bus at index ``bus_idx`` to ``volume_li |void| **set_enable_tagging_used_audio_streams**\ (\ enable\: :ref:`bool`\ ) :ref:`πŸ”—` -If set to ``true``, all instances of :ref:`AudioStreamPlayback` will call :ref:`AudioStreamPlayback._tag_used_streams` every mix step. +If set to ``true``, all instances of :ref:`AudioStreamPlayback` will call :ref:`AudioStreamPlayback._tag_used_streams()` every mix step. \ **Note:** This is enabled by default in the editor, as it is used by editor plugins for the audio stream previews. diff --git a/classes/class_audiostream.rst b/classes/class_audiostream.rst index 504bd968144..80754419189 100644 --- a/classes/class_audiostream.rst +++ b/classes/class_audiostream.rst @@ -148,7 +148,7 @@ Ideally, the returned value should be based off the stream's sample rate (:ref:` :ref:`float` **_get_length**\ (\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to customize the returned value of :ref:`get_length`. Should return the length of this audio stream, in seconds. +Override this method to customize the returned value of :ref:`get_length()`. Should return the length of this audio stream, in seconds. .. rst-class:: classref-item-separator @@ -160,7 +160,7 @@ Override this method to customize the returned value of :ref:`get_length`\[:ref:`Dictionary`\] **_get_parameter_list**\ (\ ) |virtual| |const| :ref:`πŸ”—` -Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see :ref:`Object.get_property_list`). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field. +Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see :ref:`Object.get_property_list()`). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field. .. rst-class:: classref-item-separator @@ -196,7 +196,7 @@ Override this method to return ``true`` if this stream has a loop. :ref:`AudioStreamPlayback` **_instantiate_playback**\ (\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to customize the returned value of :ref:`instantiate_playback`. Should return a new :ref:`AudioStreamPlayback` created when the stream is played (such as by an :ref:`AudioStreamPlayer`). +Override this method to customize the returned value of :ref:`instantiate_playback()`. Should return a new :ref:`AudioStreamPlayback` created when the stream is played (such as by an :ref:`AudioStreamPlayer`). .. rst-class:: classref-item-separator @@ -208,7 +208,7 @@ Override this method to customize the returned value of :ref:`instantiate_playba :ref:`bool` **_is_monophonic**\ (\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to customize the returned value of :ref:`is_monophonic`. Should return ``true`` if this audio stream only supports one channel. +Override this method to customize the returned value of :ref:`is_monophonic()`. Should return ``true`` if this audio stream only supports one channel. .. rst-class:: classref-item-separator @@ -260,7 +260,7 @@ Returns the length of the audio stream in seconds. :ref:`AudioStreamPlayback` **instantiate_playback**\ (\ ) :ref:`πŸ”—` -Returns a newly created :ref:`AudioStreamPlayback` intended to play this audio stream. Useful for when you want to extend :ref:`_instantiate_playback` but call :ref:`instantiate_playback` from an internally held AudioStream subresource. An example of this can be found in the source code for ``AudioStreamRandomPitch::instantiate_playback``. +Returns a newly created :ref:`AudioStreamPlayback` intended to play this audio stream. Useful for when you want to extend :ref:`_instantiate_playback()` but call :ref:`instantiate_playback()` from an internally held AudioStream subresource. An example of this can be found in the source code for ``AudioStreamRandomPitch::instantiate_playback``. .. rst-class:: classref-item-separator diff --git a/classes/class_audiostreamgenerator.rst b/classes/class_audiostreamgenerator.rst index f3db3aed482..2cec0144fb0 100644 --- a/classes/class_audiostreamgenerator.rst +++ b/classes/class_audiostreamgenerator.rst @@ -31,6 +31,7 @@ Here's a sample on how to use it to generate a sine wave: var playback # Will hold the AudioStreamGeneratorPlayback. @onready var sample_hz = $AudioStreamPlayer.stream.mix_rate var pulse_hz = 440.0 # The frequency of the sound wave. + var phase = 0.0 func _ready(): $AudioStreamPlayer.play() @@ -38,7 +39,6 @@ Here's a sample on how to use it to generate a sine wave: fill_buffer() func fill_buffer(): - var phase = 0.0 var increment = pulse_hz / sample_hz var frames_available = playback.get_frames_available() @@ -53,6 +53,7 @@ Here's a sample on how to use it to generate a sine wave: private AudioStreamGeneratorPlayback _playback; // Will hold the AudioStreamGeneratorPlayback. private float _sampleHz; private float _pulseHz = 440.0f; // The frequency of the sound wave. + private double phase = 0.0; public override void _Ready() { @@ -67,7 +68,6 @@ Here's a sample on how to use it to generate a sine wave: public void FillBuffer() { - double phase = 0.0; float increment = _pulseHz / _sampleHz; int framesAvailable = _playback.GetFramesAvailable(); @@ -101,11 +101,60 @@ Properties .. table:: :widths: auto - +---------------------------+-------------------------------------------------------------------------+-------------+ - | :ref:`float` | :ref:`buffer_length` | ``0.5`` | - +---------------------------+-------------------------------------------------------------------------+-------------+ - | :ref:`float` | :ref:`mix_rate` | ``44100.0`` | - +---------------------------+-------------------------------------------------------------------------+-------------+ + +-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-------------+ + | :ref:`float` | :ref:`buffer_length` | ``0.5`` | + +-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-------------+ + | :ref:`float` | :ref:`mix_rate` | ``44100.0`` | + +-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-------------+ + | :ref:`AudioStreamGeneratorMixRate` | :ref:`mix_rate_mode` | ``2`` | + +-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Enumerations +------------ + +.. _enum_AudioStreamGenerator_AudioStreamGeneratorMixRate: + +.. rst-class:: classref-enumeration + +enum **AudioStreamGeneratorMixRate**: :ref:`πŸ”—` + +.. _class_AudioStreamGenerator_constant_MIX_RATE_OUTPUT: + +.. rst-class:: classref-enumeration-constant + +:ref:`AudioStreamGeneratorMixRate` **MIX_RATE_OUTPUT** = ``0`` + +Current :ref:`AudioServer` output mixing rate. + +.. _class_AudioStreamGenerator_constant_MIX_RATE_INPUT: + +.. rst-class:: classref-enumeration-constant + +:ref:`AudioStreamGeneratorMixRate` **MIX_RATE_INPUT** = ``1`` + +Current :ref:`AudioServer` input mixing rate. + +.. _class_AudioStreamGenerator_constant_MIX_RATE_CUSTOM: + +.. rst-class:: classref-enumeration-constant + +:ref:`AudioStreamGeneratorMixRate` **MIX_RATE_CUSTOM** = ``2`` + +Custom mixing rate, specified by :ref:`mix_rate`. + +.. _class_AudioStreamGenerator_constant_MIX_RATE_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`AudioStreamGeneratorMixRate` **MIX_RATE_MAX** = ``3`` + +Maximum value for the mixing rate mode enum. .. rst-class:: classref-section-separator @@ -150,6 +199,27 @@ In games, common sample rates in use are ``11025``, ``16000``, ``22050``, ``3200 According to the `Nyquist-Shannon sampling theorem `__, there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as ``32000`` or ``22050`` may be usable with no loss in quality. +\ **Note:** **AudioStreamGenerator** is not automatically resampling input data, to produce expected result :ref:`mix_rate_mode` should match the sampling rate of input data. + +\ **Note:** If you are using :ref:`AudioEffectCapture` as the source of your data, set :ref:`mix_rate_mode` to :ref:`MIX_RATE_INPUT` or :ref:`MIX_RATE_OUTPUT` to automatically match current :ref:`AudioServer` mixing rate. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AudioStreamGenerator_property_mix_rate_mode: + +.. rst-class:: classref-property + +:ref:`AudioStreamGeneratorMixRate` **mix_rate_mode** = ``2`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_mix_rate_mode**\ (\ value\: :ref:`AudioStreamGeneratorMixRate`\ ) +- :ref:`AudioStreamGeneratorMixRate` **get_mix_rate_mode**\ (\ ) + +Mixing rate mode. If set to :ref:`MIX_RATE_CUSTOM`, :ref:`mix_rate` is used, otherwise current :ref:`AudioServer` mixing rate is used. + .. |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_audiostreamgeneratorplayback.rst b/classes/class_audiostreamgeneratorplayback.rst index 99121c1916e..872711bcdcf 100644 --- a/classes/class_audiostreamgeneratorplayback.rst +++ b/classes/class_audiostreamgeneratorplayback.rst @@ -115,7 +115,7 @@ Returns the number of times the playback skipped due to a buffer underrun in the :ref:`bool` **push_buffer**\ (\ frames\: :ref:`PackedVector2Array`\ ) :ref:`πŸ”—` -Pushes several audio data frames to the buffer. This is usually more efficient than :ref:`push_frame` in C# and compiled languages via GDExtension, but :ref:`push_buffer` may be *less* efficient in GDScript. +Pushes several audio data frames to the buffer. This is usually more efficient than :ref:`push_frame()` in C# and compiled languages via GDExtension, but :ref:`push_buffer()` may be *less* efficient in GDScript. .. rst-class:: classref-item-separator @@ -127,7 +127,7 @@ Pushes several audio data frames to the buffer. This is usually more efficient t :ref:`bool` **push_frame**\ (\ frame\: :ref:`Vector2`\ ) :ref:`πŸ”—` -Pushes a single audio data frame to the buffer. This is usually less efficient than :ref:`push_buffer` in C# and compiled languages via GDExtension, but :ref:`push_frame` may be *more* efficient in GDScript. +Pushes a single audio data frame to the buffer. This is usually less efficient than :ref:`push_buffer()` in C# and compiled languages via GDExtension, but :ref:`push_frame()` may be *more* efficient in GDScript. .. |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_audiostreaminteractive.rst b/classes/class_audiostreaminteractive.rst index e13f076d001..8dd684bb2d0 100644 --- a/classes/class_audiostreaminteractive.rst +++ b/classes/class_audiostreaminteractive.rst @@ -19,7 +19,7 @@ Audio stream that can playback music interactively, combining clips and a transi Description ----------- -This is an audio stream that can playback music interactively, combining clips and a transition table. Clips must be added first, and then the transition rules via the :ref:`add_transition`. Additionally, this stream exports a property parameter to control the playback via :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`. +This is an audio stream that can playback music interactively, combining clips and a transition table. Clips must be added first, and then the transition rules via the :ref:`add_transition()`. Additionally, this stream exports a property parameter to control the playback via :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`. The way this is used is by filling a number of clips, then configuring the transition table. From there, clips are selected for playback and the music will smoothly go from the current to the new one while using the corresponding transition rule defined in the transition table. @@ -240,7 +240,7 @@ Enable auto-advance, a clip must be specified. :ref:`AutoAdvanceMode` **AUTO_ADVANCE_RETURN_TO_HOLD** = ``2`` -Enable auto-advance, but instead of specifying a clip, the playback will return to hold (see :ref:`add_transition`). +Enable auto-advance, but instead of specifying a clip, the playback will return to hold (see :ref:`add_transition()`). .. rst-class:: classref-section-separator @@ -351,7 +351,7 @@ Erase a transition by providing ``from_clip`` and ``to_clip`` clip indices. :ref :ref:`AutoAdvanceMode` **get_clip_auto_advance**\ (\ clip_index\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return whether a clip has auto-advance enabled. See :ref:`set_clip_auto_advance`. +Return whether a clip has auto-advance enabled. See :ref:`set_clip_auto_advance()`. .. rst-class:: classref-item-separator @@ -399,7 +399,7 @@ Return the :ref:`AudioStream` associated with a clip. :ref:`float` **get_transition_fade_beats**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return the time (in beats) for a transition (see :ref:`add_transition`). +Return the time (in beats) for a transition (see :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -411,7 +411,7 @@ Return the time (in beats) for a transition (see :ref:`add_transition` **get_transition_fade_mode**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return the mode for a transition (see :ref:`add_transition`). +Return the mode for a transition (see :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -423,7 +423,7 @@ Return the mode for a transition (see :ref:`add_transition` **get_transition_filler_clip**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return the filler clip for a transition (see :ref:`add_transition`). +Return the filler clip for a transition (see :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -435,7 +435,7 @@ Return the filler clip for a transition (see :ref:`add_transition` **get_transition_from_time**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return the source time position for a transition (see :ref:`add_transition`). +Return the source time position for a transition (see :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -459,7 +459,7 @@ Return the list of transitions (from, to interleaved). :ref:`TransitionToTime` **get_transition_to_time**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return the destination time position for a transition (see :ref:`add_transition`). +Return the destination time position for a transition (see :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -471,7 +471,7 @@ Return the destination time position for a transition (see :ref:`add_transition< :ref:`bool` **has_transition**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if a given transition exists (was added via :ref:`add_transition`). +Returns ``true`` if a given transition exists (was added via :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -483,7 +483,7 @@ Returns ``true`` if a given transition exists (was added via :ref:`add_transitio :ref:`bool` **is_transition_holding_previous**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return whether a transition uses the *hold previous* functionality (see :ref:`add_transition`). +Return whether a transition uses the *hold previous* functionality (see :ref:`add_transition()`). .. rst-class:: classref-item-separator @@ -495,7 +495,7 @@ Return whether a transition uses the *hold previous* functionality (see :ref:`ad :ref:`bool` **is_transition_using_filler_clip**\ (\ from_clip\: :ref:`int`, to_clip\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Return whether a transition uses the *filler clip* functionality (see :ref:`add_transition`). +Return whether a transition uses the *filler clip* functionality (see :ref:`add_transition()`). .. rst-class:: classref-item-separator diff --git a/classes/class_audiostreammp3.rst b/classes/class_audiostreammp3.rst index 982486b2c4b..98372791a12 100644 --- a/classes/class_audiostreammp3.rst +++ b/classes/class_audiostreammp3.rst @@ -21,6 +21,8 @@ Description MP3 audio stream driver. See :ref:`data` if you want to load an MP3 file at run-time. +\ **Note:** This class can optionally support legacy MP1 and MP2 formats, provided that the engine is compiled with the ``minimp3_extra_formats=yes`` SCons option. These extra formats are not enabled by default. + .. rst-class:: classref-reftable-group Properties @@ -43,6 +45,20 @@ Properties | :ref:`float` | :ref:`loop_offset` | ``0.0`` | +-----------------------------------------------+---------------------------------------------------------------+-----------------------+ +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AudioStreamMP3` | :ref:`load_from_buffer`\ (\ stream_data\: :ref:`PackedByteArray`\ ) |static| | + +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AudioStreamMP3` | :ref:`load_from_file`\ (\ path\: :ref:`String`\ ) |static| | + +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + .. rst-class:: classref-section-separator ---- @@ -183,6 +199,35 @@ If ``true``, the stream will automatically loop when it reaches the end. Time in seconds at which the stream starts after being looped. +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_AudioStreamMP3_method_load_from_buffer: + +.. rst-class:: classref-method + +:ref:`AudioStreamMP3` **load_from_buffer**\ (\ stream_data\: :ref:`PackedByteArray`\ ) |static| :ref:`πŸ”—` + +Creates a new **AudioStreamMP3** instance from the given buffer. The buffer must contain MP3 data. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AudioStreamMP3_method_load_from_file: + +.. rst-class:: classref-method + +:ref:`AudioStreamMP3` **load_from_file**\ (\ path\: :ref:`String`\ ) |static| :ref:`πŸ”—` + +Creates a new **AudioStreamMP3** instance from the given file path. The file must be in MP3 format. + .. |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_audiostreamoggvorbis.rst b/classes/class_audiostreamoggvorbis.rst index 645d27737da..f6ecc928166 100644 --- a/classes/class_audiostreamoggvorbis.rst +++ b/classes/class_audiostreamoggvorbis.rst @@ -58,11 +58,11 @@ Methods .. table:: :widths: auto - +---------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AudioStreamOggVorbis` | :ref:`load_from_buffer`\ (\ buffer\: :ref:`PackedByteArray`\ ) |static| | - +---------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AudioStreamOggVorbis` | :ref:`load_from_file`\ (\ path\: :ref:`String`\ ) |static| | - +---------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AudioStreamOggVorbis` | :ref:`load_from_buffer`\ (\ stream_data\: :ref:`PackedByteArray`\ ) |static| | + +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AudioStreamOggVorbis` | :ref:`load_from_file`\ (\ path\: :ref:`String`\ ) |static| | + +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -190,9 +190,9 @@ Method Descriptions .. rst-class:: classref-method -:ref:`AudioStreamOggVorbis` **load_from_buffer**\ (\ buffer\: :ref:`PackedByteArray`\ ) |static| :ref:`πŸ”—` +:ref:`AudioStreamOggVorbis` **load_from_buffer**\ (\ stream_data\: :ref:`PackedByteArray`\ ) |static| :ref:`πŸ”—` -Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer must contain Ogg Vorbis data. +Creates a new **AudioStreamOggVorbis** instance from the given buffer. The buffer must contain Ogg Vorbis data. .. rst-class:: classref-item-separator @@ -204,7 +204,7 @@ Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer mu :ref:`AudioStreamOggVorbis` **load_from_file**\ (\ path\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Creates a new AudioStreamOggVorbis instance from the given file path. The file must be in Ogg Vorbis format. +Creates a new **AudioStreamOggVorbis** instance from the given file path. The file must be in Ogg Vorbis format. .. |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_audiostreamplayback.rst b/classes/class_audiostreamplayback.rst index 5d91093e10c..882fbffd9b1 100644 --- a/classes/class_audiostreamplayback.rst +++ b/classes/class_audiostreamplayback.rst @@ -105,7 +105,7 @@ Overridable method. Should return how many times this audio stream has looped. M :ref:`Variant` **_get_parameter**\ (\ name\: :ref:`StringName`\ ) |virtual| |const| :ref:`πŸ”—` -Return the current value of a playback parameter by name (see :ref:`AudioStream._get_parameter_list`). +Return the current value of a playback parameter by name (see :ref:`AudioStream._get_parameter_list()`). .. rst-class:: classref-item-separator @@ -155,7 +155,7 @@ Override this method to customize how the audio stream is mixed. This method is |void| **_seek**\ (\ position\: :ref:`float`\ ) |virtual| :ref:`πŸ”—` -Override this method to customize what happens when seeking this audio stream at the given ``position``, such as by calling :ref:`AudioStreamPlayer.seek`. +Override this method to customize what happens when seeking this audio stream at the given ``position``, such as by calling :ref:`AudioStreamPlayer.seek()`. .. rst-class:: classref-item-separator @@ -167,7 +167,7 @@ Override this method to customize what happens when seeking this audio stream at |void| **_set_parameter**\ (\ name\: :ref:`StringName`, value\: :ref:`Variant`\ ) |virtual| :ref:`πŸ”—` -Set the current value of a playback parameter by name (see :ref:`AudioStream._get_parameter_list`). +Set the current value of a playback parameter by name (see :ref:`AudioStream._get_parameter_list()`). .. rst-class:: classref-item-separator @@ -179,7 +179,7 @@ Set the current value of a playback parameter by name (see :ref:`AudioStream._ge |void| **_start**\ (\ from_pos\: :ref:`float`\ ) |virtual| :ref:`πŸ”—` -Override this method to customize what happens when the playback starts at the given position, such as by calling :ref:`AudioStreamPlayer.play`. +Override this method to customize what happens when the playback starts at the given position, such as by calling :ref:`AudioStreamPlayer.play()`. .. rst-class:: classref-item-separator @@ -191,7 +191,7 @@ Override this method to customize what happens when the playback starts at the g |void| **_stop**\ (\ ) |virtual| :ref:`πŸ”—` -Override this method to customize what happens when the playback is stopped, such as by calling :ref:`AudioStreamPlayer.stop`. +Override this method to customize what happens when the playback is stopped, such as by calling :ref:`AudioStreamPlayer.stop()`. .. rst-class:: classref-item-separator @@ -203,7 +203,7 @@ Override this method to customize what happens when the playback is stopped, suc |void| **_tag_used_streams**\ (\ ) |virtual| :ref:`πŸ”—` -Overridable method. Called whenever the audio stream is mixed if the playback is active and :ref:`AudioServer.set_enable_tagging_used_audio_streams` has been set to ``true``. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview. +Overridable method. Called whenever the audio stream is mixed if the playback is active and :ref:`AudioServer.set_enable_tagging_used_audio_streams()` has been set to ``true``. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview. .. rst-class:: classref-item-separator diff --git a/classes/class_audiostreamplaybackinteractive.rst b/classes/class_audiostreamplaybackinteractive.rst index d51f037faf7..20d134182fa 100644 --- a/classes/class_audiostreamplaybackinteractive.rst +++ b/classes/class_audiostreamplaybackinteractive.rst @@ -52,7 +52,7 @@ Method Descriptions :ref:`int` **get_current_clip_index**\ (\ ) |const| :ref:`πŸ”—` -Return the index of the currently playing clip. You can use this to get the name of the currently playing clip with :ref:`AudioStreamInteractive.get_clip_name`. +Return the index of the currently playing clip. You can use this to get the name of the currently playing clip with :ref:`AudioStreamInteractive.get_clip_name()`. \ **Example:** Get the currently playing clip name from inside an :ref:`AudioStreamPlayer` node. diff --git a/classes/class_audiostreamplaybackpolyphonic.rst b/classes/class_audiostreamplaybackpolyphonic.rst index 4a4199c9c9c..d879b4df4f0 100644 --- a/classes/class_audiostreamplaybackpolyphonic.rst +++ b/classes/class_audiostreamplaybackpolyphonic.rst @@ -19,7 +19,7 @@ Playback instance for :ref:`AudioStreamPolyphonic`. Description ----------- -Playback instance for :ref:`AudioStreamPolyphonic`. After setting the ``stream`` property of :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`, the playback instance can be obtained by calling :ref:`AudioStreamPlayer.get_stream_playback`, :ref:`AudioStreamPlayer2D.get_stream_playback` or :ref:`AudioStreamPlayer3D.get_stream_playback` methods. +Playback instance for :ref:`AudioStreamPolyphonic`. After setting the ``stream`` property of :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`, the playback instance can be obtained by calling :ref:`AudioStreamPlayer.get_stream_playback()`, :ref:`AudioStreamPlayer2D.get_stream_playback()` or :ref:`AudioStreamPlayer3D.get_stream_playback()` methods. .. rst-class:: classref-reftable-group @@ -56,7 +56,7 @@ Constants **INVALID_ID** = ``-1`` :ref:`πŸ”—` -Returned by :ref:`play_stream` in case it could not allocate a stream for playback. +Returned by :ref:`play_stream()` in case it could not allocate a stream for playback. .. rst-class:: classref-section-separator @@ -73,7 +73,7 @@ Method Descriptions :ref:`bool` **is_stream_playing**\ (\ stream\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the stream associated with the given integer ID is still playing. Check :ref:`play_stream` for information on when this ID becomes invalid. +Returns ``true`` if the stream associated with the given integer ID is still playing. Check :ref:`play_stream()` for information on when this ID becomes invalid. .. rst-class:: classref-item-separator @@ -89,7 +89,7 @@ Play an :ref:`AudioStream` at a given offset, volume, pitch s The return value is a unique integer ID that is associated to this playback stream and which can be used to control it. -This ID becomes invalid when the stream ends (if it does not loop), when the **AudioStreamPlaybackPolyphonic** is stopped, or when :ref:`stop_stream` is called. +This ID becomes invalid when the stream ends (if it does not loop), when the **AudioStreamPlaybackPolyphonic** is stopped, or when :ref:`stop_stream()` is called. This function returns :ref:`INVALID_ID` if the amount of streams currently playing equals :ref:`AudioStreamPolyphonic.polyphony`. If you need a higher amount of maximum polyphony, raise this value. @@ -103,7 +103,7 @@ This function returns :ref:`INVALID_ID`, pitch_scale\: :ref:`float`\ ) :ref:`πŸ”—` -Change the stream pitch scale. The ``stream`` argument is an integer ID returned by :ref:`play_stream`. +Change the stream pitch scale. The ``stream`` argument is an integer ID returned by :ref:`play_stream()`. .. rst-class:: classref-item-separator @@ -115,7 +115,7 @@ Change the stream pitch scale. The ``stream`` argument is an integer ID returned |void| **set_stream_volume**\ (\ stream\: :ref:`int`, volume_db\: :ref:`float`\ ) :ref:`πŸ”—` -Change the stream volume (in db). The ``stream`` argument is an integer ID returned by :ref:`play_stream`. +Change the stream volume (in db). The ``stream`` argument is an integer ID returned by :ref:`play_stream()`. .. rst-class:: classref-item-separator @@ -127,7 +127,7 @@ Change the stream volume (in db). The ``stream`` argument is an integer ID retur |void| **stop_stream**\ (\ stream\: :ref:`int`\ ) :ref:`πŸ”—` -Stop a stream. The ``stream`` argument is an integer ID returned by :ref:`play_stream`, which becomes invalid after calling this function. +Stop a stream. The ``stream`` argument is an integer ID returned by :ref:`play_stream()`, which becomes invalid after calling this function. .. |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_audiostreamplayer.rst b/classes/class_audiostreamplayer.rst index 8ec3e96e943..bfd65926d60 100644 --- a/classes/class_audiostreamplayer.rst +++ b/classes/class_audiostreamplayer.rst @@ -114,7 +114,7 @@ Signals **finished**\ (\ ) :ref:`πŸ”—` -Emitted when a sound finishes playing without interruptions. This signal is *not* emitted when calling :ref:`stop`, or when exiting the tree while sounds are playing. +Emitted when a sound finishes playing without interruptions. This signal is *not* emitted when calling :ref:`stop()`, or when exiting the tree while sounds are playing. .. rst-class:: classref-section-separator @@ -175,7 +175,7 @@ Property Descriptions - |void| **set_autoplay**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_autoplay_enabled**\ (\ ) -If ``true``, this node calls :ref:`play` when entering the tree. +If ``true``, this node calls :ref:`play()` when entering the tree. .. rst-class:: classref-item-separator @@ -194,7 +194,7 @@ If ``true``, this node calls :ref:`play` wh The target bus name. All sounds from this node will be playing on this bus. -\ **Note:** At runtime, if no bus with the given name exists, all sounds will fall back on ``"Master"``. See also :ref:`AudioServer.get_bus_name`. +\ **Note:** At runtime, if no bus with the given name exists, all sounds will fall back on ``"Master"``. See also :ref:`AudioServer.get_bus_name()`. .. rst-class:: classref-item-separator @@ -211,7 +211,7 @@ The target bus name. All sounds from this node will be playing on this bus. - |void| **set_max_polyphony**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_max_polyphony**\ (\ ) -The maximum number of sounds this node can play at the same time. Calling :ref:`play` after this value is reached will cut off the oldest sounds. +The maximum number of sounds this node can play at the same time. Calling :ref:`play()` after this value is reached will cut off the oldest sounds. .. rst-class:: classref-item-separator @@ -281,7 +281,7 @@ The playback type of the stream player. If set other than to the default value, - |void| **set_playing**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_playing**\ (\ ) -If ``true``, this node is playing sounds. Setting this property has the same effect as :ref:`play` and :ref:`stop`. +If ``true``, this node is playing sounds. Setting this property has the same effect as :ref:`play()` and :ref:`stop()`. .. rst-class:: classref-item-separator @@ -336,7 +336,7 @@ If ``true``, the sounds are paused. Setting :ref:`stream_paused`'s volume. -\ **Note:** To convert between decibel and linear energy (like most volume sliders do), use :ref:`volume_linear`, or :ref:`@GlobalScope.db_to_linear` and :ref:`@GlobalScope.linear_to_db`. +\ **Note:** To convert between decibel and linear energy (like most volume sliders do), use :ref:`volume_linear`, or :ref:`@GlobalScope.db_to_linear()` and :ref:`@GlobalScope.linear_to_db()`. .. rst-class:: classref-item-separator @@ -355,7 +355,7 @@ Volume of sound, in decibels. This is an offset of the :ref:`stream` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db` on a value. +\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear()` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db()` on a value. .. rst-class:: classref-section-separator @@ -374,7 +374,7 @@ Method Descriptions Returns the position in the :ref:`AudioStream` of the latest sound, in seconds. Returns ``0.0`` if no sounds are playing. -\ **Note:** The position is not always accurate, as the :ref:`AudioServer` does not mix audio every processed frame. To get more accurate results, add :ref:`AudioServer.get_time_since_last_mix` to the returned position. +\ **Note:** The position is not always accurate, as the :ref:`AudioServer` does not mix audio every processed frame. To get more accurate results, add :ref:`AudioServer.get_time_since_last_mix()` to the returned position. \ **Note:** This method always returns ``0.0`` if the :ref:`stream` is an :ref:`AudioStreamInteractive`, since it can have multiple clips playing at once. @@ -388,7 +388,7 @@ Returns the position in the :ref:`AudioStream` of the latest :ref:`AudioStreamPlayback` **get_stream_playback**\ (\ ) :ref:`πŸ”—` -Returns the latest :ref:`AudioStreamPlayback` of this node, usually the most recently created by :ref:`play`. If no sounds are playing, this method fails and returns an empty playback. +Returns the latest :ref:`AudioStreamPlayback` of this node, usually the most recently created by :ref:`play()`. If no sounds are playing, this method fails and returns an empty playback. .. rst-class:: classref-item-separator @@ -400,7 +400,7 @@ Returns the latest :ref:`AudioStreamPlayback` of this :ref:`bool` **has_stream_playback**\ (\ ) :ref:`πŸ”—` -Returns ``true`` if any sound is active, even if :ref:`stream_paused` is set to ``true``. See also :ref:`playing` and :ref:`get_stream_playback`. +Returns ``true`` if any sound is active, even if :ref:`stream_paused` is set to ``true``. See also :ref:`playing` and :ref:`get_stream_playback()`. .. rst-class:: classref-item-separator diff --git a/classes/class_audiostreamplayer2d.rst b/classes/class_audiostreamplayer2d.rst index 089af165b40..3224a44c76f 100644 --- a/classes/class_audiostreamplayer2d.rst +++ b/classes/class_audiostreamplayer2d.rst @@ -24,7 +24,7 @@ Description Plays audio that is attenuated with distance to the listener. -By default, audio is heard from the screen center. This can be changed by adding an :ref:`AudioListener2D` node to the scene and enabling it by calling :ref:`AudioListener2D.make_current` on it. +By default, audio is heard from the screen center. This can be changed by adding an :ref:`AudioListener2D` node to the scene and enabling it by calling :ref:`AudioListener2D.make_current()` on it. See also :ref:`AudioStreamPlayer` to play a sound non-positionally. @@ -291,7 +291,7 @@ The playback type of the stream player. If set other than to the default value, - |void| **set_playing**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_playing**\ (\ ) -If ``true``, audio is playing or is queued to be played (see :ref:`play`). +If ``true``, audio is playing or is queued to be played (see :ref:`play()`). .. rst-class:: classref-item-separator @@ -361,7 +361,7 @@ Base volume before attenuation, in decibels. Base volume before attenuation, as a linear value. -\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db` on a value. +\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear()` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db()` on a value. .. rst-class:: classref-section-separator diff --git a/classes/class_audiostreamplayer3d.rst b/classes/class_audiostreamplayer3d.rst index e6132685359..8fa5fba115c 100644 --- a/classes/class_audiostreamplayer3d.rst +++ b/classes/class_audiostreamplayer3d.rst @@ -24,7 +24,7 @@ Description Plays audio with positional sound effects, based on the relative position of the audio listener. Positional effects include distance attenuation, directionality, and the Doppler effect. For greater realism, a low-pass filter is applied to distant sounds. This can be disabled by setting :ref:`attenuation_filter_cutoff_hz` to ``20500``. -By default, audio is heard from the camera position. This can be changed by adding an :ref:`AudioListener3D` node to the scene and enabling it by calling :ref:`AudioListener3D.make_current` on it. +By default, audio is heard from the camera position. This can be changed by adding an :ref:`AudioListener3D` node to the scene and enabling it by calling :ref:`AudioListener3D.make_current()` on it. See also :ref:`AudioStreamPlayer` to play a sound non-positionally. @@ -507,7 +507,7 @@ The playback type of the stream player. If set other than to the default value, - |void| **set_playing**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_playing**\ (\ ) -If ``true``, audio is playing or is queued to be played (see :ref:`play`). +If ``true``, audio is playing or is queued to be played (see :ref:`play()`). .. rst-class:: classref-item-separator @@ -594,7 +594,7 @@ The base sound level before attenuation, in decibels. The base sound level before attenuation, as a linear value. -\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db` on a value. +\ **Note:** This member modifies :ref:`volume_db` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear()` on :ref:`volume_db`. Setting this member is equivalent to setting :ref:`volume_db` to the result of :ref:`@GlobalScope.linear_to_db()` on a value. .. rst-class:: classref-section-separator diff --git a/classes/class_audiostreampolyphonic.rst b/classes/class_audiostreampolyphonic.rst index 1ec8d7ccbd2..a1bb10c5f2c 100644 --- a/classes/class_audiostreampolyphonic.rst +++ b/classes/class_audiostreampolyphonic.rst @@ -21,7 +21,7 @@ Description AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. -Playback control is done via the :ref:`AudioStreamPlaybackPolyphonic` instance set inside the player, which can be obtained via :ref:`AudioStreamPlayer.get_stream_playback`, :ref:`AudioStreamPlayer2D.get_stream_playback` or :ref:`AudioStreamPlayer3D.get_stream_playback` methods. Obtaining the playback instance is only valid after the ``stream`` property is set as an **AudioStreamPolyphonic** in those players. +Playback control is done via the :ref:`AudioStreamPlaybackPolyphonic` instance set inside the player, which can be obtained via :ref:`AudioStreamPlayer.get_stream_playback()`, :ref:`AudioStreamPlayer2D.get_stream_playback()` or :ref:`AudioStreamPlayer3D.get_stream_playback()` methods. Obtaining the playback instance is only valid after the ``stream`` property is set as an **AudioStreamPolyphonic** in those players. .. rst-class:: classref-reftable-group diff --git a/classes/class_audiostreamsynchronized.rst b/classes/class_audiostreamsynchronized.rst index 9095e09e9e0..7d7052b756b 100644 --- a/classes/class_audiostreamsynchronized.rst +++ b/classes/class_audiostreamsynchronized.rst @@ -19,7 +19,7 @@ Stream that can be fitted with sub-streams, which will be played in-sync. Description ----------- -This is a stream that can be fitted with sub-streams, which will be played in-sync. The streams being at exactly the same time when play is pressed, and will end when the last of them ends. If one of the sub-streams loops, then playback will continue. +This is a stream that can be fitted with sub-streams, which will be played in-sync. The streams begin at exactly the same time when play is pressed, and will end when the last of them ends. If one of the sub-streams loops, then playback will continue. .. rst-class:: classref-reftable-group diff --git a/classes/class_audiostreamwav.rst b/classes/class_audiostreamwav.rst index 97cbb5cad5a..170651c4a77 100644 --- a/classes/class_audiostreamwav.rst +++ b/classes/class_audiostreamwav.rst @@ -62,13 +62,13 @@ Methods .. table:: :widths: auto - +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AudioStreamWAV` | :ref:`load_from_buffer`\ (\ buffer\: :ref:`PackedByteArray`, options\: :ref:`Dictionary` = {}\ ) |static| | - +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AudioStreamWAV` | :ref:`load_from_file`\ (\ path\: :ref:`String`, options\: :ref:`Dictionary` = {}\ ) |static| | - +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`save_to_wav`\ (\ path\: :ref:`String`\ ) | - +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AudioStreamWAV` | :ref:`load_from_buffer`\ (\ stream_data\: :ref:`PackedByteArray`, options\: :ref:`Dictionary` = {}\ ) |static| | + +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AudioStreamWAV` | :ref:`load_from_file`\ (\ path\: :ref:`String`, options\: :ref:`Dictionary` = {}\ ) |static| | + +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`save_to_wav`\ (\ path\: :ref:`String`\ ) | + +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -306,11 +306,11 @@ Method Descriptions .. rst-class:: classref-method -:ref:`AudioStreamWAV` **load_from_buffer**\ (\ buffer\: :ref:`PackedByteArray`, options\: :ref:`Dictionary` = {}\ ) |static| :ref:`πŸ”—` +:ref:`AudioStreamWAV` **load_from_buffer**\ (\ stream_data\: :ref:`PackedByteArray`, options\: :ref:`Dictionary` = {}\ ) |static| :ref:`πŸ”—` -Creates a new **AudioStreamWAV** instance from the given buffer. The keys and values of ``options`` match the properties of :ref:`ResourceImporterWAV`. +Creates a new **AudioStreamWAV** instance from the given buffer. The buffer must contain WAV data. -The usage of ``options`` is identical to :ref:`load_from_file`. +The keys and values of ``options`` match the properties of :ref:`ResourceImporterWAV`. The usage of ``options`` is identical to :ref:`load_from_file()`. .. rst-class:: classref-item-separator @@ -322,7 +322,9 @@ The usage of ``options`` is identical to :ref:`load_from_file` **load_from_file**\ (\ path\: :ref:`String`, options\: :ref:`Dictionary` = {}\ ) |static| :ref:`πŸ”—` -Creates a new **AudioStreamWAV** instance from the given file path. The keys and values of ``options`` match the properties of :ref:`ResourceImporterWAV`. +Creates a new **AudioStreamWAV** instance from the given file path. The file must be in WAV format. + +The keys and values of ``options`` match the properties of :ref:`ResourceImporterWAV`. \ **Example:** Load the first file dropped as a WAV and play it: diff --git a/classes/class_basebutton.rst b/classes/class_basebutton.rst index bfd8720ed98..e2a1c8513a2 100644 --- a/classes/class_basebutton.rst +++ b/classes/class_basebutton.rst @@ -288,7 +288,7 @@ To allow both left-click and right-click, use ``MOUSE_BUTTON_MASK_LEFT | MOUSE_B 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``. -\ **Note:** Changing the value of :ref:`button_pressed` will result in :ref:`toggled` to be emitted. If you want to change the pressed state without emitting that signal, use :ref:`set_pressed_no_signal`. +\ **Note:** Changing the value of :ref:`button_pressed` will result in :ref:`toggled` to be emitted. If you want to change the pressed state without emitting that signal, use :ref:`set_pressed_no_signal()`. .. rst-class:: classref-item-separator @@ -377,7 +377,7 @@ If ``true``, the button will highlight for a short amount of time when its short If ``true``, the button will add information about its shortcut in the tooltip. -\ **Note:** This property does nothing when the tooltip control is customized using :ref:`Control._make_custom_tooltip`. +\ **Note:** This property does nothing when the tooltip control is customized using :ref:`Control._make_custom_tooltip()`. .. rst-class:: classref-item-separator @@ -411,7 +411,7 @@ Method Descriptions |void| **_pressed**\ (\ ) |virtual| :ref:`πŸ”—` -Called when the button is pressed. If you need to know the button's pressed state (and :ref:`toggle_mode` is active), use :ref:`_toggled` instead. +Called when the button is pressed. If you need to know the button's pressed state (and :ref:`toggle_mode` is active), use :ref:`_toggled()` instead. .. rst-class:: classref-item-separator diff --git a/classes/class_basematerial3d.rst b/classes/class_basematerial3d.rst index 4c8bcfd14bc..8bd7edc80fc 100644 --- a/classes/class_basematerial3d.rst +++ b/classes/class_basematerial3d.rst @@ -2238,7 +2238,7 @@ If ``true``, the object is rendered at the same size regardless of distance. If ``true``, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and its :ref:`cull_mode` set to :ref:`CULL_FRONT`. See also :ref:`grow_amount`. -\ **Note:** Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively using `face weighted normals `__ in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh. +\ **Note:** Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively using `face weighted normals `__ in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh. .. rst-class:: classref-item-separator @@ -2596,7 +2596,7 @@ The strength of the normal map's effect. Texture used to specify the normal at a given pixel. The :ref:`normal_texture` only uses the red and green channels; the blue and alpha channels are ignored. The normal read from :ref:`normal_texture` is oriented around the surface normal provided by the :ref:`Mesh`. -\ **Note:** The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with :ref:`SurfaceTool`, you can use :ref:`SurfaceTool.generate_normals` and :ref:`SurfaceTool.generate_tangents` to automatically generate normals and tangents respectively. +\ **Note:** The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with :ref:`SurfaceTool`, you can use :ref:`SurfaceTool.generate_normals()` and :ref:`SurfaceTool.generate_tangents()` to automatically generate normals and tangents respectively. \ **Note:** Redot 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. diff --git a/classes/class_basis.rst b/classes/class_basis.rst index 2b9fe5d168e..ba8ee2132d6 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -19,7 +19,7 @@ Description The **Basis** built-in :ref:`Variant` type is a 3Γ—3 `matrix `__ used to represent 3D rotation, scale, and shear. It is frequently used within a :ref:`Transform3D`. -A **Basis** is composed by 3 axis vectors, each representing a column of the matrix: :ref:`x`, :ref:`y`, and :ref:`z`. The length of each axis (:ref:`Vector3.length`) influences the basis's scale, while the direction of all axes influence the rotation. Usually, these axes are perpendicular to one another. However, when you rotate any axis individually, the basis becomes sheared. Applying a sheared basis to a 3D model will make the model appear distorted. +A **Basis** is composed by 3 axis vectors, each representing a column of the matrix: :ref:`x`, :ref:`y`, and :ref:`z`. The length of each axis (:ref:`Vector3.length()`) influences the basis's scale, while the direction of all axes influence the rotation. Usually, these axes are perpendicular to one another. However, when you rotate any axis individually, the basis becomes sheared. Applying a sheared basis to a 3D model will make the model appear distorted. A **Basis** is: @@ -27,9 +27,9 @@ A **Basis** is: - **Normalized** if the length of every axis is ``1.0``. -- **Uniform** if all axes share the same length (see :ref:`get_scale`). +- **Uniform** if all axes share the same length (see :ref:`get_scale()`). -- **Orthonormal** if it is both orthogonal and normalized, which allows it to only represent rotations (see :ref:`orthonormalized`). +- **Orthonormal** if it is both orthogonal and normalized, which allows it to only represent rotations (see :ref:`orthonormalized()`). - **Conformal** if it is both orthogonal and uniform, which ensures it is not distorted. @@ -330,7 +330,7 @@ Constructs a **Basis** as a copy of the given **Basis**. Constructs a **Basis** that only represents rotation, rotated around the ``axis`` by the given ``angle``, in radians. The axis must be a normalized vector. -\ **Note:** This is the same as using :ref:`rotated` on the :ref:`IDENTITY` basis. With more than one angle consider using :ref:`from_euler`, instead. +\ **Note:** This is the same as using :ref:`rotated()` on the :ref:`IDENTITY` basis. With more than one angle consider using :ref:`from_euler()`, instead. .. rst-class:: classref-item-separator @@ -371,7 +371,7 @@ Method Descriptions Returns the `determinant `__ of this basis's matrix. For advanced math, this number can be used to determine a few attributes: -- If the determinant is exactly ``0.0``, the basis is not invertible (see :ref:`inverse`). +- If the determinant is exactly ``0.0``, the basis is not invertible (see :ref:`inverse()`). - If the determinant is a negative number, the basis represents a negative scale. @@ -414,7 +414,7 @@ Constructs a new **Basis** that only represents rotation from the given :ref:`Ve -The order of each consecutive rotation can be changed with ``order`` (see :ref:`EulerOrder` constants). By default, the YXZ convention is used (:ref:`@GlobalScope.EULER_ORDER_YXZ`): the basis rotates first around the Y axis (yaw), then X (pitch), and lastly Z (roll). When using the opposite method :ref:`get_euler`, this order is reversed. +The order of each consecutive rotation can be changed with ``order`` (see :ref:`EulerOrder` constants). By default, the YXZ convention is used (:ref:`@GlobalScope.EULER_ORDER_YXZ`): the basis rotates first around the Y axis (yaw), then X (pitch), and lastly Z (roll). When using the opposite method :ref:`get_euler()`, this order is reversed. .. rst-class:: classref-item-separator @@ -469,11 +469,11 @@ Returns this basis's rotation as a :ref:`Vector3` of `Euler angle - The :ref:`Vector3.z` contains the angle around the :ref:`z` axis (roll). -The order of each consecutive rotation can be changed with ``order`` (see :ref:`EulerOrder` constants). By default, the YXZ convention is used (:ref:`@GlobalScope.EULER_ORDER_YXZ`): Z (roll) is calculated first, then X (pitch), and lastly Y (yaw). When using the opposite method :ref:`from_euler`, this order is reversed. +The order of each consecutive rotation can be changed with ``order`` (see :ref:`EulerOrder` constants). By default, the YXZ convention is used (:ref:`@GlobalScope.EULER_ORDER_YXZ`): Z (roll) is calculated first, then X (pitch), and lastly Y (yaw). When using the opposite method :ref:`from_euler()`, this order is reversed. -\ **Note:** For this method to return correctly, the basis needs to be *orthonormal* (see :ref:`orthonormalized`). +\ **Note:** For this method to return correctly, the basis needs to be *orthonormal* (see :ref:`orthonormalized()`). -\ **Note:** Euler angles are much more intuitive but are not suitable for 3D math. Because of this, consider using the :ref:`get_rotation_quaternion` method instead, which returns a :ref:`Quaternion`. +\ **Note:** Euler angles are much more intuitive but are not suitable for 3D math. Because of this, consider using the :ref:`get_rotation_quaternion()` method instead, which returns a :ref:`Quaternion`. \ **Note:** In the Inspector dock, a basis's rotation is often displayed in Euler angles (in degrees), as is the case with the :ref:`Node3D.rotation` property. @@ -489,7 +489,7 @@ The order of each consecutive rotation can be changed with ``order`` (see :ref:` Returns this basis's rotation as a :ref:`Quaternion`. -\ **Note:** Quatenions are much more suitable for 3D math but are less intuitive. For user interfaces, consider using the :ref:`get_euler` method, which returns Euler angles. +\ **Note:** Quaternions are much more suitable for 3D math but are less intuitive. For user interfaces, consider using the :ref:`get_euler()` method, which returns Euler angles. .. rst-class:: classref-item-separator @@ -534,7 +534,7 @@ Returns the length of each axis of this basis, as a :ref:`Vector3 -\ **Note:** If the value returned by :ref:`determinant` is negative, the scale is also negative. +\ **Note:** If the value returned by :ref:`determinant()` is negative, the scale is also negative. .. rst-class:: classref-item-separator @@ -570,7 +570,7 @@ Returns ``true`` if this basis is conformal. A conformal basis is both *orthogon :ref:`bool` **is_equal_approx**\ (\ b\: :ref:`Basis`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this basis and ``b`` are approximately equal, by calling :ref:`@GlobalScope.is_equal_approx` on all vector components. +Returns ``true`` if this basis and ``b`` are approximately equal, by calling :ref:`@GlobalScope.is_equal_approx()` on all vector components. .. rst-class:: classref-item-separator @@ -582,7 +582,7 @@ Returns ``true`` if this basis and ``b`` are approximately equal, by calling :re :ref:`bool` **is_finite**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this basis is finite, by calling :ref:`@GlobalScope.is_finite` on all vector components. +Returns ``true`` if this basis is finite, by calling :ref:`@GlobalScope.is_finite()` on all vector components. .. rst-class:: classref-item-separator @@ -598,7 +598,9 @@ Creates a new **Basis** with a rotation such that the forward axis (-Z) points t By default, the -Z axis (camera forward) is treated as forward (implies +X is right). If ``use_model_front`` is ``true``, the +Z axis (asset front) is treated as forward (implies +X is left) and points toward the ``target`` position. -The up axis (+Y) points as close to the ``up`` vector as possible while staying perpendicular to the forward axis. The returned basis is orthonormalized (see :ref:`orthonormalized`). The ``target`` and ``up`` vectors cannot be :ref:`Vector3.ZERO`, and cannot be parallel to each other. +The up axis (+Y) points as close to the ``up`` vector as possible while staying perpendicular to the forward axis. The returned basis is orthonormalized (see :ref:`orthonormalized()`). + +The ``target`` and the ``up`` cannot be :ref:`Vector3.ZERO`, and shouldn't be colinear to avoid unintended rotation around local Z axis. .. rst-class:: classref-item-separator @@ -650,7 +652,7 @@ It is often useful to call this method to avoid rounding errors on a rotating ba Returns a copy of this basis rotated around the given ``axis`` by the given ``angle`` (in radians). -The ``axis`` must be a normalized vector (see :ref:`Vector3.normalized`). If ``angle`` is positive, the basis is rotated counter-clockwise around the axis. +The ``axis`` must be a normalized vector (see :ref:`Vector3.normalized()`). If ``angle`` is positive, the basis is rotated counter-clockwise around the axis. .. tabs:: @@ -755,7 +757,7 @@ Performs a spherical-linear interpolation with the ``to`` basis, given a ``weigh :ref:`float` **tdotx**\ (\ with\: :ref:`Vector3`\ ) |const| :ref:`πŸ”—` -Returns the transposed dot product between ``with`` and the :ref:`x` axis (see :ref:`transposed`). +Returns the transposed dot product between ``with`` and the :ref:`x` axis (see :ref:`transposed()`). This is equivalent to ``basis.x.dot(vector)``. @@ -769,7 +771,7 @@ This is equivalent to ``basis.x.dot(vector)``. :ref:`float` **tdoty**\ (\ with\: :ref:`Vector3`\ ) |const| :ref:`πŸ”—` -Returns the transposed dot product between ``with`` and the :ref:`y` axis (see :ref:`transposed`). +Returns the transposed dot product between ``with`` and the :ref:`y` axis (see :ref:`transposed()`). This is equivalent to ``basis.y.dot(vector)``. @@ -783,7 +785,7 @@ This is equivalent to ``basis.y.dot(vector)``. :ref:`float` **tdotz**\ (\ with\: :ref:`Vector3`\ ) |const| :ref:`πŸ”—` -Returns the transposed dot product between ``with`` and the :ref:`z` axis (see :ref:`transposed`). +Returns the transposed dot product between ``with`` and the :ref:`z` axis (see :ref:`transposed()`). This is equivalent to ``basis.z.dot(vector)``. @@ -847,7 +849,7 @@ Operator Descriptions Returns ``true`` if the components of both **Basis** matrices are not equal. -\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. rst-class:: classref-item-separator @@ -952,7 +954,7 @@ Divides all components of the **Basis** by the given :ref:`int`. This Returns ``true`` if the components of both **Basis** matrices are exactly equal. -\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. rst-class:: classref-item-separator diff --git a/classes/class_bitmap.rst b/classes/class_bitmap.rst index 4ca893127ec..bd6710b3dd9 100644 --- a/classes/class_bitmap.rst +++ b/classes/class_bitmap.rst @@ -156,7 +156,7 @@ Returns the number of bitmap elements that are set to ``true``. |void| **grow_mask**\ (\ pixels\: :ref:`int`, rect\: :ref:`Rect2i`\ ) :ref:`πŸ”—` -Applies morphological dilation or erosion to the bitmap. If ``pixels`` is positive, dilation is applied to the bitmap. If ``pixels`` is negative, erosion is applied to the bitmap. ``rect`` defines the area where the morphological operation is applied. Pixels located outside the ``rect`` are unaffected by :ref:`grow_mask`. +Applies morphological dilation or erosion to the bitmap. If ``pixels`` is positive, dilation is applied to the bitmap. If ``pixels`` is negative, erosion is applied to the bitmap. ``rect`` defines the area where the morphological operation is applied. Pixels located outside the ``rect`` are unaffected by :ref:`grow_mask()`. .. rst-class:: classref-item-separator diff --git a/classes/class_bone2d.rst b/classes/class_bone2d.rst index f13c36ac33f..a1eabe02f3b 100644 --- a/classes/class_bone2d.rst +++ b/classes/class_bone2d.rst @@ -23,7 +23,7 @@ A hierarchy of **Bone2D**\ s can be bound to a :ref:`Skeleton2D` nodes to animate 2D meshes created with the :ref:`Polygon2D` UV editor. -Each bone has a :ref:`rest` transform that you can reset to with :ref:`apply_rest`. These rest poses are relative to the bone's parent. +Each bone has a :ref:`rest` transform that you can reset to with :ref:`apply_rest()`. These rest poses are relative to the bone's parent. If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses. @@ -87,7 +87,7 @@ Property Descriptions - |void| **set_rest**\ (\ value\: :ref:`Transform2D`\ ) - :ref:`Transform2D` **get_rest**\ (\ ) -Rest transform of the bone. You can reset the node's transforms to this value using :ref:`apply_rest`. +Rest transform of the bone. You can reset the node's transforms to this value using :ref:`apply_rest()`. .. rst-class:: classref-section-separator diff --git a/classes/class_boneattachment3d.rst b/classes/class_boneattachment3d.rst index f006a15a40c..2197861aa3f 100644 --- a/classes/class_boneattachment3d.rst +++ b/classes/class_boneattachment3d.rst @@ -183,7 +183,7 @@ A function that is called automatically when the :ref:`Skeleton3D`\ ) :ref:`πŸ”—` -Sets the :ref:`NodePath` to the external skeleton that the BoneAttachment3D node should use. See :ref:`set_use_external_skeleton` to enable the external :ref:`Skeleton3D` node. +Sets the :ref:`NodePath` to the external skeleton that the BoneAttachment3D node should use. See :ref:`set_use_external_skeleton()` to enable the external :ref:`Skeleton3D` node. .. rst-class:: classref-item-separator @@ -195,7 +195,7 @@ Sets the :ref:`NodePath` to the external skeleton that the BoneA |void| **set_use_external_skeleton**\ (\ use_external_skeleton\: :ref:`bool`\ ) :ref:`πŸ”—` -Sets whether the BoneAttachment3D node will use an external :ref:`Skeleton3D` node rather than attempting to use its parent node as the :ref:`Skeleton3D`. When set to ``true``, the BoneAttachment3D node will use the external :ref:`Skeleton3D` node set in :ref:`set_external_skeleton`. +Sets whether the BoneAttachment3D node will use an external :ref:`Skeleton3D` node rather than attempting to use its parent node as the :ref:`Skeleton3D`. When set to ``true``, the BoneAttachment3D node will use the external :ref:`Skeleton3D` node set in :ref:`set_external_skeleton()`. .. |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_bool.rst b/classes/class_bool.rst index d8b4e0b19f9..85df5d84994 100644 --- a/classes/class_bool.rst +++ b/classes/class_bool.rst @@ -71,7 +71,7 @@ Booleans can be combined with the logical operators ``and``, ``or``, ``not`` to \ **Note:** In modern programming languages, logical operators are evaluated in order. All remaining conditions are skipped if their result would have no effect on the final value. This concept is known as `short-circuit evaluation `__ and can be useful to avoid evaluating expensive conditions in some performance-critical cases. -\ **Note:** By convention, built-in methods and properties that return booleans are usually defined as yes-no questions, single adjectives, or similar (:ref:`String.is_empty`, :ref:`Node.can_process`, :ref:`Camera2D.enabled`, etc.). +\ **Note:** By convention, built-in methods and properties that return booleans are usually defined as yes-no questions, single adjectives, or similar (:ref:`String.is_empty()`, :ref:`Node.can_process()`, :ref:`Camera2D.enabled`, etc.). .. rst-class:: classref-reftable-group diff --git a/classes/class_callable.rst b/classes/class_callable.rst index 7a027e9b2fc..9b60fe8b744 100644 --- a/classes/class_callable.rst +++ b/classes/class_callable.rst @@ -17,7 +17,7 @@ A built-in type representing a method or a standalone function. Description ----------- -**Callable** is a built-in :ref:`Variant` type that represents a function. It can either be a method within an :ref:`Object` instance, or a custom callable used for different purposes (see :ref:`is_custom`). Like all :ref:`Variant` types, it can be stored in variables and passed to other functions. It is most commonly used for signal callbacks. +**Callable** is a built-in :ref:`Variant` type that represents a function. It can either be a method within an :ref:`Object` instance, or a custom callable used for different purposes (see :ref:`is_custom()`). Like all :ref:`Variant` types, it can be stored in variables and passed to other functions. It is most commonly used for signal callbacks. .. tabs:: @@ -30,7 +30,7 @@ Description func test(): var callable = Callable(self, "print_args") callable.call("hello", "world") # Prints "hello world ". - callable.call(Vector2.UP, 42, callable) # Prints "(0.0, -1.0) 42 Node(node.gd)::print_args". + callable.call(Vector2.UP, 42, callable) # Prints "(0.0, -1.0) 42 Node(node.gd)::print_args" callable.call("invalid") # Invalid call, should have at least 2 arguments. .. code-tab:: csharp @@ -46,13 +46,13 @@ Description // Invalid calls fail silently. Callable callable = new Callable(this, MethodName.PrintArgs); callable.Call("hello", "world"); // Default parameter values are not supported, should have 3 arguments. - callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs". + callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs" callable.Call("invalid"); // Invalid call, should have 3 arguments. } -In GDScript, it's possible to create lambda functions within a method. Lambda functions are custom callables that are not associated with an :ref:`Object` instance. Optionally, lambda functions can also be named. The name will be displayed in the debugger, or when calling :ref:`get_method`. +In GDScript, it's possible to create lambda functions within a method. Lambda functions are custom callables that are not associated with an :ref:`Object` instance. Optionally, lambda functions can also be named. The name will be displayed in the debugger, or when calling :ref:`get_method()`. :: @@ -60,7 +60,7 @@ In GDScript, it's possible to create lambda functions within a method. Lambda fu var my_lambda = func (message): print(message) - # Prints Hello everyone! + # Prints "Hello everyone!" my_lambda.call("Hello everyone!") # Prints "Attack!", when the button_pressed signal is emitted. @@ -209,7 +209,7 @@ Constructs a **Callable** as a copy of the given **Callable**. Creates a new **Callable** for the method named ``method`` in the specified ``object``. -\ **Note:** For methods of built-in :ref:`Variant` types, use :ref:`create` instead. +\ **Note:** For methods of built-in :ref:`Variant` types, use :ref:`create()` instead. .. rst-class:: classref-section-separator @@ -226,7 +226,7 @@ Method Descriptions :ref:`Callable` **bind**\ (\ ...\ ) |vararg| |const| :ref:`πŸ”—` -Returns a copy of this **Callable** with one or more arguments bound. When called, the bound arguments are passed *after* the arguments supplied by :ref:`call`. See also :ref:`unbind`. +Returns a copy of this **Callable** with one or more arguments bound. When called, the bound arguments are passed *after* the arguments supplied by :ref:`call()`. See also :ref:`unbind()`. \ **Note:** When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. @@ -240,7 +240,7 @@ Returns a copy of this **Callable** with one or more arguments bound. When calle :ref:`Callable` **bindv**\ (\ arguments\: :ref:`Array`\ ) :ref:`πŸ”—` -Returns a copy of this **Callable** with one or more arguments bound, reading them from an array. When called, the bound arguments are passed *after* the arguments supplied by :ref:`call`. See also :ref:`unbind`. +Returns a copy of this **Callable** with one or more arguments bound, reading them from an array. When called, the bound arguments are passed *after* the arguments supplied by :ref:`call()`. See also :ref:`unbind()`. \ **Note:** When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. @@ -287,7 +287,7 @@ Calls the method represented by this **Callable** in deferred mode, i.e. at the \ **Note:** Deferred calls are processed at idle time. Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they'll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly. -See also :ref:`Object.call_deferred`. +See also :ref:`Object.call_deferred()`. .. rst-class:: classref-item-separator @@ -299,7 +299,7 @@ See also :ref:`Object.call_deferred`. :ref:`Variant` **callv**\ (\ arguments\: :ref:`Array`\ ) |const| :ref:`πŸ”—` -Calls the method represented by this **Callable**. Unlike :ref:`call`, this method expects all arguments to be contained inside the ``arguments`` :ref:`Array`. +Calls the method represented by this **Callable**. Unlike :ref:`call()`, this method expects all arguments to be contained inside the ``arguments`` :ref:`Array`. .. rst-class:: classref-item-separator @@ -311,7 +311,7 @@ Calls the method represented by this **Callable**. Unlike :ref:`call` **create**\ (\ variant\: :ref:`Variant`, method\: :ref:`StringName`\ ) |static| :ref:`πŸ”—` -Creates a new **Callable** for the method named ``method`` in the specified ``variant``. To represent a method of a built-in :ref:`Variant` type, a custom callable is used (see :ref:`is_custom`). If ``variant`` is :ref:`Object`, then a standard callable will be created instead. +Creates a new **Callable** for the method named ``method`` in the specified ``variant``. To represent a method of a built-in :ref:`Variant` type, a custom callable is used (see :ref:`is_custom()`). If ``variant`` is :ref:`Object`, then a standard callable will be created instead. \ **Note:** This method is always necessary for the :ref:`Dictionary` type, as property syntax is used to access its entries. You may also use this method when ``variant``'s type is not known in advance (for polymorphism). @@ -325,7 +325,7 @@ Creates a new **Callable** for the method named ``method`` in the specified ``va :ref:`int` **get_argument_count**\ (\ ) |const| :ref:`πŸ”—` -Returns the total number of arguments this **Callable** should take, including optional arguments. This means that any arguments bound with :ref:`bind` are *subtracted* from the result, and any arguments unbound with :ref:`unbind` are *added* to the result. +Returns the total number of arguments this **Callable** should take, including optional arguments. This means that any arguments bound with :ref:`bind()` are *subtracted* from the result, and any arguments unbound with :ref:`unbind()` are *added* to the result. .. rst-class:: classref-item-separator @@ -337,7 +337,7 @@ Returns the total number of arguments this **Callable** should take, including o :ref:`Array` **get_bound_arguments**\ (\ ) |const| :ref:`πŸ”—` -Returns the array of arguments bound via successive :ref:`bind` or :ref:`unbind` calls. These arguments will be added *after* the arguments passed to the call, from which :ref:`get_unbound_arguments_count` arguments on the right have been previously excluded. +Returns the array of arguments bound via successive :ref:`bind()` or :ref:`unbind()` calls. These arguments will be added *after* the arguments passed to the call, from which :ref:`get_unbound_arguments_count()` arguments on the right have been previously excluded. :: @@ -357,9 +357,9 @@ Returns the array of arguments bound via successive :ref:`bind` **get_bound_arguments_count**\ (\ ) |const| :ref:`πŸ”—` -Returns the total amount of arguments bound via successive :ref:`bind` or :ref:`unbind` calls. This is the same as the size of the array returned by :ref:`get_bound_arguments`. See :ref:`get_bound_arguments` for details. +Returns the total amount of arguments bound via successive :ref:`bind()` or :ref:`unbind()` calls. This is the same as the size of the array returned by :ref:`get_bound_arguments()`. See :ref:`get_bound_arguments()` for details. -\ **Note:** The :ref:`get_bound_arguments_count` and :ref:`get_unbound_arguments_count` methods can both return positive values. +\ **Note:** The :ref:`get_bound_arguments_count()` and :ref:`get_unbound_arguments_count()` methods can both return positive values. .. rst-class:: classref-item-separator @@ -395,7 +395,7 @@ Returns the object on which this **Callable** is called. :ref:`int` **get_object_id**\ (\ ) |const| :ref:`πŸ”—` -Returns the ID of this **Callable**'s object (see :ref:`Object.get_instance_id`). +Returns the ID of this **Callable**'s object (see :ref:`Object.get_instance_id()`). .. rst-class:: classref-item-separator @@ -407,9 +407,9 @@ Returns the ID of this **Callable**'s object (see :ref:`Object.get_instance_id` **get_unbound_arguments_count**\ (\ ) |const| :ref:`πŸ”—` -Returns the total amount of arguments unbound via successive :ref:`bind` or :ref:`unbind` calls. See :ref:`get_bound_arguments` for details. +Returns the total amount of arguments unbound via successive :ref:`bind()` or :ref:`unbind()` calls. See :ref:`get_bound_arguments()` for details. -\ **Note:** The :ref:`get_bound_arguments_count` and :ref:`get_unbound_arguments_count` methods can both return positive values. +\ **Note:** The :ref:`get_bound_arguments_count()` and :ref:`get_unbound_arguments_count()` methods can both return positive values. .. rst-class:: classref-item-separator @@ -423,7 +423,7 @@ Returns the total amount of arguments unbound via successive :ref:`bind`. +\ **Note:** **Callable**\ s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the callables are equal, because different callables can have identical hash values due to hash collisions. The engine uses a 32-bit hash algorithm for :ref:`hash()`. .. rst-class:: classref-item-separator @@ -437,9 +437,9 @@ Returns the 32-bit hash value of this **Callable**'s object. Returns ``true`` if this **Callable** is a custom callable. Custom callables are used: -- for binding/unbinding arguments (see :ref:`bind` and :ref:`unbind`); +- for binding/unbinding arguments (see :ref:`bind()` and :ref:`unbind()`); -- for representing methods of built-in :ref:`Variant` types (see :ref:`create`); +- for representing methods of built-in :ref:`Variant` types (see :ref:`create()`); - for representing global, lambda, and RPC functions in GDScript; @@ -457,7 +457,7 @@ Returns ``true`` if this **Callable** is a custom callable. Custom callables are Returns ``true`` if this **Callable** has no target to call the method on. Equivalent to ``callable == Callable()``. -\ **Note:** This is *not* the same as ``not is_valid()`` and using ``not is_null()`` will *not* guarantee that this callable can be called. Use :ref:`is_valid` instead. +\ **Note:** This is *not* the same as ``not is_valid()`` and using ``not is_null()`` will *not* guarantee that this callable can be called. Use :ref:`is_valid()` instead. .. rst-class:: classref-item-separator @@ -469,7 +469,7 @@ Returns ``true`` if this **Callable** has no target to call the method on. Equiv :ref:`bool` **is_standard**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this **Callable** is a standard callable. This method is the opposite of :ref:`is_custom`. Returns ``false`` if this callable is a lambda function. +Returns ``true`` if this **Callable** is a standard callable. This method is the opposite of :ref:`is_custom()`. Returns ``false`` if this callable is a lambda function. .. rst-class:: classref-item-separator @@ -493,7 +493,7 @@ Returns ``true`` if the callable's object exists and has a valid method name ass |void| **rpc**\ (\ ...\ ) |vararg| |const| :ref:`πŸ”—` -Perform an RPC (Remote Procedure Call) on all connected peers. This is used for multiplayer and is normally not available, unless the function being called has been marked as *RPC* (using :ref:`@GDScript.@rpc` or :ref:`Node.rpc_config`). Calling this method on unsupported functions will result in an error. See :ref:`Node.rpc`. +Perform an RPC (Remote Procedure Call) on all connected peers. This is used for multiplayer and is normally not available, unless the function being called has been marked as *RPC* (using :ref:`@GDScript.@rpc` or :ref:`Node.rpc_config()`). Calling this method on unsupported functions will result in an error. See :ref:`Node.rpc()`. .. rst-class:: classref-item-separator @@ -505,7 +505,7 @@ Perform an RPC (Remote Procedure Call) on all connected peers. This is used for |void| **rpc_id**\ (\ peer_id\: :ref:`int`, ...\ ) |vararg| |const| :ref:`πŸ”—` -Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as *RPC* (using :ref:`@GDScript.@rpc` or :ref:`Node.rpc_config`). Calling this method on unsupported functions will result in an error. See :ref:`Node.rpc_id`. +Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as *RPC* (using :ref:`@GDScript.@rpc` or :ref:`Node.rpc_config()`). Calling this method on unsupported functions will result in an error. See :ref:`Node.rpc_id()`. .. rst-class:: classref-item-separator @@ -517,7 +517,7 @@ Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer do :ref:`Callable` **unbind**\ (\ argcount\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns a copy of this **Callable** with a number of arguments unbound. In other words, when the new callable is called the last few arguments supplied by the user are ignored, according to ``argcount``. The remaining arguments are passed to the callable. This allows to use the original callable in a context that attempts to pass more arguments than this callable can handle, e.g. a signal with a fixed number of arguments. See also :ref:`bind`. +Returns a copy of this **Callable** with a number of arguments unbound. In other words, when the new callable is called the last few arguments supplied by the user are ignored, according to ``argcount``. The remaining arguments are passed to the callable. This allows to use the original callable in a context that attempts to pass more arguments than this callable can handle, e.g. a signal with a fixed number of arguments. See also :ref:`bind()`. \ **Note:** When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. diff --git a/classes/class_callbacktweener.rst b/classes/class_callbacktweener.rst index 3a4a337c54b..209798c7fb2 100644 --- a/classes/class_callbacktweener.rst +++ b/classes/class_callbacktweener.rst @@ -19,11 +19,11 @@ Calls the specified method after optional delay. Description ----------- -**CallbackTweener** is used to call a method in a tweening sequence. See :ref:`Tween.tween_callback` for more usage information. +**CallbackTweener** is used to call a method in a tweening sequence. See :ref:`Tween.tween_callback()` for more usage information. The tweener will finish automatically if the callback's target object is freed. -\ **Note:** :ref:`Tween.tween_callback` is the only correct way to create **CallbackTweener**. Any **CallbackTweener** created manually will not function correctly. +\ **Note:** :ref:`Tween.tween_callback()` is the only correct way to create **CallbackTweener**. Any **CallbackTweener** created manually will not function correctly. .. rst-class:: classref-reftable-group @@ -54,7 +54,7 @@ Method Descriptions Makes the callback call delayed by given time in seconds. -\ **Example:** Call :ref:`Node.queue_free` after 2 seconds: +\ **Example:** Call :ref:`Node.queue_free()` after 2 seconds: :: diff --git a/classes/class_camera2d.rst b/classes/class_camera2d.rst index f8ccb5c3ae0..61e9bfb4bfb 100644 --- a/classes/class_camera2d.rst +++ b/classes/class_camera2d.rst @@ -23,9 +23,9 @@ Camera node for 2D scenes. It forces the screen (current layer) to scroll follow Cameras register themselves in the nearest :ref:`Viewport` node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. -This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from :ref:`Node2D` and change the transform of the canvas by setting :ref:`Viewport.canvas_transform` in :ref:`Viewport` (you can obtain the current :ref:`Viewport` by using :ref:`Node.get_viewport`). +This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from :ref:`Node2D` and change the transform of the canvas by setting :ref:`Viewport.canvas_transform` in :ref:`Viewport` (you can obtain the current :ref:`Viewport` by using :ref:`Node.get_viewport()`). -Note that the **Camera2D** node's ``position`` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use :ref:`get_screen_center_position` to get the real position. +Note that the **Camera2D** node's ``position`` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use :ref:`get_screen_center_position()` to get the real position. .. rst-class:: classref-introduction-group @@ -434,7 +434,7 @@ If ``true``, draws the camera's screen rectangle in the editor. - |void| **set_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_enabled**\ (\ ) -Controls whether the camera can be active or not. If ``true``, the **Camera2D** will become the main camera when it enters the scene tree and there is no active camera currently (see :ref:`Viewport.get_camera_2d`). +Controls whether the camera can be active or not. If ``true``, the **Camera2D** will become the main camera when it enters the scene tree and there is no active camera currently (see :ref:`Viewport.get_camera_2d()`). When the camera is currently active and :ref:`enabled` is set to ``false``, the next enabled **Camera2D** in the scene tree will become active. @@ -525,7 +525,7 @@ If ``true``, the camera smoothly stops when reaches its limits. 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`. +\ **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke :ref:`reset_smoothing()`. .. rst-class:: classref-item-separator @@ -732,7 +732,7 @@ Returns the camera limit for the specified :ref:`Side`. Returns the center of the screen from this camera's point of view, in global coordinates. -\ **Note:** The exact targeted position of the camera may be different. See :ref:`get_target_position`. +\ **Note:** The exact targeted position of the camera may be different. See :ref:`get_target_position()`. .. rst-class:: classref-item-separator @@ -746,7 +746,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:`position_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()`). .. rst-class:: classref-item-separator @@ -758,7 +758,7 @@ Returns this camera's target position, in global coordinates. :ref:`bool` **is_current**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this **Camera2D** is the active camera (see :ref:`Viewport.get_camera_2d`). +Returns ``true`` if this **Camera2D** is the active camera (see :ref:`Viewport.get_camera_2d()`). .. rst-class:: classref-item-separator diff --git a/classes/class_camera3d.rst b/classes/class_camera3d.rst index a3649be8a13..f19c449d5e7 100644 --- a/classes/class_camera3d.rst +++ b/classes/class_camera3d.rst @@ -275,7 +275,7 @@ The culling mask that describes which :ref:`VisualInstance3D.layers` allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting :ref:`cull_mask` using a script allows you to toggle those reserved layers, which can be useful for editor plugins. -To adjust :ref:`cull_mask` more easily using a script, use :ref:`get_cull_mask_value` and :ref:`set_cull_mask_value`. +To adjust :ref:`cull_mask` more easily using a script, use :ref:`get_cull_mask_value()` and :ref:`set_cull_mask_value()`. \ **Note:** :ref:`VoxelGI`, SDFGI and :ref:`LightmapGI` will always take all layers into account to determine what contributes to global illumination. If this is an issue, set :ref:`GeometryInstance3D.gi_mode` to :ref:`GeometryInstance3D.GI_MODE_DISABLED` for meshes and :ref:`Light3D.light_bake_mode` to :ref:`Light3D.BAKE_DISABLED` for lights to exclude them from global illumination. @@ -732,7 +732,7 @@ Sets the camera projection to perspective mode (see :ref:`PROJECTION_PERSPECTIVE Returns the 2D coordinate in the :ref:`Viewport` rectangle that maps to the given 3D point in world space. -\ **Note:** When using this to position GUI elements over a 3D viewport, use :ref:`is_position_behind` to prevent them from appearing if the 3D point is behind the camera: +\ **Note:** When using this to position GUI elements over a 3D viewport, use :ref:`is_position_behind()` to prevent them from appearing if the 3D point is behind the camera: :: diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index 54e0b6f33e8..e4b59bba6d3 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -23,7 +23,7 @@ Description Abstract base class for everything in 2D space. Canvas items are laid out in a tree; children inherit and extend their parent's transform. **CanvasItem** is extended by :ref:`Control` for GUI-related nodes, and by :ref:`Node2D` for 2D game objects. -Any **CanvasItem** can draw. For this, :ref:`queue_redraw` is called by the engine, then :ref:`NOTIFICATION_DRAW` will be received on idle time to request a redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the **CanvasItem** are provided (see ``draw_*`` functions). However, they can only be used inside :ref:`_draw`, its corresponding :ref:`Object._notification` or methods connected to the :ref:`draw` signal. +Any **CanvasItem** can draw. For this, :ref:`queue_redraw()` is called by the engine, then :ref:`NOTIFICATION_DRAW` will be received on idle time to request a redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the **CanvasItem** are provided (see ``draw_*`` functions). However, they can only be used inside :ref:`_draw()`, its corresponding :ref:`Object._notification()` or methods connected to the :ref:`draw` signal. Canvas items are drawn in tree order on their canvas layer. By default, children are on top of their parents, so a root **CanvasItem** will be drawn behind everything. This behavior can be changed on a per-item basis. @@ -227,7 +227,7 @@ Signals **draw**\ (\ ) :ref:`πŸ”—` -Emitted when the **CanvasItem** must redraw, *after* the related :ref:`NOTIFICATION_DRAW` notification, and *before* :ref:`_draw` is called. +Emitted when the **CanvasItem** must redraw, *after* the related :ref:`NOTIFICATION_DRAW` notification, and *before* :ref:`_draw()` is called. \ **Note:** Deferred connections do not allow drawing through the ``draw_*`` methods. @@ -241,7 +241,7 @@ Emitted when the **CanvasItem** must redraw, *after* the related :ref:`NOTIFICAT **hidden**\ (\ ) :ref:`πŸ”—` -Emitted when the **CanvasItem** is hidden, i.e. it's no longer visible in the tree (see :ref:`is_visible_in_tree`). +Emitted when the **CanvasItem** is hidden, i.e. it's no longer visible in the tree (see :ref:`is_visible_in_tree()`). .. rst-class:: classref-item-separator @@ -265,7 +265,7 @@ Emitted when the **CanvasItem**'s boundaries (position or size) change, or when **visibility_changed**\ (\ ) :ref:`πŸ”—` -Emitted when the **CanvasItem**'s visibility changes, either because its own :ref:`visible` property changed or because its visibility in the tree changed (see :ref:`is_visible_in_tree`). +Emitted when the **CanvasItem**'s visibility changes, either because its own :ref:`visible` property changed or because its visibility in the tree changed (see :ref:`is_visible_in_tree()`). .. rst-class:: classref-section-separator @@ -461,7 +461,7 @@ Constants **NOTIFICATION_TRANSFORM_CHANGED** = ``2000`` :ref:`πŸ”—` -The **CanvasItem**'s global transform has changed. This notification is only received if enabled by :ref:`set_notify_transform`. +The **CanvasItem**'s global transform has changed. This notification is only received if enabled by :ref:`set_notify_transform()`. .. _class_CanvasItem_constant_NOTIFICATION_LOCAL_TRANSFORM_CHANGED: @@ -469,7 +469,7 @@ The **CanvasItem**'s global transform has changed. This notification is only rec **NOTIFICATION_LOCAL_TRANSFORM_CHANGED** = ``35`` :ref:`πŸ”—` -The **CanvasItem**'s local transform has changed. This notification is only received if enabled by :ref:`set_notify_local_transform`. +The **CanvasItem**'s local transform has changed. This notification is only received if enabled by :ref:`set_notify_local_transform()`. .. _class_CanvasItem_constant_NOTIFICATION_DRAW: @@ -477,7 +477,7 @@ The **CanvasItem**'s local transform has changed. This notification is only rece **NOTIFICATION_DRAW** = ``30`` :ref:`πŸ”—` -The **CanvasItem** is requested to draw (see :ref:`_draw`). +The **CanvasItem** is requested to draw (see :ref:`_draw()`). .. _class_CanvasItem_constant_NOTIFICATION_VISIBILITY_CHANGED: @@ -603,7 +603,7 @@ The color applied to this **CanvasItem**. This property does affect child **Canv The color applied to this **CanvasItem**. This property does **not** affect child **CanvasItem**\ s, unlike :ref:`modulate` which affects both the node itself and its children. -\ **Note:** Internal children (e.g. sliders in :ref:`ColorPicker` or tab bar in :ref:`TabContainer`) are also not affected by this property (see ``include_internal`` parameter of :ref:`Node.get_child` and other similar methods). +\ **Note:** Internal children (e.g. sliders in :ref:`ColorPicker` or tab bar in :ref:`TabContainer`) are also not affected by this property (see ``include_internal`` parameter of :ref:`Node.get_child()` and other similar methods). .. rst-class:: classref-item-separator @@ -722,7 +722,7 @@ The rendering layer in which this **CanvasItem** is rendered by :ref:`Viewport`\ ) - :ref:`bool` **is_visible**\ (\ ) -If ``true``, this **CanvasItem** may be drawn. Whether this **CanvasItem** is actually drawn depends on the visibility of all of its **CanvasItem** ancestors. In other words: this **CanvasItem** will be drawn when :ref:`is_visible_in_tree` returns ``true`` and all **CanvasItem** ancestors share at least one :ref:`visibility_layer` with this **CanvasItem**. +If ``true``, this **CanvasItem** may be drawn. Whether this **CanvasItem** is actually drawn depends on the visibility of all of its **CanvasItem** ancestors. In other words: this **CanvasItem** will be drawn when :ref:`is_visible_in_tree()` returns ``true`` and all **CanvasItem** ancestors share at least one :ref:`visibility_layer` with this **CanvasItem**. \ **Note:** For controls that inherit :ref:`Popup`, the correct way to make them visible is to call one of the multiple ``popup*()`` functions instead. @@ -798,9 +798,9 @@ Method Descriptions |void| **_draw**\ (\ ) |virtual| :ref:`πŸ”—` -Called when **CanvasItem** has been requested to redraw (after :ref:`queue_redraw` is called, either manually or by the engine). +Called when **CanvasItem** has been requested to redraw (after :ref:`queue_redraw()` is called, either manually or by the engine). -Corresponds to the :ref:`NOTIFICATION_DRAW` notification in :ref:`Object._notification`. +Corresponds to the :ref:`NOTIFICATION_DRAW` notification in :ref:`Object._notification()`. .. rst-class:: classref-item-separator @@ -824,7 +824,7 @@ Subsequent drawing commands will be ignored unless they fall within the specifie |void| **draw_arc**\ (\ center\: :ref:`Vector2`, radius\: :ref:`float`, start_angle\: :ref:`float`, end_angle\: :ref:`float`, point_count\: :ref:`int`, color\: :ref:`Color`, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws an unfilled arc between the given angles with a uniform ``color`` and ``width`` and optional antialiasing (supported only for positive ``width``). The larger the value of ``point_count``, the smoother the curve. See also :ref:`draw_circle`. +Draws an unfilled arc between the given angles with a uniform ``color`` and ``width`` and optional antialiasing (supported only for positive ``width``). The larger the value of ``point_count``, the smoother the curve. See also :ref:`draw_circle()`. If ``width`` is negative, it will be ignored and the arc will be drawn using :ref:`RenderingServer.PRIMITIVE_LINE_STRIP`. This means that when the CanvasItem is scaled, the arc will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -864,7 +864,7 @@ Draws a string first character outline using a custom font. |void| **draw_circle**\ (\ position\: :ref:`Vector2`, radius\: :ref:`float`, color\: :ref:`Color`, filled\: :ref:`bool` = true, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws a circle. See also :ref:`draw_arc`, :ref:`draw_polyline`, and :ref:`draw_polygon`. +Draws a circle. See also :ref:`draw_arc()`, :ref:`draw_polyline()`, and :ref:`draw_polygon()`. If ``filled`` is ``true``, the circle will be filled with the ``color`` specified. If ``filled`` is ``false``, the circle will be drawn as a stroke with the ``color`` and ``width`` specified. @@ -884,9 +884,9 @@ If ``antialiased`` is ``true``, half transparent "feathers" will be attached to |void| **draw_colored_polygon**\ (\ points\: :ref:`PackedVector2Array`, color\: :ref:`Color`, uvs\: :ref:`PackedVector2Array` = PackedVector2Array(), texture\: :ref:`Texture2D` = null\ ) :ref:`πŸ”—` -Draws a colored polygon of any number of points, convex or concave. Unlike :ref:`draw_polygon`, a single color must be specified for the whole polygon. +Draws a colored polygon of any number of points, convex or concave. Unlike :ref:`draw_polygon()`, a single color must be specified for the whole polygon. -\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon` and using :ref:`draw_mesh`, :ref:`draw_multimesh`, or :ref:`RenderingServer.canvas_item_add_triangle_array`. +\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon()` and using :ref:`draw_mesh()`, :ref:`draw_multimesh()`, or :ref:`RenderingServer.canvas_item_add_triangle_array()`. .. rst-class:: classref-item-separator @@ -898,10 +898,12 @@ Draws a colored polygon of any number of points, convex or concave. Unlike :ref: |void| **draw_dashed_line**\ (\ from\: :ref:`Vector2`, to\: :ref:`Vector2`, color\: :ref:`Color`, width\: :ref:`float` = -1.0, dash\: :ref:`float` = 2.0, aligned\: :ref:`bool` = true, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws a dashed line from a 2D point to another, with a given color and width. See also :ref:`draw_multiline` and :ref:`draw_polyline`. +Draws a dashed line from a 2D point to another, with a given color and width. See also :ref:`draw_line()`, :ref:`draw_multiline()`, and :ref:`draw_polyline()`. If ``width`` is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. +\ ``dash`` is the length of each dash in pixels, with the gap between each dash being the same length. If ``aligned`` is ``true``, the length of the first and last dashes may be shortened or lengthened to allow the line to begin and end at the precise points defined by ``from`` and ``to``. Both ends are always symmetrical when ``aligned`` is ``true``. If ``aligned`` is ``false``, all dashes will have the same length, but the line may appear incomplete at the end due to the dash length not dividing evenly into the line length. Only full dashes are drawn when ``aligned`` is ``false``. + If ``antialiased`` is ``true``, half transparent "feathers" will be attached to the boundary, making outlines smooth. \ **Note:** ``antialiased`` is only effective if ``width`` is greater than ``0.0``. @@ -916,7 +918,7 @@ If ``antialiased`` is ``true``, half transparent "feathers" will be attached to |void| **draw_end_animation**\ (\ ) :ref:`πŸ”—` -After submitting all animations slices via :ref:`draw_animation_slice`, this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required. +After submitting all animations slices via :ref:`draw_animation_slice()`, this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required. .. rst-class:: classref-item-separator @@ -949,7 +951,7 @@ Texture is drawn using the following blend operation, blend mode of the :ref:`Ca |void| **draw_line**\ (\ from\: :ref:`Vector2`, to\: :ref:`Vector2`, color\: :ref:`Color`, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also :ref:`draw_multiline` and :ref:`draw_polyline`. +Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also :ref:`draw_dashed_line()`, :ref:`draw_multiline()`, and :ref:`draw_polyline()`. If ``width`` is negative, then a two-point primitive will be drawn instead of a four-point one. This means that when the CanvasItem is scaled, the line will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -991,7 +993,7 @@ Value of the ``pixel_range`` should the same that was used during distance field |void| **draw_multiline**\ (\ points\: :ref:`PackedVector2Array`, color\: :ref:`Color`, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws multiple disconnected lines with a uniform ``width`` and ``color``. Each line is defined by two consecutive points from ``points`` array, i.e. i-th segment consists of ``points[2 * i]``, ``points[2 * i + 1]`` endpoints. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline` instead. +Draws multiple disconnected lines with a uniform ``width`` and ``color``. Each line is defined by two consecutive points from ``points`` array, i.e. i-th segment consists of ``points[2 * i]``, ``points[2 * i + 1]`` endpoints. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line()` calls. To draw interconnected lines, use :ref:`draw_polyline()` instead. If ``width`` is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -1007,7 +1009,7 @@ If ``width`` is negative, then two-point primitives will be drawn instead of a f |void| **draw_multiline_colors**\ (\ points\: :ref:`PackedVector2Array`, colors\: :ref:`PackedColorArray`, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws multiple disconnected lines with a uniform ``width`` and segment-by-segment coloring. Each segment is defined by two consecutive points from ``points`` array and a corresponding color from ``colors`` array, i.e. i-th segment consists of ``points[2 * i]``, ``points[2 * i + 1]`` endpoints and has ``colors[i]`` color. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline_colors` instead. +Draws multiple disconnected lines with a uniform ``width`` and segment-by-segment coloring. Each segment is defined by two consecutive points from ``points`` array and a corresponding color from ``colors`` array, i.e. i-th segment consists of ``points[2 * i]``, ``points[2 * i + 1]`` endpoints and has ``colors[i]`` color. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line()` calls. To draw interconnected lines, use :ref:`draw_polyline_colors()` instead. If ``width`` is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -1059,9 +1061,9 @@ Draws a :ref:`MultiMesh` in 2D with the provided texture. See : |void| **draw_polygon**\ (\ points\: :ref:`PackedVector2Array`, colors\: :ref:`PackedColorArray`, uvs\: :ref:`PackedVector2Array` = PackedVector2Array(), texture\: :ref:`Texture2D` = null\ ) :ref:`πŸ”—` -Draws a solid polygon of any number of points, convex or concave. Unlike :ref:`draw_colored_polygon`, each point's color can be changed individually. See also :ref:`draw_polyline` and :ref:`draw_polyline_colors`. If you need more flexibility (such as being able to use bones), use :ref:`RenderingServer.canvas_item_add_triangle_array` instead. +Draws a solid polygon of any number of points, convex or concave. Unlike :ref:`draw_colored_polygon()`, each point's color can be changed individually. See also :ref:`draw_polyline()` and :ref:`draw_polyline_colors()`. If you need more flexibility (such as being able to use bones), use :ref:`RenderingServer.canvas_item_add_triangle_array()` instead. -\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon` and using :ref:`draw_mesh`, :ref:`draw_multimesh`, or :ref:`RenderingServer.canvas_item_add_triangle_array`. +\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon()` and using :ref:`draw_mesh()`, :ref:`draw_multimesh()`, or :ref:`RenderingServer.canvas_item_add_triangle_array()`. .. rst-class:: classref-item-separator @@ -1073,7 +1075,7 @@ Draws a solid polygon of any number of points, convex or concave. Unlike :ref:`d |void| **draw_polyline**\ (\ points\: :ref:`PackedVector2Array`, color\: :ref:`Color`, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws interconnected line segments with a uniform ``color`` and ``width`` and optional antialiasing (supported only for positive ``width``). When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline` instead. See also :ref:`draw_polygon`. +Draws interconnected line segments with a uniform ``color`` and ``width`` and optional antialiasing (supported only for positive ``width``). When drawing large amounts of lines, this is faster than using individual :ref:`draw_line()` calls. To draw disconnected lines, use :ref:`draw_multiline()` instead. See also :ref:`draw_polygon()`. If ``width`` is negative, it will be ignored and the polyline will be drawn using :ref:`RenderingServer.PRIMITIVE_LINE_STRIP`. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -1087,7 +1089,7 @@ If ``width`` is negative, it will be ignored and the polyline will be drawn usin |void| **draw_polyline_colors**\ (\ points\: :ref:`PackedVector2Array`, colors\: :ref:`PackedColorArray`, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws interconnected line segments with a uniform ``width``, point-by-point coloring, and optional antialiasing (supported only for positive ``width``). Colors assigned to line points match by index between ``points`` and ``colors``, i.e. each line segment is filled with a gradient between the colors of the endpoints. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline_colors` instead. See also :ref:`draw_polygon`. +Draws interconnected line segments with a uniform ``width``, point-by-point coloring, and optional antialiasing (supported only for positive ``width``). Colors assigned to line points match by index between ``points`` and ``colors``, i.e. each line segment is filled with a gradient between the colors of the endpoints. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line()` calls. To draw disconnected lines, use :ref:`draw_multiline_colors()` instead. See also :ref:`draw_polygon()`. If ``width`` is negative, it will be ignored and the polyline will be drawn using :ref:`RenderingServer.PRIMITIVE_LINE_STRIP`. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -1101,7 +1103,7 @@ If ``width`` is negative, it will be ignored and the polyline will be drawn usin |void| **draw_primitive**\ (\ points\: :ref:`PackedVector2Array`, colors\: :ref:`PackedColorArray`, uvs\: :ref:`PackedVector2Array`, texture\: :ref:`Texture2D` = null\ ) :ref:`πŸ”—` -Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also :ref:`draw_line`, :ref:`draw_polyline`, :ref:`draw_polygon`, and :ref:`draw_rect`. +Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also :ref:`draw_line()`, :ref:`draw_polyline()`, :ref:`draw_polygon()`, and :ref:`draw_rect()`. .. rst-class:: classref-item-separator @@ -1113,7 +1115,7 @@ Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for |void| **draw_rect**\ (\ rect\: :ref:`Rect2`, color\: :ref:`Color`, filled\: :ref:`bool` = true, width\: :ref:`float` = -1.0, antialiased\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws a rectangle. If ``filled`` is ``true``, the rectangle will be filled with the ``color`` specified. If ``filled`` is ``false``, the rectangle will be drawn as a stroke with the ``color`` and ``width`` specified. See also :ref:`draw_texture_rect`. +Draws a rectangle. If ``filled`` is ``true``, the rectangle will be filled with the ``color`` specified. If ``filled`` is ``false``, the rectangle will be drawn as a stroke with the ``color`` and ``width`` specified. See also :ref:`draw_texture_rect()`. If ``width`` is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. @@ -1186,7 +1188,7 @@ Draws ``text`` using the specified ``font`` at the ``pos`` (bottom-left corner u -See also :ref:`Font.draw_string`. +See also :ref:`Font.draw_string()`. .. rst-class:: classref-item-separator @@ -1234,7 +1236,7 @@ Draws a texture at a given position. |void| **draw_texture_rect**\ (\ texture\: :ref:`Texture2D`, rect\: :ref:`Rect2`, tile\: :ref:`bool`, modulate\: :ref:`Color` = Color(1, 1, 1, 1), transpose\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Draws a textured rectangle at a given position, optionally modulated by a color. If ``transpose`` is ``true``, the texture will have its X and Y coordinates swapped. See also :ref:`draw_rect` and :ref:`draw_texture_rect_region`. +Draws a textured rectangle at a given position, optionally modulated by a color. If ``transpose`` is ``true``, the texture will have its X and Y coordinates swapped. See also :ref:`draw_rect()` and :ref:`draw_texture_rect_region()`. .. rst-class:: classref-item-separator @@ -1246,7 +1248,7 @@ Draws a textured rectangle at a given position, optionally modulated by a color. |void| **draw_texture_rect_region**\ (\ texture\: :ref:`Texture2D`, rect\: :ref:`Rect2`, src_rect\: :ref:`Rect2`, modulate\: :ref:`Color` = Color(1, 1, 1, 1), transpose\: :ref:`bool` = false, clip_uv\: :ref:`bool` = true\ ) :ref:`πŸ”—` -Draws a textured rectangle from a texture's region (specified by ``src_rect``) at a given position, optionally modulated by a color. If ``transpose`` is ``true``, the texture will have its X and Y coordinates swapped. See also :ref:`draw_texture_rect`. +Draws a textured rectangle from a texture's region (specified by ``src_rect``) at a given position, optionally modulated by a color. If ``transpose`` is ``true``, the texture will have its X and Y coordinates swapped. See also :ref:`draw_texture_rect()`. .. rst-class:: classref-item-separator @@ -1320,7 +1322,7 @@ Returns the transform from the coordinate system of the canvas, this item is in, Returns the mouse's position in the :ref:`CanvasLayer` that this **CanvasItem** is in using the coordinate system of the :ref:`CanvasLayer`. -\ **Note:** For screen-space coordinates (e.g. when using a non-embedded :ref:`Popup`), you can use :ref:`DisplayServer.mouse_get_position`. +\ **Note:** For screen-space coordinates (e.g. when using a non-embedded :ref:`Popup`), you can use :ref:`DisplayServer.mouse_get_position()`. .. rst-class:: classref-item-separator @@ -1382,7 +1384,7 @@ Returns the mouse's position in this **CanvasItem** using the local coordinate s Returns the transform of this **CanvasItem** in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. -Equals to :ref:`get_global_transform` if the window is embedded (see :ref:`Viewport.gui_embed_subwindows`). +Equals to :ref:`get_global_transform()` if the window is embedded (see :ref:`Viewport.gui_embed_subwindows`). .. rst-class:: classref-item-separator @@ -1490,11 +1492,11 @@ Returns ``true`` if global transform notifications are communicated to children. :ref:`bool` **is_visible_in_tree**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the node is present in the :ref:`SceneTree`, its :ref:`visible` property is ``true`` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see :ref:`_draw`). +Returns ``true`` if the node is present in the :ref:`SceneTree`, its :ref:`visible` property is ``true`` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see :ref:`_draw()`). Visibility is checked only in parent nodes that inherit from **CanvasItem**, :ref:`CanvasLayer`, and :ref:`Window`. If the parent is of any other type (such as :ref:`Node`, :ref:`AnimationPlayer`, or :ref:`Node3D`), it is assumed to be visible. -\ **Note:** This method does not take :ref:`visibility_layer` into account, so even if this method returns ``true`` the node might end up not being rendered. +\ **Note:** This method does not take :ref:`visibility_layer` into account, so even if this method returns ``true``, the node might end up not being rendered. .. rst-class:: classref-item-separator @@ -1508,7 +1510,7 @@ Visibility is checked only in parent nodes that inherit from **CanvasItem**, :re Transforms ``viewport_point`` from the viewport's coordinates to this node's local coordinates. -For the opposite operation, use :ref:`get_global_transform_with_canvas`. +For the opposite operation, use :ref:`get_global_transform_with_canvas()`. :: @@ -1550,7 +1552,7 @@ Internally, the node is moved to the bottom of parent's child list. The method h |void| **queue_redraw**\ (\ ) :ref:`πŸ”—` -Queues the **CanvasItem** to redraw. During idle time, if **CanvasItem** is visible, :ref:`NOTIFICATION_DRAW` is sent and :ref:`_draw` is called. This only occurs **once** per frame, even if this method has been called multiple times. +Queues the **CanvasItem** to redraw. During idle time, if **CanvasItem** is visible, :ref:`NOTIFICATION_DRAW` is sent and :ref:`_draw()` is called. This only occurs **once** per frame, even if this method has been called multiple times. .. rst-class:: classref-item-separator @@ -1562,7 +1564,7 @@ Queues the **CanvasItem** to redraw. During idle time, if **CanvasItem** is visi |void| **set_instance_shader_parameter**\ (\ name\: :ref:`StringName`, value\: :ref:`Variant`\ ) :ref:`πŸ”—` -Set the value of a shader uniform for this instance only (`per-instance uniform <../tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms>`__). See also :ref:`ShaderMaterial.set_shader_parameter` to assign a uniform on all instances using the same :ref:`ShaderMaterial`. +Set the value of a shader uniform for this instance only (`per-instance uniform <../tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms>`__). See also :ref:`ShaderMaterial.set_shader_parameter()` to assign a uniform on all instances using the same :ref:`ShaderMaterial`. \ **Note:** For a shader uniform to be assignable on a per-instance basis, it *must* be defined with ``instance uniform ...`` rather than ``uniform ...`` in the shader code. diff --git a/classes/class_characterbody2d.rst b/classes/class_characterbody2d.rst index 574000152c6..288c3df1379 100644 --- a/classes/class_characterbody2d.rst +++ b/classes/class_characterbody2d.rst @@ -19,7 +19,7 @@ A 2D physics body specialized for characters moved by script. Description ----------- -**CharacterBody2D** is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection (:ref:`move_and_slide` method) in addition to the general collision detection provided by :ref:`PhysicsBody2D.move_and_collide`. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. +**CharacterBody2D** is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection (:ref:`move_and_slide()` method) in addition to the general collision detection provided by :ref:`PhysicsBody2D.move_and_collide()`. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. For game objects that don't require complex movement or collision detection, such as moving platforms, :ref:`AnimatableBody2D` is simpler to configure. @@ -243,7 +243,7 @@ If ``true``, the body will always move at the same speed on the ground no matter - |void| **set_floor_max_angle**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_floor_max_angle**\ (\ ) -Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling :ref:`move_and_slide`. The default value equals 45 degrees. +Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling :ref:`move_and_slide()`. The default value equals 45 degrees. .. rst-class:: classref-item-separator @@ -260,9 +260,9 @@ Maximum angle (in radians) where a slope is still considered a floor (or a ceili - |void| **set_floor_snap_length**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_floor_snap_length**\ (\ ) -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`. +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 :ref:`up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along :ref:`up_direction`, meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use :ref:`apply_floor_snap`. +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`, meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use :ref:`apply_floor_snap()`. .. rst-class:: classref-item-separator @@ -279,7 +279,7 @@ As long as the snapping vector is in contact with the ground and the body moves - |void| **set_floor_stop_on_slope_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_floor_stop_on_slope_enabled**\ (\ ) -If ``true``, the body will not slide on slopes when calling :ref:`move_and_slide` when the body is standing still. +If ``true``, the body will not slide on slopes when calling :ref:`move_and_slide()` when the body is standing still. If ``false``, the body will slide on floor's slopes when :ref:`velocity` applies a downward force. @@ -298,7 +298,7 @@ If ``false``, the body will slide on floor's slopes when :ref:`velocity`\ ) - :ref:`int` **get_max_slides**\ (\ ) -Maximum number of times the body can change direction before it stops when calling :ref:`move_and_slide`. +Maximum number of times the body can change direction before it stops when calling :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -315,7 +315,7 @@ Maximum number of times the body can change direction before it stops when calli - |void| **set_motion_mode**\ (\ value\: :ref:`MotionMode`\ ) - :ref:`MotionMode` **get_motion_mode**\ (\ ) -Sets the motion mode which defines the behavior of :ref:`move_and_slide`. See :ref:`MotionMode` constants for available modes. +Sets the motion mode which defines the behavior of :ref:`move_and_slide()`. See :ref:`MotionMode` constants for available modes. .. rst-class:: classref-item-separator @@ -383,7 +383,7 @@ Collision layers that will be included for detecting wall bodies that will act a - |void| **set_safe_margin**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_safe_margin**\ (\ ) -Extra margin used for collision recovery when calling :ref:`move_and_slide`. +Extra margin used for collision recovery when calling :ref:`move_and_slide()`. If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. @@ -423,7 +423,7 @@ If ``true``, during a jump against the ceiling, the body will slide, if ``false` - |void| **set_up_direction**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_up_direction**\ (\ ) -Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling :ref:`move_and_slide`. Defaults to :ref:`Vector2.UP`. As the vector will be normalized it can't be equal to :ref:`Vector2.ZERO`, if you want all collisions to be reported as walls, consider using :ref:`MOTION_MODE_FLOATING` as :ref:`motion_mode`. +Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling :ref:`move_and_slide()`. Defaults to :ref:`Vector2.UP`. As the vector will be normalized it can't be equal to :ref:`Vector2.ZERO`, if you want all collisions to be reported as walls, consider using :ref:`MOTION_MODE_FLOATING` as :ref:`motion_mode`. .. rst-class:: classref-item-separator @@ -440,7 +440,7 @@ Vector pointing upwards, used to determine what is a wall and what is a floor (o - |void| **set_velocity**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_velocity**\ (\ ) -Current velocity vector in pixels per second, used and modified during calls to :ref:`move_and_slide`. +Current velocity vector in pixels per second, used and modified during calls to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -474,7 +474,7 @@ Method Descriptions |void| **apply_floor_snap**\ (\ ) :ref:`πŸ”—` -Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when :ref:`is_on_floor` returns ``true``. +Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when :ref:`is_on_floor()` returns ``true``. .. rst-class:: classref-item-separator @@ -486,7 +486,7 @@ Allows to manually apply a snap to the floor regardless of the body's velocity. :ref:`float` **get_floor_angle**\ (\ up_direction\: :ref:`Vector2` = Vector2(0, -1)\ ) |const| :ref:`πŸ”—` -Returns the floor's collision angle at the last collision point according to ``up_direction``, which is :ref:`Vector2.UP` by default. This value is always positive and only valid after calling :ref:`move_and_slide` and when :ref:`is_on_floor` returns ``true``. +Returns the floor's collision angle at the last collision point according to ``up_direction``, which is :ref:`Vector2.UP` by default. This value is always positive and only valid after calling :ref:`move_and_slide()` and when :ref:`is_on_floor()` returns ``true``. .. rst-class:: classref-item-separator @@ -498,7 +498,7 @@ Returns the floor's collision angle at the last collision point according to ``u :ref:`Vector2` **get_floor_normal**\ (\ ) |const| :ref:`πŸ”—` -Returns the collision normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide` and when :ref:`is_on_floor` returns ``true``. +Returns the collision normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide()` and when :ref:`is_on_floor()` returns ``true``. \ **Warning:** The collision normal is not always the same as the surface normal. @@ -512,7 +512,7 @@ Returns the collision normal of the floor at the last collision point. Only vali :ref:`Vector2` **get_last_motion**\ (\ ) |const| :ref:`πŸ”—` -Returns the last motion applied to the **CharacterBody2D** during the last call to :ref:`move_and_slide`. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. +Returns the last motion applied to the **CharacterBody2D** during the last call to :ref:`move_and_slide()`. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. .. rst-class:: classref-item-separator @@ -524,7 +524,7 @@ Returns the last motion applied to the **CharacterBody2D** during the last call :ref:`KinematicCollision2D` **get_last_slide_collision**\ (\ ) :ref:`πŸ”—` -Returns a :ref:`KinematicCollision2D`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide`. +Returns a :ref:`KinematicCollision2D`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -536,7 +536,7 @@ Returns a :ref:`KinematicCollision2D`, which contain :ref:`Vector2` **get_platform_velocity**\ (\ ) |const| :ref:`πŸ”—` -Returns the linear velocity of the platform at the last collision point. Only valid after calling :ref:`move_and_slide`. +Returns the linear velocity of the platform at the last collision point. Only valid after calling :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -548,7 +548,7 @@ Returns the linear velocity of the platform at the last collision point. Only va :ref:`Vector2` **get_position_delta**\ (\ ) |const| :ref:`πŸ”—` -Returns the travel (position delta) that occurred during the last call to :ref:`move_and_slide`. +Returns the travel (position delta) that occurred during the last call to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -560,7 +560,7 @@ Returns the travel (position delta) that occurred during the last call to :ref:` :ref:`Vector2` **get_real_velocity**\ (\ ) |const| :ref:`πŸ”—` -Returns the current real velocity since the last call to :ref:`move_and_slide`. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to :ref:`velocity` which returns the requested velocity. +Returns the current real velocity since the last call to :ref:`move_and_slide()`. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to :ref:`velocity` which returns the requested velocity. .. rst-class:: classref-item-separator @@ -572,7 +572,7 @@ Returns the current real velocity since the last call to :ref:`move_and_slide` **get_slide_collision**\ (\ slide_idx\: :ref:`int`\ ) :ref:`πŸ”—` -Returns a :ref:`KinematicCollision2D`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide`. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_collision_count` - 1). +Returns a :ref:`KinematicCollision2D`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide()`. Since the body can collide several times in a single call to :ref:`move_and_slide()`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_collision_count()` - 1). \ **Example:** Iterate through the collisions with a ``for`` loop: @@ -605,7 +605,7 @@ Returns a :ref:`KinematicCollision2D`, which contain :ref:`int` **get_slide_collision_count**\ (\ ) |const| :ref:`πŸ”—` -Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide`. +Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -617,7 +617,7 @@ Returns the number of times the body collided and changed direction during the l :ref:`Vector2` **get_wall_normal**\ (\ ) |const| :ref:`πŸ”—` -Returns the collision normal of the wall at the last collision point. Only valid after calling :ref:`move_and_slide` and when :ref:`is_on_wall` returns ``true``. +Returns the collision normal of the wall at the last collision point. Only valid after calling :ref:`move_and_slide()` and when :ref:`is_on_wall()` returns ``true``. \ **Warning:** The collision normal is not always the same as the surface normal. @@ -631,7 +631,7 @@ Returns the collision normal of the wall at the last collision point. Only valid :ref:`bool` **is_on_ceiling**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. +Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. .. rst-class:: classref-item-separator @@ -643,7 +643,7 @@ Returns ``true`` if the body collided with the ceiling on the last call of :ref: :ref:`bool` **is_on_ceiling_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided only with the ceiling on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. +Returns ``true`` if the body collided only with the ceiling on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. .. rst-class:: classref-item-separator @@ -655,7 +655,7 @@ Returns ``true`` if the body collided only with the ceiling on the last call of :ref:`bool` **is_on_floor**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. +Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. .. rst-class:: classref-item-separator @@ -667,7 +667,7 @@ Returns ``true`` if the body collided with the floor on the last call of :ref:`m :ref:`bool` **is_on_floor_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided only with the floor on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. +Returns ``true`` if the body collided only with the floor on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. .. rst-class:: classref-item-separator @@ -679,7 +679,7 @@ Returns ``true`` if the body collided only with the floor on the last call of :r :ref:`bool` **is_on_wall**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. +Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. .. rst-class:: classref-item-separator @@ -691,7 +691,7 @@ Returns ``true`` if the body collided with a wall on the last call of :ref:`move :ref:`bool` **is_on_wall_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided only with a wall on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. +Returns ``true`` if the body collided only with a wall on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. .. rst-class:: classref-item-separator @@ -705,7 +705,7 @@ Returns ``true`` if the body collided only with a wall on the last call of :ref: Moves the body based on :ref:`velocity`. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a **CharacterBody2D** or :ref:`RigidBody2D`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. -Modifies :ref:`velocity` if a slide collision occurred. To get the latest collision call :ref:`get_last_slide_collision`, for detailed information about collisions that occurred, use :ref:`get_slide_collision`. +Modifies :ref:`velocity` if a slide collision occurred. To get the latest collision call :ref:`get_last_slide_collision()`, for detailed information about collisions that occurred, use :ref:`get_slide_collision()`. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. diff --git a/classes/class_characterbody3d.rst b/classes/class_characterbody3d.rst index 019cbf75829..84c7987f982 100644 --- a/classes/class_characterbody3d.rst +++ b/classes/class_characterbody3d.rst @@ -19,7 +19,7 @@ A 3D physics body specialized for characters moved by script. Description ----------- -**CharacterBody3D** is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection (:ref:`move_and_slide` method) in addition to the general collision detection provided by :ref:`PhysicsBody3D.move_and_collide`. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. +**CharacterBody3D** is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection (:ref:`move_and_slide()` method) in addition to the general collision detection provided by :ref:`PhysicsBody3D.move_and_collide()`. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. For game objects that don't require complex movement or collision detection, such as moving platforms, :ref:`AnimatableBody3D` is simpler to configure. @@ -247,7 +247,7 @@ If ``true``, the body will always move at the same speed on the ground no matter - |void| **set_floor_max_angle**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_floor_max_angle**\ (\ ) -Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling :ref:`move_and_slide`. The default value equals 45 degrees. +Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling :ref:`move_and_slide()`. The default value equals 45 degrees. .. rst-class:: classref-item-separator @@ -264,9 +264,9 @@ Maximum angle (in radians) where a slope is still considered a floor (or a ceili - |void| **set_floor_snap_length**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_floor_snap_length**\ (\ ) -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`. +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 :ref:`up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along :ref:`up_direction`, meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use :ref:`apply_floor_snap`. +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`, meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use :ref:`apply_floor_snap()`. .. rst-class:: classref-item-separator @@ -283,7 +283,7 @@ As long as the snapping vector is in contact with the ground and the body moves - |void| **set_floor_stop_on_slope_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_floor_stop_on_slope_enabled**\ (\ ) -If ``true``, the body will not slide on slopes when calling :ref:`move_and_slide` when the body is standing still. +If ``true``, the body will not slide on slopes when calling :ref:`move_and_slide()` when the body is standing still. If ``false``, the body will slide on floor's slopes when :ref:`velocity` applies a downward force. @@ -302,7 +302,7 @@ If ``false``, the body will slide on floor's slopes when :ref:`velocity`\ ) - :ref:`int` **get_max_slides**\ (\ ) -Maximum number of times the body can change direction before it stops when calling :ref:`move_and_slide`. +Maximum number of times the body can change direction before it stops when calling :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -319,7 +319,7 @@ Maximum number of times the body can change direction before it stops when calli - |void| **set_motion_mode**\ (\ value\: :ref:`MotionMode`\ ) - :ref:`MotionMode` **get_motion_mode**\ (\ ) -Sets the motion mode which defines the behavior of :ref:`move_and_slide`. See :ref:`MotionMode` constants for available modes. +Sets the motion mode which defines the behavior of :ref:`move_and_slide()`. See :ref:`MotionMode` constants for available modes. .. rst-class:: classref-item-separator @@ -387,7 +387,7 @@ Collision layers that will be included for detecting wall bodies that will act a - |void| **set_safe_margin**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_safe_margin**\ (\ ) -Extra margin used for collision recovery when calling :ref:`move_and_slide`. +Extra margin used for collision recovery when calling :ref:`move_and_slide()`. If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. @@ -427,7 +427,7 @@ If ``true``, during a jump against the ceiling, the body will slide, if ``false` - |void| **set_up_direction**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_up_direction**\ (\ ) -Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling :ref:`move_and_slide`. Defaults to :ref:`Vector3.UP`. As the vector will be normalized it can't be equal to :ref:`Vector3.ZERO`, if you want all collisions to be reported as walls, consider using :ref:`MOTION_MODE_FLOATING` as :ref:`motion_mode`. +Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling :ref:`move_and_slide()`. Defaults to :ref:`Vector3.UP`. As the vector will be normalized it can't be equal to :ref:`Vector3.ZERO`, if you want all collisions to be reported as walls, consider using :ref:`MOTION_MODE_FLOATING` as :ref:`motion_mode`. .. rst-class:: classref-item-separator @@ -444,7 +444,7 @@ Vector pointing upwards, used to determine what is a wall and what is a floor (o - |void| **set_velocity**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_velocity**\ (\ ) -Current velocity vector (typically meters per second), used and modified during calls to :ref:`move_and_slide`. +Current velocity vector (typically meters per second), used and modified during calls to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -478,7 +478,7 @@ Method Descriptions |void| **apply_floor_snap**\ (\ ) :ref:`πŸ”—` -Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when :ref:`is_on_floor` returns ``true``. +Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when :ref:`is_on_floor()` returns ``true``. .. rst-class:: classref-item-separator @@ -490,7 +490,7 @@ Allows to manually apply a snap to the floor regardless of the body's velocity. :ref:`float` **get_floor_angle**\ (\ up_direction\: :ref:`Vector3` = Vector3(0, 1, 0)\ ) |const| :ref:`πŸ”—` -Returns the floor's collision angle at the last collision point according to ``up_direction``, which is :ref:`Vector3.UP` by default. This value is always positive and only valid after calling :ref:`move_and_slide` and when :ref:`is_on_floor` returns ``true``. +Returns the floor's collision angle at the last collision point according to ``up_direction``, which is :ref:`Vector3.UP` by default. This value is always positive and only valid after calling :ref:`move_and_slide()` and when :ref:`is_on_floor()` returns ``true``. .. rst-class:: classref-item-separator @@ -502,7 +502,7 @@ Returns the floor's collision angle at the last collision point according to ``u :ref:`Vector3` **get_floor_normal**\ (\ ) |const| :ref:`πŸ”—` -Returns the collision normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide` and when :ref:`is_on_floor` returns ``true``. +Returns the collision normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide()` and when :ref:`is_on_floor()` returns ``true``. \ **Warning:** The collision normal is not always the same as the surface normal. @@ -516,7 +516,7 @@ Returns the collision normal of the floor at the last collision point. Only vali :ref:`Vector3` **get_last_motion**\ (\ ) |const| :ref:`πŸ”—` -Returns the last motion applied to the **CharacterBody3D** during the last call to :ref:`move_and_slide`. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. +Returns the last motion applied to the **CharacterBody3D** during the last call to :ref:`move_and_slide()`. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. .. rst-class:: classref-item-separator @@ -528,7 +528,7 @@ Returns the last motion applied to the **CharacterBody3D** during the last call :ref:`KinematicCollision3D` **get_last_slide_collision**\ (\ ) :ref:`πŸ”—` -Returns a :ref:`KinematicCollision3D`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide`. +Returns a :ref:`KinematicCollision3D`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -540,7 +540,7 @@ Returns a :ref:`KinematicCollision3D`, which contain :ref:`Vector3` **get_platform_angular_velocity**\ (\ ) |const| :ref:`πŸ”—` -Returns the angular velocity of the platform at the last collision point. Only valid after calling :ref:`move_and_slide`. +Returns the angular velocity of the platform at the last collision point. Only valid after calling :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -552,7 +552,7 @@ Returns the angular velocity of the platform at the last collision point. Only v :ref:`Vector3` **get_platform_velocity**\ (\ ) |const| :ref:`πŸ”—` -Returns the linear velocity of the platform at the last collision point. Only valid after calling :ref:`move_and_slide`. +Returns the linear velocity of the platform at the last collision point. Only valid after calling :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -564,7 +564,7 @@ Returns the linear velocity of the platform at the last collision point. Only va :ref:`Vector3` **get_position_delta**\ (\ ) |const| :ref:`πŸ”—` -Returns the travel (position delta) that occurred during the last call to :ref:`move_and_slide`. +Returns the travel (position delta) that occurred during the last call to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -576,7 +576,7 @@ Returns the travel (position delta) that occurred during the last call to :ref:` :ref:`Vector3` **get_real_velocity**\ (\ ) |const| :ref:`πŸ”—` -Returns the current real velocity since the last call to :ref:`move_and_slide`. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to :ref:`velocity` which returns the requested velocity. +Returns the current real velocity since the last call to :ref:`move_and_slide()`. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to :ref:`velocity` which returns the requested velocity. .. rst-class:: classref-item-separator @@ -588,7 +588,7 @@ Returns the current real velocity since the last call to :ref:`move_and_slide` **get_slide_collision**\ (\ slide_idx\: :ref:`int`\ ) :ref:`πŸ”—` -Returns a :ref:`KinematicCollision3D`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide`. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_collision_count` - 1). +Returns a :ref:`KinematicCollision3D`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide()`. Since the body can collide several times in a single call to :ref:`move_and_slide()`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_collision_count()` - 1). .. rst-class:: classref-item-separator @@ -600,7 +600,7 @@ Returns a :ref:`KinematicCollision3D`, which contain :ref:`int` **get_slide_collision_count**\ (\ ) |const| :ref:`πŸ”—` -Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide`. +Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide()`. .. rst-class:: classref-item-separator @@ -612,7 +612,7 @@ Returns the number of times the body collided and changed direction during the l :ref:`Vector3` **get_wall_normal**\ (\ ) |const| :ref:`πŸ”—` -Returns the collision normal of the wall at the last collision point. Only valid after calling :ref:`move_and_slide` and when :ref:`is_on_wall` returns ``true``. +Returns the collision normal of the wall at the last collision point. Only valid after calling :ref:`move_and_slide()` and when :ref:`is_on_wall()` returns ``true``. \ **Warning:** The collision normal is not always the same as the surface normal. @@ -626,7 +626,7 @@ Returns the collision normal of the wall at the last collision point. Only valid :ref:`bool` **is_on_ceiling**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. +Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. .. rst-class:: classref-item-separator @@ -638,7 +638,7 @@ Returns ``true`` if the body collided with the ceiling on the last call of :ref: :ref:`bool` **is_on_ceiling_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided only with the ceiling on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. +Returns ``true`` if the body collided only with the ceiling on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "ceiling" or not. .. rst-class:: classref-item-separator @@ -650,7 +650,7 @@ Returns ``true`` if the body collided only with the ceiling on the last call of :ref:`bool` **is_on_floor**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. +Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. .. rst-class:: classref-item-separator @@ -662,7 +662,7 @@ Returns ``true`` if the body collided with the floor on the last call of :ref:`m :ref:`bool` **is_on_floor_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided only with the floor on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. +Returns ``true`` if the body collided only with the floor on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "floor" or not. .. rst-class:: classref-item-separator @@ -674,7 +674,7 @@ Returns ``true`` if the body collided only with the floor on the last call of :r :ref:`bool` **is_on_wall**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. +Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. .. rst-class:: classref-item-separator @@ -686,7 +686,7 @@ Returns ``true`` if the body collided with a wall on the last call of :ref:`move :ref:`bool` **is_on_wall_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the body collided only with a wall on the last call of :ref:`move_and_slide`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. +Returns ``true`` if the body collided only with a wall on the last call of :ref:`move_and_slide()`. Otherwise, returns ``false``. The :ref:`up_direction` and :ref:`floor_max_angle` are used to determine whether a surface is "wall" or not. .. rst-class:: classref-item-separator @@ -700,7 +700,7 @@ Returns ``true`` if the body collided only with a wall on the last call of :ref: Moves the body based on :ref:`velocity`. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a **CharacterBody3D** or :ref:`RigidBody3D`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. -Modifies :ref:`velocity` if a slide collision occurred. To get the latest collision call :ref:`get_last_slide_collision`, for more detailed information about collisions that occurred, use :ref:`get_slide_collision`. +Modifies :ref:`velocity` if a slide collision occurred. To get the latest collision call :ref:`get_last_slide_collision()`, for more detailed information about collisions that occurred, use :ref:`get_slide_collision()`. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. diff --git a/classes/class_charfxtransform.rst b/classes/class_charfxtransform.rst index 9f5e4d814eb..b5240112f61 100644 --- a/classes/class_charfxtransform.rst +++ b/classes/class_charfxtransform.rst @@ -143,7 +143,9 @@ For example, the opening BBCode tag ``[example foo=hello bar=true baz=42 color=# - |void| **set_font**\ (\ value\: :ref:`RID`\ ) - :ref:`RID` **get_font**\ (\ ) -Font resource used to render glyph. +:ref:`TextServer` RID of the font used to render glyph, this value can be used with ``TextServer.font_*`` methods to retrieve font information. + +\ **Note:** Read-only. Setting this property won't affect drawing. .. rst-class:: classref-item-separator @@ -160,7 +162,9 @@ Font resource used to render glyph. - |void| **set_glyph_count**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_glyph_count**\ (\ ) -Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. Setting this property won't affect drawing. +Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. + +\ **Note:** Read-only. Setting this property won't affect drawing. .. rst-class:: classref-item-separator @@ -177,7 +181,9 @@ Number of glyphs in the grapheme cluster. This value is set in the first glyph o - |void| **set_glyph_flags**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_glyph_flags**\ (\ ) -Glyph flags. See :ref:`GraphemeFlag` for more info. Setting this property won't affect drawing. +Glyph flags. See :ref:`GraphemeFlag` for more info. + +\ **Note:** Read-only. Setting this property won't affect drawing. .. rst-class:: classref-item-separator @@ -194,7 +200,7 @@ Glyph flags. See :ref:`GraphemeFlag` for more info - |void| **set_glyph_index**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_glyph_index**\ (\ ) -Font specific glyph index. +Glyph index specific to the :ref:`font`. If you want to replace this glyph, use :ref:`TextServer.font_get_glyph_index()` with :ref:`font` to get a new glyph index for a single character. .. rst-class:: classref-item-separator @@ -228,7 +234,9 @@ The position offset the character will be drawn with (in pixels). - |void| **set_outline**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_outline**\ (\ ) -If ``true``, FX transform is called for outline drawing. Setting this property won't affect drawing. +If ``true``, FX transform is called for outline drawing. + +\ **Note:** Read-only. Setting this property won't affect drawing. .. rst-class:: classref-item-separator @@ -245,7 +253,9 @@ If ``true``, FX transform is called for outline drawing. Setting this property w - |void| **set_range**\ (\ value\: :ref:`Vector2i`\ ) - :ref:`Vector2i` **get_range**\ (\ ) -Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. +Absolute character range in the string, corresponding to the glyph. + +\ **Note:** Read-only. Setting this property won't affect drawing. .. rst-class:: classref-item-separator @@ -262,7 +272,9 @@ Absolute character range in the string, corresponding to the glyph. Setting this - |void| **set_relative_index**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_relative_index**\ (\ ) -The character offset of the glyph, relative to the current :ref:`RichTextEffect` custom block. Setting this property won't affect drawing. +The character offset of the glyph, relative to the current :ref:`RichTextEffect` custom block. + +\ **Note:** Read-only. Setting this property won't affect drawing. .. rst-class:: classref-item-separator diff --git a/classes/class_classdb.rst b/classes/class_classdb.rst index fe22f5ca677..7c0a316eb1a 100644 --- a/classes/class_classdb.rst +++ b/classes/class_classdb.rst @@ -367,7 +367,7 @@ Returns the ``signal`` data of ``class`` or its ancestry. The returned value is :ref:`Array`\[:ref:`Dictionary`\] **class_get_signal_list**\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`πŸ”—` -Returns an array with all the signals of ``class`` or its ancestry if ``no_inheritance`` is ``false``. Every element of the array is a :ref:`Dictionary` as described in :ref:`class_get_signal`. +Returns an array with all the signals of ``class`` or its ancestry if ``no_inheritance`` is ``false``. Every element of the array is a :ref:`Dictionary` as described in :ref:`class_get_signal()`. .. rst-class:: classref-item-separator diff --git a/classes/class_codeedit.rst b/classes/class_codeedit.rst index 9fd7cea2690..e1911ecf216 100644 --- a/classes/class_codeedit.rst +++ b/classes/class_codeedit.rst @@ -322,7 +322,7 @@ Emitted when a breakpoint is added or removed from a line. If the line is moved **code_completion_requested**\ (\ ) :ref:`πŸ”—` -Emitted when the user requests code completion. This signal will not be sent if :ref:`_request_code_completion` is overridden or :ref:`code_completion_enabled` is ``false``. +Emitted when the user requests code completion. This signal will not be sent if :ref:`_request_code_completion()` is overridden or :ref:`code_completion_enabled` is ``false``. .. rst-class:: classref-item-separator @@ -360,7 +360,7 @@ Emitted when the user has clicked on a valid symbol. **symbol_validate**\ (\ symbol\: :ref:`String`\ ) :ref:`πŸ”—` -Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling :ref:`set_symbol_lookup_word_as_valid`. +Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling :ref:`set_symbol_lookup_word_as_valid()`. \ **Note:** :ref:`symbol_lookup_on_click` must be ``true`` for this signal to be emitted. @@ -572,7 +572,7 @@ Sets the brace pairs to be autocompleted. For each entry in the dictionary, the - |void| **set_code_completion_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_code_completion_enabled**\ (\ ) -If ``true``, the :ref:`ProjectSettings.input/ui_text_completion_query` action requests code completion. To handle it, see :ref:`_request_code_completion` or :ref:`code_completion_requested`. +If ``true``, the :ref:`ProjectSettings.input/ui_text_completion_query` action requests code completion. To handle it, see :ref:`_request_code_completion()` or :ref:`code_completion_requested`. .. rst-class:: classref-item-separator @@ -640,7 +640,7 @@ Sets the string delimiters. All existing string delimiters will be removed. - |void| **set_draw_bookmarks_gutter**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_drawing_bookmarks_gutter**\ (\ ) -If ``true``, bookmarks are drawn in the gutter. This gutter is shared with breakpoints and executing lines. See :ref:`set_line_as_bookmarked`. +If ``true``, bookmarks are drawn in the gutter. This gutter is shared with breakpoints and executing lines. See :ref:`set_line_as_bookmarked()`. .. rst-class:: classref-item-separator @@ -657,7 +657,7 @@ If ``true``, bookmarks are drawn in the gutter. This gutter is shared with break - |void| **set_draw_breakpoints_gutter**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_drawing_breakpoints_gutter**\ (\ ) -If ``true``, breakpoints are drawn in the gutter. This gutter is shared with bookmarks and executing lines. Clicking the gutter will toggle the breakpoint for the line, see :ref:`set_line_as_breakpoint`. +If ``true``, breakpoints are drawn in the gutter. This gutter is shared with bookmarks and executing lines. Clicking the gutter will toggle the breakpoint for the line, see :ref:`set_line_as_breakpoint()`. .. rst-class:: classref-item-separator @@ -674,7 +674,7 @@ If ``true``, breakpoints are drawn in the gutter. This gutter is shared with boo - |void| **set_draw_executing_lines_gutter**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_drawing_executing_lines_gutter**\ (\ ) -If ``true``, executing lines are marked in the gutter. This gutter is shared with breakpoints and bookmarks. See :ref:`set_line_as_executing`. +If ``true``, executing lines are marked in the gutter. This gutter is shared with breakpoints and bookmarks. See :ref:`set_line_as_executing()`. .. rst-class:: classref-item-separator @@ -691,7 +691,7 @@ If ``true``, executing lines are marked in the gutter. This gutter is shared wit - |void| **set_draw_fold_gutter**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_drawing_fold_gutter**\ (\ ) -If ``true``, the fold gutter is drawn. In this gutter, the :ref:`can_fold_code_region` icon is drawn for each foldable line (see :ref:`can_fold_line`) and the :ref:`folded_code_region` icon is drawn for each folded line (see :ref:`is_line_folded`). These icons can be clicked to toggle the fold state, see :ref:`toggle_foldable_line`. :ref:`line_folding` must be ``true`` to show icons. +If ``true``, the fold gutter is drawn. In this gutter, the :ref:`can_fold_code_region` icon is drawn for each foldable line (see :ref:`can_fold_line()`) and the :ref:`folded_code_region` icon is drawn for each folded line (see :ref:`is_line_folded()`). These icons can be clicked to toggle the fold state, see :ref:`toggle_foldable_line()`. :ref:`line_folding` must be ``true`` to show icons. .. rst-class:: classref-item-separator @@ -810,7 +810,7 @@ Use spaces instead of tabs for indentation. - |void| **set_line_folding_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_line_folding_enabled**\ (\ ) -If ``true``, lines can be folded. Otherwise, line folding methods like :ref:`fold_line` will not work and :ref:`can_fold_line` will always return ``false``. See :ref:`gutters_draw_fold_gutter`. +If ``true``, lines can be folded. Otherwise, line folding methods like :ref:`fold_line()` will not work and :ref:`can_fold_line()` will always return ``false``. See :ref:`gutters_draw_fold_gutter`. .. rst-class:: classref-item-separator @@ -892,7 +892,7 @@ Override this method to define how the selected entry should be inserted. If ``r Override this method to define what items in ``candidates`` should be displayed. -Both ``candidates`` and the return is a :ref:`Array` of :ref:`Dictionary`, see :ref:`get_code_completion_option` for :ref:`Dictionary` content. +Both ``candidates`` and the return is a :ref:`Array` of :ref:`Dictionary`, see :ref:`get_code_completion_option()` for :ref:`Dictionary` content. .. rst-class:: classref-item-separator @@ -930,7 +930,7 @@ Both the start and end keys must be symbols. Only the start key has to be unique |void| **add_code_completion_option**\ (\ type\: :ref:`CodeCompletionKind`, display_text\: :ref:`String`, insert_text\: :ref:`String`, text_color\: :ref:`Color` = Color(1, 1, 1, 1), icon\: :ref:`Resource` = null, value\: :ref:`Variant` = null, location\: :ref:`int` = 1024\ ) :ref:`πŸ”—` -Submits an item to the queue of potential candidates for the autocomplete menu. Call :ref:`update_code_completion_options` to update the list. +Submits an item to the queue of potential candidates for the autocomplete menu. Call :ref:`update_code_completion_options()` to update the list. \ ``location`` indicates location of the option relative to the location of the code completion query. See :ref:`CodeCompletionLocation` for how to set this value. @@ -974,7 +974,7 @@ If ``line_only`` is ``true`` or ``end_key`` is an empty :ref:`String` **can_fold_line**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is foldable. A line is foldable if it is the start of a valid code region (see :ref:`get_code_region_start_tag`), if it is the start of a comment or string block, or if the next non-empty line is more indented (see :ref:`TextEdit.get_indent_level`). +Returns ``true`` if the given line is foldable. A line is foldable if it is the start of a valid code region (see :ref:`get_code_region_start_tag()`), if it is the start of a comment or string block, or if the next non-empty line is more indented (see :ref:`TextEdit.get_indent_level()`). .. rst-class:: classref-item-separator @@ -1084,11 +1084,11 @@ Values of ``-1`` convert the entire text. |void| **create_code_region**\ (\ ) :ref:`πŸ”—` -Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see :ref:`add_comment_delimiter`). +Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see :ref:`add_comment_delimiter()`). A code region is a part of code that is highlighted when folded and can help organize your script. -Code region start and end tags can be customized (see :ref:`set_code_region_tags`). +Code region start and end tags can be customized (see :ref:`set_code_region_tags()`). Code regions are delimited using start and end tags (respectively ``region`` and ``endregion`` by default) preceded by one line comment delimiter. (eg. ``#region`` and ``#endregion``) @@ -1114,7 +1114,7 @@ Deletes all lines that are selected or have a caret on them. |void| **do_indent**\ (\ ) :ref:`πŸ”—` -If there is no selection, indentation is inserted at the caret. Otherwise, the selected lines are indented like :ref:`indent_lines`. Equivalent to the :ref:`ProjectSettings.input/ui_text_indent` action. The indentation characters used depend on :ref:`indent_use_spaces` and :ref:`indent_size`. +If there is no selection, indentation is inserted at the caret. Otherwise, the selected lines are indented like :ref:`indent_lines()`. Equivalent to the :ref:`ProjectSettings.input/ui_text_indent` action. The indentation characters used depend on :ref:`indent_use_spaces` and :ref:`indent_size`. .. rst-class:: classref-item-separator @@ -1150,7 +1150,7 @@ Duplicates all selected text and duplicates all lines with a caret on them. |void| **fold_all_lines**\ (\ ) :ref:`πŸ”—` -Folds all lines that are possible to be folded (see :ref:`can_fold_line`). +Folds all lines that are possible to be folded (see :ref:`can_fold_line()`). .. rst-class:: classref-item-separator @@ -1162,7 +1162,7 @@ Folds all lines that are possible to be folded (see :ref:`can_fold_line`\ ) :ref:`πŸ”—` -Folds the given line, if possible (see :ref:`can_fold_line`). +Folds the given line, if possible (see :ref:`can_fold_line()`). .. rst-class:: classref-item-separator @@ -1234,7 +1234,7 @@ Gets the completion option at ``index``. The return :ref:`Dictionary`\[:ref:`Dictionary`\] **get_code_completion_options**\ (\ ) |const| :ref:`πŸ”—` -Gets all completion options, see :ref:`get_code_completion_option` for return content. +Gets all completion options, see :ref:`get_code_completion_option()` for return content. .. rst-class:: classref-item-separator @@ -1438,7 +1438,7 @@ Returns ``true`` if string ``start_key`` exists. |void| **indent_lines**\ (\ ) :ref:`πŸ”—` -Indents all lines that are selected or have a caret on them. Uses spaces or a tab depending on :ref:`indent_use_spaces`. See :ref:`unindent_lines`. +Indents all lines that are selected or have a caret on them. Uses spaces or a tab depending on :ref:`indent_use_spaces`. See :ref:`unindent_lines()`. .. rst-class:: classref-item-separator @@ -1474,7 +1474,7 @@ Returns the delimiter index if ``line`` ``column`` is in a string. If ``column`` :ref:`bool` **is_line_bookmarked**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is bookmarked. See :ref:`set_line_as_bookmarked`. +Returns ``true`` if the given line is bookmarked. See :ref:`set_line_as_bookmarked()`. .. rst-class:: classref-item-separator @@ -1486,7 +1486,7 @@ Returns ``true`` if the given line is bookmarked. See :ref:`set_line_as_bookmark :ref:`bool` **is_line_breakpointed**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is breakpointed. See :ref:`set_line_as_breakpoint`. +Returns ``true`` if the given line is breakpointed. See :ref:`set_line_as_breakpoint()`. .. rst-class:: classref-item-separator @@ -1498,7 +1498,7 @@ Returns ``true`` if the given line is breakpointed. See :ref:`set_line_as_breakp :ref:`bool` **is_line_code_region_end**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is a code region end. See :ref:`set_code_region_tags`. +Returns ``true`` if the given line is a code region end. See :ref:`set_code_region_tags()`. .. rst-class:: classref-item-separator @@ -1510,7 +1510,7 @@ Returns ``true`` if the given line is a code region end. See :ref:`set_code_regi :ref:`bool` **is_line_code_region_start**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is a code region start. See :ref:`set_code_region_tags`. +Returns ``true`` if the given line is a code region start. See :ref:`set_code_region_tags()`. .. rst-class:: classref-item-separator @@ -1522,7 +1522,7 @@ Returns ``true`` if the given line is a code region start. See :ref:`set_code_re :ref:`bool` **is_line_executing**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is marked as executing. See :ref:`set_line_as_executing`. +Returns ``true`` if the given line is marked as executing. See :ref:`set_line_as_executing()`. .. rst-class:: classref-item-separator @@ -1534,7 +1534,7 @@ Returns ``true`` if the given line is marked as executing. See :ref:`set_line_as :ref:`bool` **is_line_folded**\ (\ line\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given line is folded. See :ref:`fold_line`. +Returns ``true`` if the given line is folded. See :ref:`fold_line()`. .. rst-class:: classref-item-separator @@ -1630,7 +1630,7 @@ Sets the code hint text. Pass an empty string to clear. |void| **set_code_hint_draw_below**\ (\ draw_below\: :ref:`bool`\ ) :ref:`πŸ”—` -If ``true``, the code hint will draw below the main caret. If ``false``, the code hint will draw above the main caret. See :ref:`set_code_hint`. +If ``true``, the code hint will draw below the main caret. If ``false``, the code hint will draw above the main caret. See :ref:`set_code_hint()`. .. rst-class:: classref-item-separator @@ -1654,7 +1654,7 @@ Sets the code region start and end tags (without comment delimiter). |void| **set_line_as_bookmarked**\ (\ line\: :ref:`int`, bookmarked\: :ref:`bool`\ ) :ref:`πŸ”—` -Sets the given line as bookmarked. If ``true`` and :ref:`gutters_draw_bookmarks` is ``true``, draws the :ref:`bookmark` icon in the gutter for this line. See :ref:`get_bookmarked_lines` and :ref:`is_line_bookmarked`. +Sets the given line as bookmarked. If ``true`` and :ref:`gutters_draw_bookmarks` is ``true``, draws the :ref:`bookmark` icon in the gutter for this line. See :ref:`get_bookmarked_lines()` and :ref:`is_line_bookmarked()`. .. rst-class:: classref-item-separator @@ -1666,7 +1666,7 @@ Sets the given line as bookmarked. If ``true`` and :ref:`gutters_draw_bookmarks< |void| **set_line_as_breakpoint**\ (\ line\: :ref:`int`, breakpointed\: :ref:`bool`\ ) :ref:`πŸ”—` -Sets the given line as a breakpoint. If ``true`` and :ref:`gutters_draw_breakpoints_gutter` is ``true``, draws the :ref:`breakpoint` icon in the gutter for this line. See :ref:`get_breakpointed_lines` and :ref:`is_line_breakpointed`. +Sets the given line as a breakpoint. If ``true`` and :ref:`gutters_draw_breakpoints_gutter` is ``true``, draws the :ref:`breakpoint` icon in the gutter for this line. See :ref:`get_breakpointed_lines()` and :ref:`is_line_breakpointed()`. .. rst-class:: classref-item-separator @@ -1678,7 +1678,7 @@ Sets the given line as a breakpoint. If ``true`` and :ref:`gutters_draw_breakpoi |void| **set_line_as_executing**\ (\ line\: :ref:`int`, executing\: :ref:`bool`\ ) :ref:`πŸ”—` -Sets the given line as executing. If ``true`` and :ref:`gutters_draw_executing_lines` is ``true``, draws the :ref:`executing_line` icon in the gutter for this line. See :ref:`get_executing_lines` and :ref:`is_line_executing`. +Sets the given line as executing. If ``true`` and :ref:`gutters_draw_executing_lines` is ``true``, draws the :ref:`executing_line` icon in the gutter for this line. See :ref:`get_executing_lines()` and :ref:`is_line_executing()`. .. rst-class:: classref-item-separator @@ -1750,7 +1750,7 @@ Unfolds the given line if it is folded or if it is hidden under a folded line. |void| **unindent_lines**\ (\ ) :ref:`πŸ”—` -Unindents all lines that are selected or have a caret on them. Uses spaces or a tab depending on :ref:`indent_use_spaces`. Equivalent to the :ref:`ProjectSettings.input/ui_text_dedent` action. See :ref:`indent_lines`. +Unindents all lines that are selected or have a caret on them. Uses spaces or a tab depending on :ref:`indent_use_spaces`. Equivalent to the :ref:`ProjectSettings.input/ui_text_dedent` action. See :ref:`indent_lines()`. .. rst-class:: classref-item-separator @@ -1762,7 +1762,7 @@ Unindents all lines that are selected or have a caret on them. Uses spaces or a |void| **update_code_completion_options**\ (\ force\: :ref:`bool`\ ) :ref:`πŸ”—` -Submits all completion options added with :ref:`add_code_completion_option`. Will try to force the autocomplete menu to popup, if ``force`` is ``true``. +Submits all completion options added with :ref:`add_code_completion_option()`. Will try to force the autocomplete menu to popup, if ``force`` is ``true``. \ **Note:** This will replace all current candidates. diff --git a/classes/class_collisionobject2d.rst b/classes/class_collisionobject2d.rst index 99aef5b6645..5a3606857f8 100644 --- a/classes/class_collisionobject2d.rst +++ b/classes/class_collisionobject2d.rst @@ -128,7 +128,7 @@ Signals **input_event**\ (\ viewport\: :ref:`Node`, event\: :ref:`InputEvent`, shape_idx\: :ref:`int`\ ) :ref:`πŸ”—` -Emitted when an input event occurs. Requires :ref:`input_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. See :ref:`_input_event` for details. +Emitted when an input event occurs. Requires :ref:`input_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. See :ref:`_input_event()` for details. .. rst-class:: classref-item-separator @@ -336,7 +336,7 @@ Method Descriptions Accepts unhandled :ref:`InputEvent`\ s. ``shape_idx`` is the child index of the clicked :ref:`Shape2D`. Connect to :ref:`input_event` to easily pick up these events. -\ **Note:** :ref:`_input_event` requires :ref:`input_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. +\ **Note:** :ref:`_input_event()` requires :ref:`input_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. .. rst-class:: classref-item-separator diff --git a/classes/class_collisionobject3d.rst b/classes/class_collisionobject3d.rst index 6fc0ad981ef..a9166ac81a5 100644 --- a/classes/class_collisionobject3d.rst +++ b/classes/class_collisionobject3d.rst @@ -319,7 +319,7 @@ Method Descriptions Receives unhandled :ref:`InputEvent`\ s. ``event_position`` is the location in world space of the mouse pointer on the surface of the shape with index ``shape_idx`` and ``normal`` is the normal vector of the surface at that point. Connect to the :ref:`input_event` signal to easily pick up these events. -\ **Note:** :ref:`_input_event` requires :ref:`input_ray_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. +\ **Note:** :ref:`_input_event()` requires :ref:`input_ray_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. .. rst-class:: classref-item-separator diff --git a/classes/class_collisionpolygon2d.rst b/classes/class_collisionpolygon2d.rst index 53510d3dc51..4cde2af1d42 100644 --- a/classes/class_collisionpolygon2d.rst +++ b/classes/class_collisionpolygon2d.rst @@ -21,7 +21,7 @@ Description A node that provides a polygon shape to a :ref:`CollisionObject2D` parent and allows to edit it. The polygon can be concave or convex. This can give a detection shape to an :ref:`Area2D`, turn :ref:`PhysicsBody2D` into a solid object, or give a hollow shape to a :ref:`StaticBody2D`. -\ **Warning:** A non-uniformly scaled :ref:`CollisionShape2D` will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its shape resource instead. +\ **Warning:** A non-uniformly scaled **CollisionPolygon2D** will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its polygon instead. .. rst-class:: classref-reftable-group diff --git a/classes/class_collisionpolygon3d.rst b/classes/class_collisionpolygon3d.rst index 578f53fe51f..88c9c752d5a 100644 --- a/classes/class_collisionpolygon3d.rst +++ b/classes/class_collisionpolygon3d.rst @@ -31,15 +31,19 @@ Properties .. table:: :widths: auto - +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+ - | :ref:`float` | :ref:`depth` | ``1.0`` | - +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+ - | :ref:`bool` | :ref:`disabled` | ``false`` | - +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+ - | :ref:`float` | :ref:`margin` | ``0.04`` | - +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+ - | :ref:`PackedVector2Array` | :ref:`polygon` | ``PackedVector2Array()`` | - +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+ + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ + | :ref:`Color` | :ref:`debug_color` | ``Color(0, 0, 0, 0)`` | + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ + | :ref:`bool` | :ref:`debug_fill` | ``true`` | + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ + | :ref:`float` | :ref:`depth` | ``1.0`` | + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ + | :ref:`bool` | :ref:`disabled` | ``false`` | + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ + | :ref:`float` | :ref:`margin` | ``0.04`` | + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ + | :ref:`PackedVector2Array` | :ref:`polygon` | ``PackedVector2Array()`` | + +-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+ .. rst-class:: classref-section-separator @@ -50,6 +54,42 @@ Properties Property Descriptions --------------------- +.. _class_CollisionPolygon3D_property_debug_color: + +.. rst-class:: classref-property + +:ref:`Color` **debug_color** = ``Color(0, 0, 0, 0)`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_debug_color**\ (\ value\: :ref:`Color`\ ) +- :ref:`Color` **get_debug_color**\ (\ ) + +The collision shape color that is displayed in the editor, or in the running project if **Debug > Visible Collision Shapes** is checked at the top of the editor. + +\ **Note:** The default value is :ref:`ProjectSettings.debug/shapes/collision/shape_color`. The ``Color(0, 0, 0, 0)`` value documented here is a placeholder, and not the actual default debug color. + +.. rst-class:: classref-item-separator + +---- + +.. _class_CollisionPolygon3D_property_debug_fill: + +.. rst-class:: classref-property + +:ref:`bool` **debug_fill** = ``true`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_enable_debug_fill**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **get_enable_debug_fill**\ (\ ) + +If ``true``, when the shape is displayed, it will show a solid fill color in addition to its wireframe. + +.. rst-class:: classref-item-separator + +---- + .. _class_CollisionPolygon3D_property_depth: .. rst-class:: classref-property diff --git a/classes/class_collisionshape2d.rst b/classes/class_collisionshape2d.rst index 69abc486149..4335790caa0 100644 --- a/classes/class_collisionshape2d.rst +++ b/classes/class_collisionshape2d.rst @@ -93,7 +93,7 @@ The collision shape color that is displayed in the editor, or in the running pro - |void| **set_disabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_disabled**\ (\ ) -A disabled collision shape has no effect in the world. This property should be changed with :ref:`Object.set_deferred`. +A disabled collision shape has no effect in the world. This property should be changed with :ref:`Object.set_deferred()`. .. rst-class:: classref-item-separator diff --git a/classes/class_color.rst b/classes/class_color.rst index 09fbc3e1caf..c96c6930c2b 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -19,7 +19,7 @@ Description A color represented in RGBA format by a red (:ref:`r`), green (:ref:`g`), blue (:ref:`b`), and alpha (:ref:`a`) component. Each component is a 32-bit floating-point value, usually ranging from ``0.0`` to ``1.0``. Some properties (such as :ref:`CanvasItem.modulate`) may support values greater than ``1.0``, for overbright or HDR (High Dynamic Range) colors. -Colors can be created in various ways: By the various **Color** constructors, by static methods such as :ref:`from_hsv`, and by using a name from the set of standardized colors based on `X11 color names `__ with the addition of :ref:`TRANSPARENT`. GDScript also provides :ref:`@GDScript.Color8`, which uses integers from ``0`` to ``255`` and doesn't support overbright colors. +Colors can be created in various ways: By the various **Color** constructors, by static methods such as :ref:`from_hsv()`, and by using a name from the set of standardized colors based on `X11 color names `__ with the addition of :ref:`TRANSPARENT`. GDScript also provides :ref:`@GDScript.Color8()`, which uses integers from ``0`` to ``255`` and doesn't support overbright colors. \ **Note:** In a boolean context, a Color will evaluate to ``false`` if it is equal to ``Color(0, 0, 0, 1)`` (opaque black). Otherwise, a Color will always evaluate to ``true``. @@ -121,6 +121,8 @@ Methods +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`from_ok_hsl`\ (\ h\: :ref:`float`, s\: :ref:`float`, l\: :ref:`float`, alpha\: :ref:`float` = 1.0\ ) |static| | +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`from_rgba8`\ (\ r8\: :ref:`int`, g8\: :ref:`int`, b8\: :ref:`int`, a8\: :ref:`int` = 255\ ) |static| | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`from_rgbe9995`\ (\ rgbe\: :ref:`int`\ ) |static| | +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`from_string`\ (\ str\: :ref:`String`, default\: :ref:`Color`\ ) |static| | @@ -1710,7 +1712,7 @@ Returns a new color resulting from overlaying this color over the given color. I :ref:`Color` **clamp**\ (\ min\: :ref:`Color` = Color(0, 0, 0, 0), max\: :ref:`Color` = Color(1, 1, 1, 1)\ ) |const| :ref:`πŸ”—` -Returns a new color with all components clamped between the components of ``min`` and ``max``, by running :ref:`@GlobalScope.clamp` on each component. +Returns a new color with all components clamped between the components of ``min`` and ``max``, by running :ref:`@GlobalScope.clamp()` on each component. .. rst-class:: classref-item-separator @@ -1722,7 +1724,7 @@ Returns a new color with all components clamped between the components of ``min` :ref:`Color` **darkened**\ (\ amount\: :ref:`float`\ ) |const| :ref:`πŸ”—` -Returns a new color resulting from making this color darker by the specified ``amount`` (ratio from 0.0 to 1.0). See also :ref:`lightened`. +Returns a new color resulting from making this color darker by the specified ``amount`` (ratio from 0.0 to 1.0). See also :ref:`lightened()`. .. tabs:: @@ -1789,6 +1791,26 @@ Constructs a color from an `OK HSL profile ` **from_rgba8**\ (\ r8\: :ref:`int`, g8\: :ref:`int`, b8\: :ref:`int`, a8\: :ref:`int` = 255\ ) |static| :ref:`πŸ”—` + +Returns a **Color** constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value. + +:: + + var red = Color.from_rgba8(255, 0, 0) # Same as Color(1, 0, 0). + var dark_blue = Color.from_rgba8(0, 0, 51) # Same as Color(0, 0, 0.2). + var my_color = Color.from_rgba8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4). + +\ **Note:** Due to the lower precision of :ref:`from_rgba8()` compared to the standard **Color** constructor, a color created with :ref:`from_rgba8()` will generally not be equal to the same color created with the standard **Color** constructor. Use :ref:`is_equal_approx()` for comparisons to avoid issues with floating-point precision error. + .. rst-class:: classref-item-separator ---- @@ -1827,7 +1849,7 @@ If you want to create a color from String in a constant expression, use the equi Returns the light intensity of the color, as a value between 0.0 and 1.0 (inclusive). 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 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. +\ **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. .. rst-class:: classref-item-separator @@ -1839,7 +1861,7 @@ Returns the light intensity of the color, as a value between 0.0 and 1.0 (inclus :ref:`Color` **hex**\ (\ hex\: :ref:`int`\ ) |static| :ref:`πŸ”—` -Returns the **Color** associated with the provided ``hex`` integer in 32-bit RGBA format (8 bits per channel). This method is the inverse of :ref:`to_rgba32`. +Returns the **Color** associated with the provided ``hex`` integer in 32-bit RGBA format (8 bits per channel). This method is the inverse of :ref:`to_rgba32()`. In GDScript and C#, the :ref:`int` is best visualized with hexadecimal notation (``"0x"`` prefix, making it ``"0xRRGGBBAA"``). @@ -1872,7 +1894,7 @@ If you want to use hex notation in a constant expression, use the equivalent con :ref:`Color` **hex64**\ (\ hex\: :ref:`int`\ ) |static| :ref:`πŸ”—` -Returns the **Color** associated with the provided ``hex`` integer in 64-bit RGBA format (16 bits per channel). This method is the inverse of :ref:`to_rgba64`. +Returns the **Color** associated with the provided ``hex`` integer in 64-bit RGBA format (16 bits per channel). This method is the inverse of :ref:`to_rgba64()`. In GDScript and C#, the :ref:`int` is best visualized with hexadecimal notation (``"0x"`` prefix, making it ``"0xRRRRGGGGBBBBAAAA"``). @@ -1917,7 +1939,7 @@ Returns a new color from ``rgba``, an HTML hexadecimal color string. ``rgba`` is :ref:`bool` **html_is_valid**\ (\ color\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Returns ``true`` if ``color`` is a valid HTML hexadecimal color string. The string must be a hexadecimal value (case-insensitive) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign (``#``). This method is identical to :ref:`String.is_valid_html_color`. +Returns ``true`` if ``color`` is a valid HTML hexadecimal color string. The string must be a hexadecimal value (case-insensitive) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign (``#``). This method is identical to :ref:`String.is_valid_html_color()`. .. tabs:: @@ -1983,7 +2005,7 @@ Returns the color with its :ref:`r`, :ref:`g` **is_equal_approx**\ (\ to\: :ref:`Color`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if this color and ``to`` are approximately equal, by running :ref:`@GlobalScope.is_equal_approx` on each component. +Returns ``true`` if this color and ``to`` are approximately equal, by running :ref:`@GlobalScope.is_equal_approx()` on each component. .. rst-class:: classref-item-separator @@ -1995,7 +2017,7 @@ Returns ``true`` if this color and ``to`` are approximately equal, by running :r :ref:`Color` **lerp**\ (\ to\: :ref:`Color`, weight\: :ref:`float`\ ) |const| :ref:`πŸ”—` -Returns the linear interpolation between this color's components and ``to``'s components. The interpolation factor ``weight`` should be between 0.0 and 1.0 (inclusive). See also :ref:`@GlobalScope.lerp`. +Returns the linear interpolation between this color's components and ``to``'s components. The interpolation factor ``weight`` should be between 0.0 and 1.0 (inclusive). See also :ref:`@GlobalScope.lerp()`. .. tabs:: @@ -2030,7 +2052,7 @@ Returns the linear interpolation between this color's components and ``to``'s co :ref:`Color` **lightened**\ (\ amount\: :ref:`float`\ ) |const| :ref:`πŸ”—` -Returns a new color resulting from making this color lighter by the specified ``amount``, which should be a ratio from 0.0 to 1.0. See also :ref:`darkened`. +Returns a new color resulting from making this color lighter by the specified ``amount``, which should be a ratio from 0.0 to 1.0. See also :ref:`darkened()`. .. tabs:: @@ -2057,7 +2079,7 @@ Returns a new color resulting from making this color lighter by the specified `` :ref:`Color` **linear_to_srgb**\ (\ ) |const| :ref:`πŸ”—` -Returns the color converted to the `sRGB `__ color space. This method assumes the original color is in the linear color space. See also :ref:`srgb_to_linear` which performs the opposite operation. +Returns the color converted to the `sRGB `__ color space. This method assumes the original color is in the linear color space. See also :ref:`srgb_to_linear()` which performs the opposite operation. .. rst-class:: classref-item-separator @@ -2069,7 +2091,7 @@ Returns the color converted to the `sRGB `__ :ref:`Color` **srgb_to_linear**\ (\ ) |const| :ref:`πŸ”—` -Returns the color converted to the linear color space. This method assumes the original color already is in the sRGB color space. See also :ref:`linear_to_srgb` which performs the opposite operation. +Returns the color converted to the linear color space. This method assumes the original color already is in the sRGB color space. See also :ref:`linear_to_srgb()` which performs the opposite operation. .. rst-class:: classref-item-separator @@ -2220,7 +2242,7 @@ Setting ``with_alpha`` to ``false``, excludes alpha from the hexadecimal string, :ref:`int` **to_rgba32**\ (\ ) |const| :ref:`πŸ”—` -Returns the color converted to a 32-bit integer in RGBA format (each component is 8 bits). RGBA is Redot's default format. This method is the inverse of :ref:`hex`. +Returns the color converted to a 32-bit integer in RGBA format (each component is 8 bits). RGBA is Redot's default format. This method is the inverse of :ref:`hex()`. .. tabs:: @@ -2247,7 +2269,7 @@ Returns the color converted to a 32-bit integer in RGBA format (each component i :ref:`int` **to_rgba64**\ (\ ) |const| :ref:`πŸ”—` -Returns the color converted to a 64-bit integer in RGBA format (each component is 16 bits). RGBA is Redot's default format. This method is the inverse of :ref:`hex64`. +Returns the color converted to a 64-bit integer in RGBA format (each component is 16 bits). RGBA is Redot's default format. This method is the inverse of :ref:`hex64()`. .. tabs:: @@ -2281,7 +2303,7 @@ Operator Descriptions Returns ``true`` if the colors are not exactly equal. -\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. rst-class:: classref-item-separator @@ -2391,7 +2413,7 @@ Divides each component of the **Color** by the given :ref:`int`. Returns ``true`` if the colors are exactly equal. -\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. rst-class:: classref-item-separator @@ -2427,7 +2449,7 @@ Returns the same value as if the ``+`` was not there. Unary ``+`` does nothing, :ref:`Color` **operator unary-**\ (\ ) :ref:`πŸ”—` -Inverts the given color. This is equivalent to ``Color.WHITE - c`` or ``Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)``. Unlike with :ref:`inverted`, the :ref:`a` component is inverted, too. +Inverts the given color. This is equivalent to ``Color.WHITE - c`` or ``Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)``. Unlike with :ref:`inverted()`, the :ref:`a` component is inverted, too. .. |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_colorpicker.rst b/classes/class_colorpicker.rst index 56c8d995a2e..1940e933fe6 100644 --- a/classes/class_colorpicker.rst +++ b/classes/class_colorpicker.rst @@ -115,8 +115,6 @@ Theme Properties +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`color_hue` | | +-----------------------------------+----------------------------------------------------------------------------------------+---------+ - | :ref:`Texture2D` | :ref:`color_okhsl_hue` | | - +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`expanded_arrow` | | +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`folded_arrow` | | @@ -127,6 +125,8 @@ Theme Properties +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`picker_cursor` | | +-----------------------------------+----------------------------------------------------------------------------------------+---------+ + | :ref:`Texture2D` | :ref:`picker_cursor_bg` | | + +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`sample_bg` | | +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`sample_revert` | | @@ -708,18 +708,6 @@ Custom texture for the hue selection slider on the right. ---- -.. _class_ColorPicker_theme_icon_color_okhsl_hue: - -.. rst-class:: classref-themeproperty - -:ref:`Texture2D` **color_okhsl_hue** :ref:`πŸ”—` - -Custom texture for the H slider in the OKHSL color mode. - -.. rst-class:: classref-item-separator - ----- - .. _class_ColorPicker_theme_icon_expanded_arrow: .. rst-class:: classref-themeproperty @@ -780,6 +768,18 @@ The image displayed over the color box/circle (depending on the :ref:`picker_sha ---- +.. _class_ColorPicker_theme_icon_picker_cursor_bg: + +.. rst-class:: classref-themeproperty + +:ref:`Texture2D` **picker_cursor_bg** :ref:`πŸ”—` + +The fill image displayed behind the picker cursor. + +.. rst-class:: classref-item-separator + +---- + .. _class_ColorPicker_theme_icon_sample_bg: .. rst-class:: classref-themeproperty diff --git a/classes/class_compositoreffect.rst b/classes/class_compositoreffect.rst index d0191447b80..91aaef8e3b1 100644 --- a/classes/class_compositoreffect.rst +++ b/classes/class_compositoreffect.rst @@ -151,7 +151,7 @@ Property Descriptions If ``true`` and MSAA is enabled, this will trigger a color buffer resolve before the effect is run. -\ **Note:** In :ref:`_render_callback`, to access the resolved buffer use: +\ **Note:** In :ref:`_render_callback()`, to access the resolved buffer use: :: @@ -175,7 +175,7 @@ If ``true`` and MSAA is enabled, this will trigger a color buffer resolve before If ``true`` and MSAA is enabled, this will trigger a depth buffer resolve before the effect is run. -\ **Note:** In :ref:`_render_callback`, to access the resolved buffer use: +\ **Note:** In :ref:`_render_callback()`, to access the resolved buffer use: :: @@ -233,7 +233,7 @@ If ``true`` this rendering effect is applied to any viewport it is added to. If ``true`` this triggers motion vectors being calculated during the opaque render state. -\ **Note:** In :ref:`_render_callback`, to access the motion vector buffer use: +\ **Note:** In :ref:`_render_callback()`, to access the motion vector buffer use: :: @@ -257,7 +257,7 @@ If ``true`` this triggers motion vectors being calculated during the opaque rend If ``true`` this triggers normal and roughness data to be output during our depth pre-pass, only applicable for the Forward+ renderer. -\ **Note:** In :ref:`_render_callback`, to access the roughness buffer use: +\ **Note:** In :ref:`_render_callback()`, to access the roughness buffer use: :: diff --git a/classes/class_configfile.rst b/classes/class_configfile.rst index 775b2b149fc..6823dd40db0 100644 --- a/classes/class_configfile.rst +++ b/classes/class_configfile.rst @@ -114,7 +114,7 @@ This example shows how the above file could be loaded: -Any operation that mutates the ConfigFile such as :ref:`set_value`, :ref:`clear`, or :ref:`erase_section`, only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with :ref:`save`, :ref:`save_encrypted`, or :ref:`save_encrypted_pass`. +Any operation that mutates the ConfigFile such as :ref:`set_value()`, :ref:`clear()`, or :ref:`erase_section()`, only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with :ref:`save()`, :ref:`save_encrypted()`, or :ref:`save_encrypted_pass()`. Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. diff --git a/classes/class_confirmationdialog.rst b/classes/class_confirmationdialog.rst index 07d76d6ee8c..f6a4656e488 100644 --- a/classes/class_confirmationdialog.rst +++ b/classes/class_confirmationdialog.rst @@ -88,7 +88,7 @@ Property Descriptions - |void| **set_cancel_button_text**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_cancel_button_text**\ (\ ) -The text displayed by the cancel button (see :ref:`get_cancel_button`). +The text displayed by the cancel button (see :ref:`get_cancel_button()`). .. rst-class:: classref-section-separator diff --git a/classes/class_control.rst b/classes/class_control.rst index 3f4f20b3ba4..0aef353248a 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -31,17 +31,17 @@ For more information on Redot's UI system, anchors, offsets, and containers, see Redot propagates input events via viewports. Each :ref:`Viewport` is responsible for propagating :ref:`InputEvent`\ s to their child nodes. As the :ref:`SceneTree.root` is a :ref:`Window`, this already happens automatically for all UI elements in your game. -Input events are propagated through the :ref:`SceneTree` from the root node to all child nodes by calling :ref:`Node._input`. For UI elements specifically, it makes more sense to override the virtual method :ref:`_gui_input`, which filters out unrelated input events, such as by checking z-order, :ref:`mouse_filter`, focus, or if the event was inside of the control's bounding box. +Input events are propagated through the :ref:`SceneTree` from the root node to all child nodes by calling :ref:`Node._input()`. For UI elements specifically, it makes more sense to override the virtual method :ref:`_gui_input()`, which filters out unrelated input events, such as by checking z-order, :ref:`mouse_filter`, focus, or if the event was inside of the control's bounding box. -Call :ref:`accept_event` so no other node receives the event. Once you accept an input, it becomes handled so :ref:`Node._unhandled_input` will not process it. +Call :ref:`accept_event()` so no other node receives the event. Once you accept an input, it becomes handled so :ref:`Node._unhandled_input()` will not process it. -Only one **Control** node can be in focus. Only the node in focus will receive events. To get the focus, call :ref:`grab_focus`. **Control** nodes lose focus when another node grabs it, or if you hide the node in focus. +Only one **Control** node can be in focus. Only the node in focus will receive events. To get the focus, call :ref:`grab_focus()`. **Control** nodes lose focus when another node grabs it, or if you hide the node in focus. 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. The :ref:`theme` of a **Control** node affects all of its direct and indirect children (as long as a chain of controls is uninterrupted). To override some of the theme items, call one of the ``add_theme_*_override`` methods, like :ref:`add_theme_font_override`. You can also override theme items in the Inspector. +\ :ref:`Theme` resources change the control's appearance. The :ref:`theme` of a **Control** node affects all of its direct and indirect children (as long as a chain of controls is uninterrupted). To override some of the theme items, call one of the ``add_theme_*_override`` methods, like :ref:`add_theme_font_override()`. You can also override theme items in 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. +\ **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. .. rst-class:: classref-introduction-group @@ -658,7 +658,7 @@ enum **LayoutPreset**: :ref:`πŸ”—` :ref:`LayoutPreset` **PRESET_TOP_LEFT** = ``0`` -Snap all 4 anchors to the top-left of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the top-left of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_TOP_RIGHT: @@ -666,7 +666,7 @@ Snap all 4 anchors to the top-left of the parent control's bounds. Use with :ref :ref:`LayoutPreset` **PRESET_TOP_RIGHT** = ``1`` -Snap all 4 anchors to the top-right of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the top-right of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_BOTTOM_LEFT: @@ -674,7 +674,7 @@ Snap all 4 anchors to the top-right of the parent control's bounds. Use with :re :ref:`LayoutPreset` **PRESET_BOTTOM_LEFT** = ``2`` -Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_BOTTOM_RIGHT: @@ -682,7 +682,7 @@ Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with : :ref:`LayoutPreset` **PRESET_BOTTOM_RIGHT** = ``3`` -Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_CENTER_LEFT: @@ -690,7 +690,7 @@ Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with :ref:`LayoutPreset` **PRESET_CENTER_LEFT** = ``4`` -Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_CENTER_TOP: @@ -698,7 +698,7 @@ Snap all 4 anchors to the center of the left edge of the parent control's bounds :ref:`LayoutPreset` **PRESET_CENTER_TOP** = ``5`` -Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_CENTER_RIGHT: @@ -706,7 +706,7 @@ Snap all 4 anchors to the center of the top edge of the parent control's bounds. :ref:`LayoutPreset` **PRESET_CENTER_RIGHT** = ``6`` -Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_CENTER_BOTTOM: @@ -714,7 +714,7 @@ Snap all 4 anchors to the center of the right edge of the parent control's bound :ref:`LayoutPreset` **PRESET_CENTER_BOTTOM** = ``7`` -Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_CENTER: @@ -722,7 +722,7 @@ Snap all 4 anchors to the center of the bottom edge of the parent control's boun :ref:`LayoutPreset` **PRESET_CENTER** = ``8`` -Snap all 4 anchors to the center of the parent control's bounds. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the center of the parent control's bounds. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_LEFT_WIDE: @@ -730,7 +730,7 @@ Snap all 4 anchors to the center of the parent control's bounds. Use with :ref:` :ref:`LayoutPreset` **PRESET_LEFT_WIDE** = ``9`` -Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_TOP_WIDE: @@ -738,7 +738,7 @@ Snap all 4 anchors to the left edge of the parent control. The left offset becom :ref:`LayoutPreset` **PRESET_TOP_WIDE** = ``10`` -Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_RIGHT_WIDE: @@ -746,7 +746,7 @@ Snap all 4 anchors to the top edge of the parent control. The left offset become :ref:`LayoutPreset` **PRESET_RIGHT_WIDE** = ``11`` -Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_BOTTOM_WIDE: @@ -754,7 +754,7 @@ Snap all 4 anchors to the right edge of the parent control. The right offset bec :ref:`LayoutPreset` **PRESET_BOTTOM_WIDE** = ``12`` -Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_VCENTER_WIDE: @@ -762,7 +762,7 @@ Snap all 4 anchors to the bottom edge of the parent control. The left offset bec :ref:`LayoutPreset` **PRESET_VCENTER_WIDE** = ``13`` -Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_HCENTER_WIDE: @@ -770,7 +770,7 @@ Snap all 4 anchors to a vertical line that cuts the parent control in half. Use :ref:`LayoutPreset` **PRESET_HCENTER_WIDE** = ``14`` -Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with :ref:`set_anchors_preset()`. .. _class_Control_constant_PRESET_FULL_RECT: @@ -778,7 +778,7 @@ Snap all 4 anchors to a horizontal line that cuts the parent control in half. Us :ref:`LayoutPreset` **PRESET_FULL_RECT** = ``15`` -Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the **Control** will fit its parent control. Use with :ref:`set_anchors_preset`. +Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the **Control** will fit its parent control. Use with :ref:`set_anchors_preset()`. .. rst-class:: classref-item-separator @@ -898,7 +898,7 @@ enum **MouseFilter**: :ref:`πŸ”—` :ref:`MouseFilter` **MOUSE_FILTER_STOP** = ``0`` -The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input`. The control will also 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. +The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input()`. The control will also 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. .. _class_Control_constant_MOUSE_FILTER_PASS: @@ -906,9 +906,9 @@ The control will receive mouse movement input events and mouse button input even :ref:`MouseFilter` **MOUSE_FILTER_PASS** = ``1`` -The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input`. The control will also receive the :ref:`mouse_entered` and :ref:`mouse_exited` signals. +The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input()`. The control will also receive the :ref:`mouse_entered` and :ref:`mouse_exited` signals. -If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-:ref:`CanvasItem`, a control with :ref:`MOUSE_FILTER_STOP`, or a :ref:`CanvasItem` with :ref:`CanvasItem.top_level` enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to :ref:`Node._shortcut_input` for further processing. +If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-:ref:`CanvasItem`, a control with :ref:`MOUSE_FILTER_STOP`, or a :ref:`CanvasItem` with :ref:`CanvasItem.top_level` enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to :ref:`Node._shortcut_input()` for further processing. .. _class_Control_constant_MOUSE_FILTER_IGNORE: @@ -916,7 +916,7 @@ If this control does not handle the event, the event will propagate up to its pa :ref:`MouseFilter` **MOUSE_FILTER_IGNORE** = ``2`` -The control will not receive any mouse movement input events nor 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. If a child has :ref:`MOUSE_FILTER_PASS` and an event was passed to this control, the event will further propagate up to the control's parent. +The control will not receive any mouse movement input events nor 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. If a child has :ref:`MOUSE_FILTER_PASS` and an event was passed to this control, the event will further propagate up to the control's parent. \ **Note:** If the control has received :ref:`mouse_entered` but not :ref:`mouse_exited`, changing the :ref:`mouse_filter` to :ref:`MOUSE_FILTER_IGNORE` will cause :ref:`mouse_exited` to be emitted. @@ -970,7 +970,7 @@ enum **Anchor**: :ref:`πŸ”—` :ref:`Anchor` **ANCHOR_BEGIN** = ``0`` -Snaps one of the 4 anchor's sides to the origin of the node's ``Rect``, in the top left. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left`. To change all 4 anchors at once, use :ref:`set_anchors_preset`. +Snaps one of the 4 anchor's sides to the origin of the node's ``Rect``, in the top left. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left`. To change all 4 anchors at once, use :ref:`set_anchors_preset()`. .. _class_Control_constant_ANCHOR_END: @@ -978,7 +978,7 @@ Snaps one of the 4 anchor's sides to the origin of the node's ``Rect``, in the t :ref:`Anchor` **ANCHOR_END** = ``1`` -Snaps one of the 4 anchor's sides to the end of the node's ``Rect``, in the bottom right. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left`. To change all 4 anchors at once, use :ref:`set_anchors_preset`. +Snaps one of the 4 anchor's sides to the end of the node's ``Rect``, in the bottom right. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left`. To change all 4 anchors at once, use :ref:`set_anchors_preset()`. .. rst-class:: classref-item-separator @@ -1004,7 +1004,7 @@ Automatic layout direction, determined from the parent control layout direction. :ref:`LayoutDirection` **LAYOUT_DIRECTION_APPLICATION_LOCALE** = ``1`` -Automatic layout direction, determined from the current locale. +Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language (unless said language is configured as a fallback in :ref:`ProjectSettings.internationalization/locale/fallback`). For all other languages (or if no valid translation file is found by Redot), left-to-right layout direction is used. If using :ref:`TextServerFallback` (:ref:`ProjectSettings.internationalization/rendering/text_driver`), left-to-right layout direction is always used regardless of the language. Right-to-left layout direction can also be forced using :ref:`ProjectSettings.internationalization/rendering/force_right_to_left_layout_direction`. .. _class_Control_constant_LAYOUT_DIRECTION_LTR: @@ -1028,7 +1028,7 @@ Right-to-left layout direction. :ref:`LayoutDirection` **LAYOUT_DIRECTION_SYSTEM_LOCALE** = ``4`` -Automatic layout direction, determined from the system locale. +Automatic layout direction, determined from the system locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language.. For all other languages (or if no valid translation file is found by Redot), left-to-right layout direction is used. If using :ref:`TextServerFallback` (:ref:`ProjectSettings.internationalization/rendering/text_driver`), left-to-right layout direction is always used regardless of the language. .. _class_Control_constant_LAYOUT_DIRECTION_MAX: @@ -1193,7 +1193,7 @@ Sent when the node needs to refresh its theme items. This happens in one of the \ **Note:** As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree. -\ **Note:** This notification is received alongside :ref:`Node.NOTIFICATION_ENTER_TREE`, so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using :ref:`Node.is_node_ready`. +\ **Note:** This notification is received alongside :ref:`Node.NOTIFICATION_ENTER_TREE`, so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using :ref:`Node.is_node_ready()`. :: @@ -1229,7 +1229,7 @@ Sent when this node is inside a :ref:`ScrollContainer` wh **NOTIFICATION_LAYOUT_DIRECTION_CHANGED** = ``49`` :ref:`πŸ”—` -Sent when control layout direction is changed. +Sent when the control layout direction is changed from LTR or RTL or vice versa. This notification is propagated to child Control nodes as result of a change to :ref:`layout_direction`. .. rst-class:: classref-section-separator @@ -1351,7 +1351,7 @@ Enables whether rendering of :ref:`CanvasItem` based children - |void| **set_custom_minimum_size**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_custom_minimum_size**\ (\ ) -The minimum size of the node's bounding rectangle. If you set it to a value greater than ``(0, 0)``, the node's bounding rectangle will always have at least this size. Note that **Control** nodes have their internal minimum size returned by :ref:`get_minimum_size`. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see :ref:`get_combined_minimum_size`). +The minimum size of the node's bounding rectangle. If you set it to a value greater than ``(0, 0)``, the node's bounding rectangle will always have at least this size. Note that **Control** nodes have their internal minimum size returned by :ref:`get_minimum_size()`. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see :ref:`get_combined_minimum_size()`). .. rst-class:: classref-item-separator @@ -1541,7 +1541,7 @@ Controls the direction on the vertical axis in which the control should grow if - |void| **set_layout_direction**\ (\ value\: :ref:`LayoutDirection`\ ) - :ref:`LayoutDirection` **get_layout_direction**\ (\ ) -Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). +Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also :ref:`is_layout_rtl()`. .. rst-class:: classref-item-separator @@ -1560,7 +1560,7 @@ Controls layout direction and text writing direction. Right-to-left layouts are If ``true``, automatically converts code line numbers, list indices, :ref:`SpinBox` and :ref:`ProgressBar` values from the Western Arabic (0..9) to the numeral systems used in current locale. -\ **Note:** Numbers within the text are not automatically converted, it can be done manually, using :ref:`TextServer.format_number`. +\ **Note:** Numbers within the text are not automatically converted, it can be done manually, using :ref:`TextServer.format_number()`. .. rst-class:: classref-item-separator @@ -1596,7 +1596,7 @@ The default cursor shape for this control. Useful for Redot plugins and applicat - |void| **set_mouse_filter**\ (\ value\: :ref:`MouseFilter`\ ) - :ref:`MouseFilter` **get_mouse_filter**\ (\ ) -Controls whether the control will be able to receive mouse button input events through :ref:`_gui_input` and how these events should be handled. Also controls whether the control can receive the :ref:`mouse_entered`, and :ref:`mouse_exited` signals. See the constants to learn what each does. +Controls whether the control will be able to receive mouse button input events through :ref:`_gui_input()` and how these events should be handled. Also controls whether the control can receive the :ref:`mouse_entered`, and :ref:`mouse_exited` signals. See the constants to learn what each does. .. rst-class:: classref-item-separator @@ -1613,9 +1613,9 @@ Controls whether the control will be able to receive mouse button input events t - |void| **set_force_pass_scroll_events**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_force_pass_scroll_events**\ (\ ) -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`. +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`. -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. +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. \ **Note:** Because this property defaults to ``true``, this allows nested scrollable containers to work out of the box. @@ -1907,7 +1907,7 @@ The :ref:`Theme` resource this node and all its **Control** and :re The name of a theme type variation used by this **Control** to look up its own theme items. When empty, the class name of the node is used (e.g. ``Button`` for the :ref:`Button` control), as well as the class names of all parent classes (in order of inheritance). -When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See :ref:`Theme.set_type_variation`. If the theme item cannot be found using this type or its base types, lookup falls back on the class names. +When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See :ref:`Theme.set_type_variation()`. If the theme item cannot be found using this type or its base types, lookup falls back on the class names. \ **Note:** To look up **Control**'s own items use various ``get_theme_*`` methods without specifying ``theme_type``. @@ -1930,7 +1930,7 @@ When set, this property gives the highest priority to the type of the specified Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to :ref:`Node.AUTO_TRANSLATE_MODE_INHERIT`. -\ **Note:** Tooltips customized using :ref:`_make_custom_tooltip` do not use this auto translate mode automatically. +\ **Note:** Tooltips customized using :ref:`_make_custom_tooltip()` do not use this auto translate mode automatically. .. rst-class:: classref-item-separator @@ -1949,9 +1949,9 @@ Defines if tooltip text should automatically change to its translated version de 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` setting. -This string is the default return value of :ref:`get_tooltip`. Override :ref:`_get_tooltip` to generate tooltip text dynamically. Override :ref:`_make_custom_tooltip` to customize the tooltip interface and behavior. +This string is the default return value of :ref:`get_tooltip()`. Override :ref:`_get_tooltip()` to generate tooltip text dynamically. Override :ref:`_make_custom_tooltip()` to customize the tooltip interface and behavior. -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: +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: .. tabs:: @@ -1991,9 +1991,9 @@ Method Descriptions :ref:`bool` **_can_drop_data**\ (\ at_position\: :ref:`Vector2`, data\: :ref:`Variant`\ ) |virtual| |const| :ref:`πŸ”—` -Redot calls this method to test if ``data`` from a control's :ref:`_get_drag_data` can be dropped at ``at_position``. ``at_position`` is local to this control. +Redot calls this method to test if ``data`` from a control's :ref:`_get_drag_data()` can be dropped at ``at_position``. ``at_position`` is local to this control. -This method should only be used to test the data. Process the data in :ref:`_drop_data`. +This method should only be used to test the data. Process the data in :ref:`_drop_data()`. .. tabs:: @@ -2026,7 +2026,7 @@ This method should only be used to test the data. Process the data in :ref:`_dro |void| **_drop_data**\ (\ at_position\: :ref:`Vector2`, data\: :ref:`Variant`\ ) |virtual| :ref:`πŸ”—` -Redot calls this method to pass you the ``data`` from a control's :ref:`_get_drag_data` result. Redot first calls :ref:`_can_drop_data` to test if ``data`` is allowed to drop at ``at_position`` where ``at_position`` is local to this control. +Redot calls this method to pass you the ``data`` from a control's :ref:`_get_drag_data()` result. Redot first calls :ref:`_can_drop_data()` to test if ``data`` is allowed to drop at ``at_position`` where ``at_position`` is local to this control. .. tabs:: @@ -2063,9 +2063,9 @@ Redot calls this method to pass you the ``data`` from a control's :ref:`_get_dra :ref:`Variant` **_get_drag_data**\ (\ at_position\: :ref:`Vector2`\ ) |virtual| :ref:`πŸ”—` -Redot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns ``null`` if there is no data to drag. Controls that want to receive drop data should implement :ref:`_can_drop_data` and :ref:`_drop_data`. ``at_position`` is local to this control. Drag may be forced with :ref:`force_drag`. +Redot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns ``null`` if there is no data to drag. Controls that want to receive drop data should implement :ref:`_can_drop_data()` and :ref:`_drop_data()`. ``at_position`` is local to this control. Drag may be forced with :ref:`force_drag()`. -A preview that will follow the mouse that should represent the data can be set with :ref:`set_drag_preview`. A good time to set the preview is in this method. +A preview that will follow the mouse that should represent the data can be set with :ref:`set_drag_preview()`. A good time to set the preview is in this method. .. tabs:: @@ -2114,9 +2114,9 @@ If not overridden, defaults to :ref:`Vector2.ZERO`. :ref:`String` **_get_tooltip**\ (\ at_position\: :ref:`Vector2`\ ) |virtual| |const| :ref:`πŸ”—` -Virtual method to be implemented by the user. Returns the tooltip text for the position ``at_position`` in control's local coordinates, which will typically appear when the cursor is resting over this control. See :ref:`get_tooltip`. +Virtual method to be implemented by the user. Returns the tooltip text for the position ``at_position`` in control's local coordinates, which will typically appear when the cursor is resting over this control. See :ref:`get_tooltip()`. -\ **Note:** If this method returns an empty :ref:`String` and :ref:`_make_custom_tooltip` is not overridden, no tooltip is displayed. +\ **Note:** If this method returns an empty :ref:`String` and :ref:`_make_custom_tooltip()` is not overridden, no tooltip is displayed. .. rst-class:: classref-item-separator @@ -2128,7 +2128,7 @@ Virtual method to be implemented by the user. Returns the tooltip text for the p |void| **_gui_input**\ (\ event\: :ref:`InputEvent`\ ) |virtual| :ref:`πŸ”—` -Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also :ref:`accept_event`. +Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also :ref:`accept_event()`. \ **Example:** Click on the control to print a message: @@ -2167,7 +2167,7 @@ If the ``event`` inherits :ref:`InputEventMouse`, this me - the control's parent has :ref:`clip_contents` enabled and the ``event``'s position is outside the parent's rectangle; -- the ``event``'s position is outside the control (see :ref:`_has_point`). +- the ``event``'s position is outside the control (see :ref:`_has_point()`). \ **Note:** The ``event``'s position is relative to this control's origin. @@ -2197,17 +2197,17 @@ If not overridden, default behavior is checking if the point is within control's :ref:`Object` **_make_custom_tooltip**\ (\ for_text\: :ref:`String`\ ) |virtual| |const| :ref:`πŸ”—` -Virtual method to be implemented by the user. Returns a **Control** node that should be used as a tooltip instead of the default one. ``for_text`` is the return value of :ref:`get_tooltip`. +Virtual method to be implemented by the user. Returns a **Control** node that should be used as a tooltip instead of the default one. ``for_text`` is the return value of :ref:`get_tooltip()`. The returned node must be of type **Control** or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When ``null`` or a non-Control node is returned, the default tooltip will be used instead. -The returned node will be added as child to a :ref:`PopupPanel`, so you should only provide the contents of that panel. That :ref:`PopupPanel` can be themed using :ref:`Theme.set_stylebox` for the type ``"TooltipPanel"`` (see :ref:`tooltip_text` for an example). +The returned node will be added as child to a :ref:`PopupPanel`, so you should only provide the contents of that panel. That :ref:`PopupPanel` can be themed using :ref:`Theme.set_stylebox()` for the type ``"TooltipPanel"`` (see :ref:`tooltip_text` for an example). \ **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its :ref:`custom_minimum_size` to some non-zero value. \ **Note:** The node (and any relevant children) should have their :ref:`CanvasItem.visible` set to ``true`` when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably. -\ **Note:** If overridden, this method is called even if :ref:`get_tooltip` returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return ``null`` in this method when ``for_text`` is empty. +\ **Note:** If overridden, this method is called even if :ref:`get_tooltip()` returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return ``null`` in this method when ``for_text`` is empty. \ **Example:** Use a constructed node as a tooltip: @@ -2279,7 +2279,7 @@ Returns an :ref:`Array` of :ref:`Vector3i` text ran |void| **accept_event**\ (\ ) :ref:`πŸ”—` -Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to :ref:`Node._unhandled_input` or :ref:`Node._unhandled_key_input`. +Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to :ref:`Node._unhandled_input()` or :ref:`Node._unhandled_key_input()`. \ **Note:** This does not affect the methods in :ref:`Input`, only the way events are propagated. @@ -2293,9 +2293,9 @@ Marks an input event as handled. Once you accept an input event, it stops propag |void| **add_theme_color_override**\ (\ name\: :ref:`StringName`, color\: :ref:`Color`\ ) :ref:`πŸ”—` -Creates a local override for a theme :ref:`Color` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_color_override`. +Creates a local override for a theme :ref:`Color` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_color_override()`. -See also :ref:`get_theme_color`. +See also :ref:`get_theme_color()`. \ **Example:** Override a :ref:`Label`'s color and reset it later: @@ -2332,9 +2332,9 @@ See also :ref:`get_theme_color`. |void| **add_theme_constant_override**\ (\ name\: :ref:`StringName`, constant\: :ref:`int`\ ) :ref:`πŸ”—` -Creates a local override for a theme constant with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_constant_override`. +Creates a local override for a theme constant with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_constant_override()`. -See also :ref:`get_theme_constant`. +See also :ref:`get_theme_constant()`. .. rst-class:: classref-item-separator @@ -2346,9 +2346,9 @@ See also :ref:`get_theme_constant`. |void| **add_theme_font_override**\ (\ name\: :ref:`StringName`, font\: :ref:`Font`\ ) :ref:`πŸ”—` -Creates a local override for a theme :ref:`Font` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_override`. +Creates a local override for a theme :ref:`Font` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_override()`. -See also :ref:`get_theme_font`. +See also :ref:`get_theme_font()`. .. rst-class:: classref-item-separator @@ -2360,9 +2360,9 @@ See also :ref:`get_theme_font`. |void| **add_theme_font_size_override**\ (\ name\: :ref:`StringName`, font_size\: :ref:`int`\ ) :ref:`πŸ”—` -Creates a local override for a theme font size with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_size_override`. +Creates a local override for a theme font size with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_size_override()`. -See also :ref:`get_theme_font_size`. +See also :ref:`get_theme_font_size()`. .. rst-class:: classref-item-separator @@ -2374,9 +2374,9 @@ See also :ref:`get_theme_font_size`. |void| **add_theme_icon_override**\ (\ name\: :ref:`StringName`, texture\: :ref:`Texture2D`\ ) :ref:`πŸ”—` -Creates a local override for a theme icon with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_icon_override`. +Creates a local override for a theme icon with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_icon_override()`. -See also :ref:`get_theme_icon`. +See also :ref:`get_theme_icon()`. .. rst-class:: classref-item-separator @@ -2388,9 +2388,9 @@ See also :ref:`get_theme_icon`. |void| **add_theme_stylebox_override**\ (\ name\: :ref:`StringName`, stylebox\: :ref:`StyleBox`\ ) :ref:`πŸ”—` -Creates a local override for a theme :ref:`StyleBox` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_stylebox_override`. +Creates a local override for a theme :ref:`StyleBox` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_stylebox_override()`. -See also :ref:`get_theme_stylebox`. +See also :ref:`get_theme_stylebox()`. \ **Example:** Modify a property in a :ref:`StyleBox` by duplicating it: @@ -2433,7 +2433,7 @@ See also :ref:`get_theme_stylebox`. |void| **begin_bulk_theme_override**\ (\ ) :ref:`πŸ”—` -Prevents ``*_theme_*_override`` methods from emitting :ref:`NOTIFICATION_THEME_CHANGED` until :ref:`end_bulk_theme_override` is called. +Prevents ``*_theme_*_override`` methods from emitting :ref:`NOTIFICATION_THEME_CHANGED` until :ref:`end_bulk_theme_override()` is called. .. rst-class:: classref-item-separator @@ -2445,7 +2445,7 @@ Prevents ``*_theme_*_override`` methods from emitting :ref:`NOTIFICATION_THEME_C |void| **end_bulk_theme_override**\ (\ ) :ref:`πŸ”—` -Ends a bulk theme override update. See :ref:`begin_bulk_theme_override`. +Ends a bulk theme override update. See :ref:`begin_bulk_theme_override()`. .. rst-class:: classref-item-separator @@ -2483,7 +2483,7 @@ Finds the previous (above in the tree) **Control** that can receive the focus. Finds the next **Control** that can receive the focus on the specified :ref:`Side`. -\ **Note:** This is different from :ref:`get_focus_neighbor`, which returns the path of a specified focus neighbor. +\ **Note:** This is different from :ref:`get_focus_neighbor()`, which returns the path of a specified focus neighbor. .. rst-class:: classref-item-separator @@ -2495,9 +2495,9 @@ Finds the next **Control** that can receive the focus on the specified :ref:`Sid |void| **force_drag**\ (\ data\: :ref:`Variant`, preview\: :ref:`Control`\ ) :ref:`πŸ”—` -Forces drag and bypasses :ref:`_get_drag_data` and :ref:`set_drag_preview` by passing ``data`` and ``preview``. Drag will start even if the mouse is neither over nor pressed on this control. +Forces drag and bypasses :ref:`_get_drag_data()` and :ref:`set_drag_preview()` by passing ``data`` and ``preview``. Drag will start even if the mouse is neither over nor pressed on this control. -The methods :ref:`_can_drop_data` and :ref:`_drop_data` must be implemented on controls that want to receive drop data. +The methods :ref:`_can_drop_data()` and :ref:`_drop_data()` must be implemented on controls that want to receive drop data. .. rst-class:: classref-item-separator @@ -2533,7 +2533,7 @@ Returns :ref:`offset_left` and :ref:`offset_ :ref:`Vector2` **get_combined_minimum_size**\ (\ ) |const| :ref:`πŸ”—` -Returns combined minimum size from :ref:`custom_minimum_size` and :ref:`get_minimum_size`. +Returns combined minimum size from :ref:`custom_minimum_size` and :ref:`get_minimum_size()`. .. rst-class:: classref-item-separator @@ -2571,7 +2571,7 @@ Returns :ref:`offset_right` and :ref:`offse Returns the focus neighbor for the specified :ref:`Side`. A getter method for :ref:`focus_neighbor_bottom`, :ref:`focus_neighbor_left`, :ref:`focus_neighbor_right` and :ref:`focus_neighbor_top`. -\ **Note:** To find the next **Control** on the specific :ref:`Side`, even if a neighbor is not assigned, use :ref:`find_valid_focus_neighbor`. +\ **Note:** To find the next **Control** on the specific :ref:`Side`, even if a neighbor is not assigned, use :ref:`find_valid_focus_neighbor()`. .. rst-class:: classref-item-separator @@ -2687,7 +2687,7 @@ Equals to :ref:`global_position` if the Returns a :ref:`Color` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a color item with the specified ``name`` and ``theme_type``. If ``theme_type`` is omitted the class name of the current control is used as the type, or :ref:`theme_type_variation` if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked. -For the current control its local overrides are considered first (see :ref:`add_theme_color_override`), then its assigned :ref:`theme`. After the current control, each parent control and its assigned :ref:`theme` are considered; controls without a :ref:`theme` assigned are skipped. If no matching :ref:`Theme` is found in the tree, the custom project :ref:`Theme` (see :ref:`ProjectSettings.gui/theme/custom`) and the default :ref:`Theme` are used (see :ref:`ThemeDB`). +For the current control its local overrides are considered first (see :ref:`add_theme_color_override()`), then its assigned :ref:`theme`. After the current control, each parent control and its assigned :ref:`theme` are considered; controls without a :ref:`theme` assigned are skipped. If no matching :ref:`Theme` is found in the tree, the custom project :ref:`Theme` (see :ref:`ProjectSettings.gui/theme/custom`) and the default :ref:`Theme` are used (see :ref:`ThemeDB`). .. tabs:: @@ -2724,7 +2724,7 @@ For the current control its local overrides are considered first (see :ref:`add_ Returns a constant from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a constant item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2738,7 +2738,7 @@ See :ref:`get_theme_color` for details. Returns the default base scale value from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_base_scale` value. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2752,7 +2752,7 @@ See :ref:`get_theme_color` for details. Returns the default font from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_font` value. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2766,7 +2766,7 @@ See :ref:`get_theme_color` for details. Returns the default font size value from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_font_size` value. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2780,7 +2780,7 @@ See :ref:`get_theme_color` for details. Returns a :ref:`Font` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a font item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2794,7 +2794,7 @@ See :ref:`get_theme_color` for details. Returns a font size from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a font size item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2808,7 +2808,7 @@ See :ref:`get_theme_color` for details. Returns an icon from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has an icon item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2822,7 +2822,7 @@ See :ref:`get_theme_color` for details. Returns a :ref:`StyleBox` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a stylebox item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2836,9 +2836,9 @@ See :ref:`get_theme_color` for details. Returns the tooltip text for the position ``at_position`` in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns :ref:`tooltip_text`. -This method can be overridden to customize its behavior. See :ref:`_get_tooltip`. +This method can be overridden to customize its behavior. See :ref:`_get_tooltip()`. -\ **Note:** If this method returns an empty :ref:`String` and :ref:`_make_custom_tooltip` is not overridden, no tooltip is displayed. +\ **Note:** If this method returns an empty :ref:`String` and :ref:`_make_custom_tooltip()` is not overridden, no tooltip is displayed. .. rst-class:: classref-item-separator @@ -2881,7 +2881,7 @@ Creates an :ref:`InputEventMouseButton` that attemp Steal the focus from another control and become the focused control (see :ref:`focus_mode`). -\ **Note:** Using this method together with :ref:`Callable.call_deferred` makes it more reliable, especially when called inside :ref:`Node._ready`. +\ **Note:** Using this method together with :ref:`Callable.call_deferred()` makes it more reliable, especially when called inside :ref:`Node._ready()`. .. rst-class:: classref-item-separator @@ -2907,7 +2907,7 @@ Returns ``true`` if this is the current focused control. See :ref:`focus_mode` in the tree that has a color item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2921,7 +2921,7 @@ See :ref:`get_theme_color` for details. Returns ``true`` if there is a local override for a theme :ref:`Color` with the specified ``name`` in this **Control** node. -See :ref:`add_theme_color_override`. +See :ref:`add_theme_color_override()`. .. rst-class:: classref-item-separator @@ -2935,7 +2935,7 @@ See :ref:`add_theme_color_override` in the tree that has a constant item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2949,7 +2949,7 @@ See :ref:`get_theme_color` for details. Returns ``true`` if there is a local override for a theme constant with the specified ``name`` in this **Control** node. -See :ref:`add_theme_constant_override`. +See :ref:`add_theme_constant_override()`. .. rst-class:: classref-item-separator @@ -2963,7 +2963,7 @@ See :ref:`add_theme_constant_override` in the tree that has a font item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -2977,7 +2977,7 @@ See :ref:`get_theme_color` for details. Returns ``true`` if there is a local override for a theme :ref:`Font` with the specified ``name`` in this **Control** node. -See :ref:`add_theme_font_override`. +See :ref:`add_theme_font_override()`. .. rst-class:: classref-item-separator @@ -2991,7 +2991,7 @@ See :ref:`add_theme_font_override` Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a font size item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -3005,7 +3005,7 @@ See :ref:`get_theme_color` for details. Returns ``true`` if there is a local override for a theme font size with the specified ``name`` in this **Control** node. -See :ref:`add_theme_font_size_override`. +See :ref:`add_theme_font_size_override()`. .. rst-class:: classref-item-separator @@ -3019,7 +3019,7 @@ See :ref:`add_theme_font_size_override` in the tree that has an icon item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -3033,7 +3033,7 @@ See :ref:`get_theme_color` for details. Returns ``true`` if there is a local override for a theme icon with the specified ``name`` in this **Control** node. -See :ref:`add_theme_icon_override`. +See :ref:`add_theme_icon_override()`. .. rst-class:: classref-item-separator @@ -3047,7 +3047,7 @@ See :ref:`add_theme_icon_override` Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a stylebox item with the specified ``name`` and ``theme_type``. -See :ref:`get_theme_color` for details. +See :ref:`get_theme_color()` for details. .. rst-class:: classref-item-separator @@ -3061,7 +3061,7 @@ See :ref:`get_theme_color` for details. Returns ``true`` if there is a local override for a theme :ref:`StyleBox` with the specified ``name`` in this **Control** node. -See :ref:`add_theme_stylebox_override`. +See :ref:`add_theme_stylebox_override()`. .. rst-class:: classref-item-separator @@ -3073,7 +3073,7 @@ See :ref:`add_theme_stylebox_override` **is_drag_successful**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if a drag operation is successful. Alternative to :ref:`Viewport.gui_is_drag_successful`. +Returns ``true`` if a drag operation is successful. Alternative to :ref:`Viewport.gui_is_drag_successful()`. Best used with :ref:`Node.NOTIFICATION_DRAG_END`. @@ -3087,7 +3087,7 @@ Best used with :ref:`Node.NOTIFICATION_DRAG_END` **is_layout_rtl**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if layout is right-to-left. +Returns ``true`` if layout is right-to-left. See also :ref:`layout_direction`. .. rst-class:: classref-item-separator @@ -3111,7 +3111,7 @@ Give up the focus. No other control will be able to receive input. |void| **remove_theme_color_override**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Removes a local override for a theme :ref:`Color` with the specified ``name`` previously added by :ref:`add_theme_color_override` or via the Inspector dock. +Removes a local override for a theme :ref:`Color` with the specified ``name`` previously added by :ref:`add_theme_color_override()` or via the Inspector dock. .. rst-class:: classref-item-separator @@ -3123,7 +3123,7 @@ Removes a local override for a theme :ref:`Color` with the specifie |void| **remove_theme_constant_override**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Removes a local override for a theme constant with the specified ``name`` previously added by :ref:`add_theme_constant_override` or via the Inspector dock. +Removes a local override for a theme constant with the specified ``name`` previously added by :ref:`add_theme_constant_override()` or via the Inspector dock. .. rst-class:: classref-item-separator @@ -3135,7 +3135,7 @@ Removes a local override for a theme constant with the specified ``name`` previo |void| **remove_theme_font_override**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Removes a local override for a theme :ref:`Font` with the specified ``name`` previously added by :ref:`add_theme_font_override` or via the Inspector dock. +Removes a local override for a theme :ref:`Font` with the specified ``name`` previously added by :ref:`add_theme_font_override()` or via the Inspector dock. .. rst-class:: classref-item-separator @@ -3147,7 +3147,7 @@ Removes a local override for a theme :ref:`Font` with the specified |void| **remove_theme_font_size_override**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Removes a local override for a theme font size with the specified ``name`` previously added by :ref:`add_theme_font_size_override` or via the Inspector dock. +Removes a local override for a theme font size with the specified ``name`` previously added by :ref:`add_theme_font_size_override()` or via the Inspector dock. .. rst-class:: classref-item-separator @@ -3159,7 +3159,7 @@ Removes a local override for a theme font size with the specified ``name`` previ |void| **remove_theme_icon_override**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Removes a local override for a theme icon with the specified ``name`` previously added by :ref:`add_theme_icon_override` or via the Inspector dock. +Removes a local override for a theme icon with the specified ``name`` previously added by :ref:`add_theme_icon_override()` or via the Inspector dock. .. rst-class:: classref-item-separator @@ -3171,7 +3171,7 @@ Removes a local override for a theme icon with the specified ``name`` previously |void| **remove_theme_stylebox_override**\ (\ name\: :ref:`StringName`\ ) :ref:`πŸ”—` -Removes a local override for a theme :ref:`StyleBox` with the specified ``name`` previously added by :ref:`add_theme_stylebox_override` or via the Inspector dock. +Removes a local override for a theme :ref:`StyleBox` with the specified ``name`` previously added by :ref:`add_theme_stylebox_override()` or via the Inspector dock. .. rst-class:: classref-item-separator @@ -3183,7 +3183,7 @@ Removes a local override for a theme :ref:`StyleBox` with the sp |void| **reset_size**\ (\ ) :ref:`πŸ”—` -Resets the size to :ref:`get_combined_minimum_size`. This is equivalent to calling ``set_size(Vector2())`` (or any size below the minimum). +Resets the size to :ref:`get_combined_minimum_size()`. This is equivalent to calling ``set_size(Vector2())`` (or any size below the minimum). .. rst-class:: classref-item-separator @@ -3211,7 +3211,7 @@ If ``push_opposite_anchor`` is ``true`` and the opposite anchor overlaps this an |void| **set_anchor_and_offset**\ (\ side\: :ref:`Side`, anchor\: :ref:`float`, offset\: :ref:`float`, push_opposite_anchor\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Works the same as :ref:`set_anchor`, but instead of ``keep_offset`` argument and automatic update of offset, it allows to set the offset yourself (see :ref:`set_offset`). +Works the same as :ref:`set_anchor()`, but instead of ``keep_offset`` argument and automatic update of offset, it allows to set the offset yourself (see :ref:`set_offset()`). .. rst-class:: classref-item-separator @@ -3223,7 +3223,7 @@ Works the same as :ref:`set_anchor`, but instea |void| **set_anchors_and_offsets_preset**\ (\ preset\: :ref:`LayoutPreset`, resize_mode\: :ref:`LayoutPresetMode` = 0, margin\: :ref:`int` = 0\ ) :ref:`πŸ”—` -Sets both anchor preset and offset preset. See :ref:`set_anchors_preset` and :ref:`set_offsets_preset`. +Sets both anchor preset and offset preset. See :ref:`set_anchors_preset()` and :ref:`set_offsets_preset()`. .. rst-class:: classref-item-separator @@ -3265,11 +3265,11 @@ Sets the given callables to be used instead of the control's own drag-and-drop v The arguments for each callable should be exactly the same as their respective virtual methods, which would be: -- ``drag_func`` corresponds to :ref:`_get_drag_data` and requires a :ref:`Vector2`; +- ``drag_func`` corresponds to :ref:`_get_drag_data()` and requires a :ref:`Vector2`; -- ``can_drop_func`` corresponds to :ref:`_can_drop_data` and requires both a :ref:`Vector2` and a :ref:`Variant`; +- ``can_drop_func`` corresponds to :ref:`_can_drop_data()` and requires both a :ref:`Vector2` and a :ref:`Variant`; -- ``drop_func`` corresponds to :ref:`_drop_data` and requires both a :ref:`Vector2` and a :ref:`Variant`. +- ``drop_func`` corresponds to :ref:`_drop_data()` and requires both a :ref:`Vector2` and a :ref:`Variant`. .. rst-class:: classref-item-separator @@ -3281,7 +3281,7 @@ The arguments for each callable should be exactly the same as their respective v |void| **set_drag_preview**\ (\ control\: :ref:`Control`\ ) :ref:`πŸ”—` -Shows the given control at the mouse pointer. A good time to call this method is in :ref:`_get_drag_data`. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. +Shows the given control at the mouse pointer. A good time to call this method is in :ref:`_get_drag_data()`. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. .. tabs:: @@ -3419,7 +3419,7 @@ If ``keep_offsets`` is ``true``, control's anchors will be updated instead of of |void| **update_minimum_size**\ (\ ) :ref:`πŸ”—` -Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with :ref:`get_minimum_size` when the return value is changed. Setting :ref:`custom_minimum_size` directly calls this method automatically. +Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with :ref:`get_minimum_size()` when the return value is changed. Setting :ref:`custom_minimum_size` directly calls this method automatically. .. rst-class:: classref-item-separator @@ -3433,7 +3433,7 @@ Invalidates the size cache in this node and in parent nodes up to top level. Int Moves the mouse cursor to ``position``, relative to :ref:`position` of this **Control**. -\ **Note:** :ref:`warp_mouse` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web. +\ **Note:** :ref:`warp_mouse()` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web. .. |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_convexpolygonshape2d.rst b/classes/class_convexpolygonshape2d.rst index 255b84a079a..ef03ebd0cd8 100644 --- a/classes/class_convexpolygonshape2d.rst +++ b/classes/class_convexpolygonshape2d.rst @@ -73,7 +73,7 @@ Property Descriptions The polygon's list of vertices that form a convex hull. Can be in either clockwise or counterclockwise order. -\ **Warning:** Only set this property to a list of points that actually form a convex hull. Use :ref:`set_point_cloud` to generate the convex hull of an arbitrary set of points. +\ **Warning:** Only set this property to a list of points that actually form a convex hull. Use :ref:`set_point_cloud()` to generate the convex hull of an arbitrary set of points. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedVector2Array` for more details. @@ -92,7 +92,7 @@ Method Descriptions |void| **set_point_cloud**\ (\ point_cloud\: :ref:`PackedVector2Array`\ ) :ref:`πŸ”—` -Based on the set of points provided, this assigns the :ref:`points` property using the convex hull algorithm, removing all unneeded points. See :ref:`Geometry2D.convex_hull` for details. +Based on the set of points provided, this assigns the :ref:`points` property using the convex hull algorithm, removing all unneeded points. See :ref:`Geometry2D.convex_hull()` for details. .. |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_convexpolygonshape3d.rst b/classes/class_convexpolygonshape3d.rst index 6da2de6adf9..31c0fb86a9d 100644 --- a/classes/class_convexpolygonshape3d.rst +++ b/classes/class_convexpolygonshape3d.rst @@ -23,7 +23,7 @@ A 3D convex polyhedron shape, intended for use in physics. Usually used to provi \ **ConvexPolygonShape3D** is *solid*, which means it detects collisions from objects that are fully inside it, unlike :ref:`ConcavePolygonShape3D` which is hollow. This makes it more suitable for both detection and physics. -\ **Convex decomposition:** A concave polyhedron can be split up into several convex polyhedra. This allows dynamic physics bodies to have complex concave collisions (at a performance cost) and can be achieved by using several **ConvexPolygonShape3D** nodes. To generate a convex decomposition from a mesh, select the :ref:`MeshInstance3D` node, go to the **Mesh** menu that appears above the viewport, and choose **Create Multiple Convex Collision Siblings**. Alternatively, :ref:`MeshInstance3D.create_multiple_convex_collisions` can be called in a script to perform this decomposition at run-time. +\ **Convex decomposition:** A concave polyhedron can be split up into several convex polyhedra. This allows dynamic physics bodies to have complex concave collisions (at a performance cost) and can be achieved by using several **ConvexPolygonShape3D** nodes. To generate a convex decomposition from a mesh, select the :ref:`MeshInstance3D` node, go to the **Mesh** menu that appears above the viewport, and choose **Create Multiple Convex Collision Siblings**. Alternatively, :ref:`MeshInstance3D.create_multiple_convex_collisions()` can be called in a script to perform this decomposition at run-time. \ **Performance:** **ConvexPolygonShape3D** is faster to check collisions against compared to :ref:`ConcavePolygonShape3D`, but it is slower than primitive collision shapes such as :ref:`SphereShape3D` and :ref:`BoxShape3D`. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes. diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst index 1a772e52267..27d404b663d 100644 --- a/classes/class_cpuparticles2d.rst +++ b/classes/class_cpuparticles2d.rst @@ -38,137 +38,143 @@ Properties .. table:: :widths: auto - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`int` | :ref:`amount` | ``8`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`angle_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`angle_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`angle_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`angular_velocity_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`angular_velocity_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`angular_velocity_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`anim_offset_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`anim_offset_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`anim_offset_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`anim_speed_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`anim_speed_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`anim_speed_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Color` | :ref:`color` | ``Color(1, 1, 1, 1)`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Gradient` | :ref:`color_initial_ramp` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Gradient` | :ref:`color_ramp` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`damping_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`damping_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`damping_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Vector2` | :ref:`direction` | ``Vector2(1, 0)`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`DrawOrder` | :ref:`draw_order` | ``0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`PackedColorArray` | :ref:`emission_colors` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`PackedVector2Array` | :ref:`emission_normals` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`PackedVector2Array` | :ref:`emission_points` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Vector2` | :ref:`emission_rect_extents` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`EmissionShape` | :ref:`emission_shape` | ``0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`emission_sphere_radius` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`bool` | :ref:`emitting` | ``true`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`explosiveness` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`int` | :ref:`fixed_fps` | ``0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`bool` | :ref:`fract_delta` | ``true`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Vector2` | :ref:`gravity` | ``Vector2(0, 980)`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`hue_variation_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`hue_variation_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`hue_variation_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`initial_velocity_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`initial_velocity_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`lifetime` | ``1.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`lifetime_randomness` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`linear_accel_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`linear_accel_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`linear_accel_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`bool` | :ref:`local_coords` | ``false`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`bool` | :ref:`one_shot` | ``false`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`orbit_velocity_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`orbit_velocity_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`orbit_velocity_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`bool` | :ref:`particle_flag_align_y` | ``false`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`preprocess` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`radial_accel_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`radial_accel_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`radial_accel_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`randomness` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`scale_amount_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`scale_amount_max` | ``1.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`scale_amount_min` | ``1.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`scale_curve_x` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`scale_curve_y` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`speed_scale` | ``1.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`bool` | :ref:`split_scale` | ``false`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`spread` | ``45.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Curve` | :ref:`tangential_accel_curve` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`tangential_accel_max` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`tangential_accel_min` | ``0.0`` | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ - | :ref:`Texture2D` | :ref:`texture` | | - +---------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+ + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`amount` | ``8`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`angle_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`angle_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`angle_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`angular_velocity_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`angular_velocity_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`angular_velocity_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`anim_offset_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`anim_offset_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`anim_offset_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`anim_speed_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`anim_speed_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`anim_speed_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`color` | ``Color(1, 1, 1, 1)`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Gradient` | :ref:`color_initial_ramp` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Gradient` | :ref:`color_ramp` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`damping_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`damping_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`damping_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`direction` | ``Vector2(1, 0)`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`DrawOrder` | :ref:`draw_order` | ``0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PackedColorArray` | :ref:`emission_colors` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`emission_normals` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`emission_points` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`emission_rect_extents` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`EmissionShape` | :ref:`emission_shape` | ``0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`emission_sphere_radius` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`emitting` | ``true`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`explosiveness` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`fixed_fps` | ``0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`fract_delta` | ``true`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`gravity` | ``Vector2(0, 980)`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`hue_variation_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`hue_variation_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`hue_variation_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`initial_velocity_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`initial_velocity_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`lifetime` | ``1.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`lifetime_randomness` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`linear_accel_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`linear_accel_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`linear_accel_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`local_coords` | ``false`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`one_shot` | ``false`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`orbit_velocity_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`orbit_velocity_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`orbit_velocity_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`particle_flag_align_y` | ``false`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PhysicsInterpolationMode` | physics_interpolation_mode | ``2`` (overrides :ref:`Node`) | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`preprocess` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`radial_accel_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`radial_accel_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`radial_accel_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`randomness` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`scale_amount_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`scale_amount_max` | ``1.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`scale_amount_min` | ``1.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`scale_curve_x` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`scale_curve_y` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`seed` | ``0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`speed_scale` | ``1.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`split_scale` | ``false`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`spread` | ``45.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`tangential_accel_curve` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`tangential_accel_max` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`tangential_accel_min` | ``0.0`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Texture2D` | :ref:`texture` | | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_fixed_seed` | ``false`` | + +---------------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -189,7 +195,9 @@ Methods +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_particle_flag`\ (\ particle_flag\: :ref:`ParticleFlags`\ ) |const| | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`restart`\ (\ ) | + | |void| | :ref:`request_particles_process`\ (\ process_time\: :ref:`float`\ ) | + +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`restart`\ (\ keep_seed\: :ref:`bool` = false\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_param_curve`\ (\ param\: :ref:`Parameter`, curve\: :ref:`Curve`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -264,7 +272,7 @@ enum **Parameter**: :ref:`πŸ”—` :ref:`Parameter` **PARAM_INITIAL_LINEAR_VELOCITY** = ``0`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set initial velocity properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set initial velocity properties. .. _class_CPUParticles2D_constant_PARAM_ANGULAR_VELOCITY: @@ -272,7 +280,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANGULAR_VELOCITY** = ``1`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set angular velocity properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set angular velocity properties. .. _class_CPUParticles2D_constant_PARAM_ORBIT_VELOCITY: @@ -280,7 +288,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ORBIT_VELOCITY** = ``2`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set orbital velocity properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set orbital velocity properties. .. _class_CPUParticles2D_constant_PARAM_LINEAR_ACCEL: @@ -288,7 +296,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_LINEAR_ACCEL** = ``3`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set linear acceleration properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set linear acceleration properties. .. _class_CPUParticles2D_constant_PARAM_RADIAL_ACCEL: @@ -296,7 +304,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_RADIAL_ACCEL** = ``4`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set radial acceleration properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set radial acceleration properties. .. _class_CPUParticles2D_constant_PARAM_TANGENTIAL_ACCEL: @@ -304,7 +312,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_TANGENTIAL_ACCEL** = ``5`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set tangential acceleration properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set tangential acceleration properties. .. _class_CPUParticles2D_constant_PARAM_DAMPING: @@ -312,7 +320,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_DAMPING** = ``6`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set damping properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set damping properties. .. _class_CPUParticles2D_constant_PARAM_ANGLE: @@ -320,7 +328,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANGLE** = ``7`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set angle properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set angle properties. .. _class_CPUParticles2D_constant_PARAM_SCALE: @@ -328,7 +336,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_SCALE** = ``8`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set scale properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set scale properties. .. _class_CPUParticles2D_constant_PARAM_HUE_VARIATION: @@ -336,7 +344,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_HUE_VARIATION** = ``9`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set hue variation properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set hue variation properties. .. _class_CPUParticles2D_constant_PARAM_ANIM_SPEED: @@ -344,7 +352,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANIM_SPEED** = ``10`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set animation speed properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set animation speed properties. .. _class_CPUParticles2D_constant_PARAM_ANIM_OFFSET: @@ -352,7 +360,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANIM_OFFSET** = ``11`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set animation offset properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set animation offset properties. .. _class_CPUParticles2D_constant_PARAM_MAX: @@ -378,7 +386,7 @@ enum **ParticleFlags**: :ref:`πŸ”—` :ref:`ParticleFlags` **PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY** = ``0`` -Use with :ref:`set_particle_flag` to set :ref:`particle_flag_align_y`. +Use with :ref:`set_particle_flag()` to set :ref:`particle_flag_align_y`. .. _class_CPUParticles2D_constant_PARTICLE_FLAG_ROTATE_Y: @@ -730,7 +738,7 @@ Each particle's initial color. If :ref:`texture`\ ) - :ref:`Gradient` **get_color_initial_ramp**\ (\ ) -Each particle's initial color will vary along this :ref:`GradientTexture1D` (multiplied with :ref:`color`). +Each particle's initial color will vary along this :ref:`Gradient` (multiplied with :ref:`color`). .. rst-class:: classref-item-separator @@ -747,7 +755,7 @@ Each particle's initial color will vary along this :ref:`GradientTexture1D`\ ) - :ref:`Gradient` **get_color_ramp**\ (\ ) -Each particle's color will vary along this :ref:`Gradient` (multiplied with :ref:`color`). +Each particle's color will vary along this :ref:`Gradient` over its lifetime (multiplied with :ref:`color`). .. rst-class:: classref-item-separator @@ -1477,6 +1485,23 @@ Each particle's vertical scale will vary along this :ref:`Curve`. S ---- +.. _class_CPUParticles2D_property_seed: + +.. rst-class:: classref-property + +:ref:`int` **seed** = ``0`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_seed**\ (\ value\: :ref:`int`\ ) +- :ref:`int` **get_seed**\ (\ ) + +Sets the random seed used by the particle system. Only effective if :ref:`use_fixed_seed` is ``true``. + +.. rst-class:: classref-item-separator + +---- + .. _class_CPUParticles2D_property_speed_scale: .. rst-class:: classref-property @@ -1592,6 +1617,23 @@ Minimum equivalent of :ref:`tangential_accel_max` **use_fixed_seed** = ``false`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_use_fixed_seed**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **get_use_fixed_seed**\ (\ ) + +If ``true``, particles will use the same seed for every simulation using the seed defined in :ref:`seed`. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode. + .. rst-class:: classref-section-separator ---- @@ -1661,14 +1703,30 @@ Returns the enabled state of the given particle flag (see :ref:`ParticleFlags`\ ) :ref:`πŸ”—` + +Requests the particles to process for extra process time during a single frame. + +Useful for particle playback, if used in combination with :ref:`use_fixed_seed` or by calling :ref:`restart()` with parameter ``keep_seed`` set to ``true``. + +.. rst-class:: classref-item-separator + +---- + .. _class_CPUParticles2D_method_restart: .. rst-class:: classref-method -|void| **restart**\ (\ ) :ref:`πŸ”—` +|void| **restart**\ (\ keep_seed\: :ref:`bool` = false\ ) :ref:`πŸ”—` Restarts the particle emitter. +If ``keep_seed`` is ``true``, the current random seed will be preserved. Useful for seeking and playback. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_cpuparticles3d.rst b/classes/class_cpuparticles3d.rst index 99418a53cb4..7c55495c590 100644 --- a/classes/class_cpuparticles3d.rst +++ b/classes/class_cpuparticles3d.rst @@ -175,6 +175,8 @@ Properties +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`Curve` | :ref:`scale_curve_z` | | +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`int` | :ref:`seed` | ``0`` | + +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`float` | :ref:`speed_scale` | ``1.0`` | +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`bool` | :ref:`split_scale` | ``false`` | @@ -187,6 +189,8 @@ Properties +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`float` | :ref:`tangential_accel_min` | ``0.0`` | +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`bool` | :ref:`use_fixed_seed` | ``false`` | + +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`AABB` | :ref:`visibility_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ @@ -211,7 +215,9 @@ Methods +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_particle_flag`\ (\ particle_flag\: :ref:`ParticleFlags`\ ) |const| | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`restart`\ (\ ) | + | |void| | :ref:`request_particles_process`\ (\ process_time\: :ref:`float`\ ) | + +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`restart`\ (\ keep_seed\: :ref:`bool` = false\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_param_curve`\ (\ param\: :ref:`Parameter`, curve\: :ref:`Curve`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -294,7 +300,7 @@ enum **Parameter**: :ref:`πŸ”—` :ref:`Parameter` **PARAM_INITIAL_LINEAR_VELOCITY** = ``0`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set initial velocity properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set initial velocity properties. .. _class_CPUParticles3D_constant_PARAM_ANGULAR_VELOCITY: @@ -302,7 +308,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANGULAR_VELOCITY** = ``1`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set angular velocity properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set angular velocity properties. .. _class_CPUParticles3D_constant_PARAM_ORBIT_VELOCITY: @@ -310,7 +316,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ORBIT_VELOCITY** = ``2`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set orbital velocity properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set orbital velocity properties. .. _class_CPUParticles3D_constant_PARAM_LINEAR_ACCEL: @@ -318,7 +324,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_LINEAR_ACCEL** = ``3`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set linear acceleration properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set linear acceleration properties. .. _class_CPUParticles3D_constant_PARAM_RADIAL_ACCEL: @@ -326,7 +332,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_RADIAL_ACCEL** = ``4`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set radial acceleration properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set radial acceleration properties. .. _class_CPUParticles3D_constant_PARAM_TANGENTIAL_ACCEL: @@ -334,7 +340,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_TANGENTIAL_ACCEL** = ``5`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set tangential acceleration properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set tangential acceleration properties. .. _class_CPUParticles3D_constant_PARAM_DAMPING: @@ -342,7 +348,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_DAMPING** = ``6`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set damping properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set damping properties. .. _class_CPUParticles3D_constant_PARAM_ANGLE: @@ -350,7 +356,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANGLE** = ``7`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set angle properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set angle properties. .. _class_CPUParticles3D_constant_PARAM_SCALE: @@ -358,7 +364,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_SCALE** = ``8`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set scale properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set scale properties. .. _class_CPUParticles3D_constant_PARAM_HUE_VARIATION: @@ -366,7 +372,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_HUE_VARIATION** = ``9`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set hue variation properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set hue variation properties. .. _class_CPUParticles3D_constant_PARAM_ANIM_SPEED: @@ -374,7 +380,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANIM_SPEED** = ``10`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set animation speed properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set animation speed properties. .. _class_CPUParticles3D_constant_PARAM_ANIM_OFFSET: @@ -382,7 +388,7 @@ Use with :ref:`set_param_min`, :ref:` :ref:`Parameter` **PARAM_ANIM_OFFSET** = ``11`` -Use with :ref:`set_param_min`, :ref:`set_param_max`, and :ref:`set_param_curve` to set animation offset properties. +Use with :ref:`set_param_min()`, :ref:`set_param_max()`, and :ref:`set_param_curve()` to set animation offset properties. .. _class_CPUParticles3D_constant_PARAM_MAX: @@ -408,7 +414,7 @@ enum **ParticleFlags**: :ref:`πŸ”—` :ref:`ParticleFlags` **PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY** = ``0`` -Use with :ref:`set_particle_flag` to set :ref:`particle_flag_align_y`. +Use with :ref:`set_particle_flag()` to set :ref:`particle_flag_align_y`. .. _class_CPUParticles3D_constant_PARTICLE_FLAG_ROTATE_Y: @@ -416,7 +422,7 @@ Use with :ref:`set_particle_flag` :ref:`ParticleFlags` **PARTICLE_FLAG_ROTATE_Y** = ``1`` -Use with :ref:`set_particle_flag` to set :ref:`particle_flag_rotate_y`. +Use with :ref:`set_particle_flag()` to set :ref:`particle_flag_rotate_y`. .. _class_CPUParticles3D_constant_PARTICLE_FLAG_DISABLE_Z: @@ -424,7 +430,7 @@ Use with :ref:`set_particle_flag` :ref:`ParticleFlags` **PARTICLE_FLAG_DISABLE_Z** = ``2`` -Use with :ref:`set_particle_flag` to set :ref:`particle_flag_disable_z`. +Use with :ref:`set_particle_flag()` to set :ref:`particle_flag_disable_z`. .. _class_CPUParticles3D_constant_PARTICLE_FLAG_MAX: @@ -768,7 +774,7 @@ Each particle's initial color. - |void| **set_color_initial_ramp**\ (\ value\: :ref:`Gradient`\ ) - :ref:`Gradient` **get_color_initial_ramp**\ (\ ) -Each particle's initial color will vary along this :ref:`GradientTexture1D` (multiplied with :ref:`color`). +Each particle's initial color will vary along this :ref:`Gradient` (multiplied with :ref:`color`). \ **Note:** :ref:`color_initial_ramp` multiplies the particle mesh's vertex colors. To have a visible effect on a :ref:`BaseMaterial3D`, :ref:`BaseMaterial3D.vertex_color_use_as_albedo` *must* be ``true``. For a :ref:`ShaderMaterial`, ``ALBEDO *= COLOR.rgb;`` must be inserted in the shader's ``fragment()`` function. Otherwise, :ref:`color_initial_ramp` will have no visible effect. @@ -787,7 +793,7 @@ Each particle's initial color will vary along this :ref:`GradientTexture1D`\ ) - :ref:`Gradient` **get_color_ramp**\ (\ ) -Each particle's color will vary along this :ref:`GradientTexture1D` over its lifetime (multiplied with :ref:`color`). +Each particle's color will vary along this :ref:`Gradient` over its lifetime (multiplied with :ref:`color`). \ **Note:** :ref:`color_ramp` multiplies the particle mesh's vertex colors. To have a visible effect on a :ref:`BaseMaterial3D`, :ref:`BaseMaterial3D.vertex_color_use_as_albedo` *must* be ``true``. For a :ref:`ShaderMaterial`, ``ALBEDO *= COLOR.rgb;`` must be inserted in the shader's ``fragment()`` function. Otherwise, :ref:`color_ramp` will have no visible effect. @@ -1689,6 +1695,23 @@ Curve for the scale over life, along the z axis. ---- +.. _class_CPUParticles3D_property_seed: + +.. rst-class:: classref-property + +:ref:`int` **seed** = ``0`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_seed**\ (\ value\: :ref:`int`\ ) +- :ref:`int` **get_seed**\ (\ ) + +Sets the random seed used by the particle system. Only effective if :ref:`use_fixed_seed` is ``true``. + +.. rst-class:: classref-item-separator + +---- + .. _class_CPUParticles3D_property_speed_scale: .. rst-class:: classref-property @@ -1791,6 +1814,23 @@ Minimum tangent acceleration. ---- +.. _class_CPUParticles3D_property_use_fixed_seed: + +.. rst-class:: classref-property + +:ref:`bool` **use_fixed_seed** = ``false`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_use_fixed_seed**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **get_use_fixed_seed**\ (\ ) + +If ``true``, particles will use the same seed for every simulation using the seed defined in :ref:`seed`. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode. + +.. rst-class:: classref-item-separator + +---- + .. _class_CPUParticles3D_property_visibility_aabb: .. rst-class:: classref-property @@ -1887,14 +1927,30 @@ Returns the enabled state of the given particle flag (see :ref:`ParticleFlags`\ ) :ref:`πŸ”—` + +Requests the particles to process for extra process time during a single frame. + +Useful for particle playback, if used in combination with :ref:`use_fixed_seed` or by calling :ref:`restart()` with parameter ``keep_seed`` set to ``true``. + +.. rst-class:: classref-item-separator + +---- + .. _class_CPUParticles3D_method_restart: .. rst-class:: classref-method -|void| **restart**\ (\ ) :ref:`πŸ”—` +|void| **restart**\ (\ keep_seed\: :ref:`bool` = false\ ) :ref:`πŸ”—` Restarts the particle emitter. +If ``keep_seed`` is ``true``, the current random seed will be preserved. Useful for seeking and playback. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_crypto.rst b/classes/class_crypto.rst index cb33d1c874b..3f859552aee 100644 --- a/classes/class_crypto.rst +++ b/classes/class_crypto.rst @@ -190,7 +190,7 @@ Generates a :ref:`PackedByteArray` of cryptographically s :ref:`CryptoKey` **generate_rsa**\ (\ size\: :ref:`int`\ ) :ref:`πŸ”—` -Generates an RSA :ref:`CryptoKey` that can be used for creating self-signed certificates and passed to :ref:`StreamPeerTLS.accept_stream`. +Generates an RSA :ref:`CryptoKey` that can be used for creating self-signed certificates and passed to :ref:`StreamPeerTLS.accept_stream()`. .. rst-class:: classref-item-separator diff --git a/classes/class_cryptokey.rst b/classes/class_cryptokey.rst index 6ec058b5633..942dc8153cb 100644 --- a/classes/class_cryptokey.rst +++ b/classes/class_cryptokey.rst @@ -21,7 +21,7 @@ Description The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other :ref:`Resource`. -They can be used to generate a self-signed :ref:`X509Certificate` via :ref:`Crypto.generate_self_signed_certificate` and as private key in :ref:`StreamPeerTLS.accept_stream` along with the appropriate certificate. +They can be used to generate a self-signed :ref:`X509Certificate` via :ref:`Crypto.generate_self_signed_certificate()` and as private key in :ref:`StreamPeerTLS.accept_stream()` along with the appropriate certificate. .. rst-class:: classref-introduction-group diff --git a/classes/class_csgpolygon3d.rst b/classes/class_csgpolygon3d.rst index 40319b8da1a..209e5f35cf2 100644 --- a/classes/class_csgpolygon3d.rst +++ b/classes/class_csgpolygon3d.rst @@ -38,39 +38,41 @@ Properties .. table:: :widths: auto - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`float` | :ref:`depth` | ``1.0`` | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`Material` | :ref:`material` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`Mode` | :ref:`mode` | ``0`` | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`bool` | :ref:`path_continuous_u` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`float` | :ref:`path_interval` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`PathIntervalType` | :ref:`path_interval_type` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`bool` | :ref:`path_joined` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`bool` | :ref:`path_local` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`NodePath` | :ref:`path_node` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`PathRotation` | :ref:`path_rotation` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`float` | :ref:`path_simplify_angle` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`float` | :ref:`path_u_distance` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`PackedVector2Array` | :ref:`polygon` | ``PackedVector2Array(0, 0, 0, 1, 1, 1, 1, 0)`` | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`bool` | :ref:`smooth_faces` | ``false`` | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`float` | :ref:`spin_degrees` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ - | :ref:`int` | :ref:`spin_sides` | | - +-------------------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------+ + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`float` | :ref:`depth` | ``1.0`` | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`Material` | :ref:`material` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`Mode` | :ref:`mode` | ``0`` | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`bool` | :ref:`path_continuous_u` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`float` | :ref:`path_interval` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`PathIntervalType` | :ref:`path_interval_type` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`bool` | :ref:`path_joined` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`bool` | :ref:`path_local` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`NodePath` | :ref:`path_node` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`PathRotation` | :ref:`path_rotation` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`bool` | :ref:`path_rotation_accurate` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`float` | :ref:`path_simplify_angle` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`float` | :ref:`path_u_distance` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`polygon` | ``PackedVector2Array(0, 0, 0, 1, 1, 1, 1, 0)`` | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`bool` | :ref:`smooth_faces` | ``false`` | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`float` | :ref:`spin_degrees` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ + | :ref:`int` | :ref:`spin_sides` | | + +-------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------+ .. rst-class:: classref-section-separator @@ -354,6 +356,23 @@ When :ref:`mode` is :ref:`MODE_PATH` **path_rotation_accurate** :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_path_rotation_accurate**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **get_path_rotation_accurate**\ (\ ) + +When :ref:`mode` is :ref:`MODE_PATH`, if ``true`` the polygon will be rotated according to the proper tangent of the path at the sampled points. If ``false`` an approximation is used, which decreases in accuracy as the number of subdivisions decreases. + +.. rst-class:: classref-item-separator + +---- + .. _class_CSGPolygon3D_property_path_simplify_angle: .. rst-class:: classref-property diff --git a/classes/class_csgshape3d.rst b/classes/class_csgshape3d.rst index b0f946e68e1..0d3f45fdd93 100644 --- a/classes/class_csgshape3d.rst +++ b/classes/class_csgshape3d.rst @@ -29,7 +29,7 @@ Consider baking final CSG operation results into static geometry that replaces t Individual CSG root node results can be baked to nodes with static resources with the editor menu that appears when a CSG root node is selected. -Individual CSG root nodes can also be baked to static resources with scripts by calling :ref:`bake_static_mesh` for the visual mesh or :ref:`bake_collision_shape` for the physics collision. +Individual CSG root nodes can also be baked to static resources with scripts by calling :ref:`bake_static_mesh()` for the visual mesh or :ref:`bake_collision_shape()` for the physics collision. Entire scenes of CSG nodes can be baked to static geometry and exported with the editor gltf scene exporter. diff --git a/classes/class_cubemap.rst b/classes/class_cubemap.rst index 4232255e3af..543cf940f88 100644 --- a/classes/class_cubemap.rst +++ b/classes/class_cubemap.rst @@ -23,15 +23,17 @@ A cubemap is made of 6 textures organized in layers. They are typically used for This resource is typically used as a uniform in custom shaders. Few core Redot methods make use of **Cubemap** resources. -To create such a texture file yourself, reimport your image files using the Redot Editor import presets. The expected image order is X+, X-, Y+, Y-, Z+, Z- (in Redot's coordinate system, so Y+ is "up" and Z- is "forward"). You can use one of the following templates as a base: +To create such a texture file yourself, reimport your image files using the Redot Editor import presets. To create a Cubemap from code, use :ref:`ImageTextureLayered.create_from_images()` on an instance of the Cubemap class. -- `2Γ—3 cubemap template (default layout option) `__\ +The expected image order is X+, X-, Y+, Y-, Z+, Z- (in Redot's coordinate system, so Y+ is "up" and Z- is "forward"). You can use one of the following templates as a base: -- `3Γ—2 cubemap template `__\ +- `2Γ—3 cubemap template (default layout option) `__\ -- `1Γ—6 cubemap template `__\ +- `3Γ—2 cubemap template `__\ -- `6Γ—1 cubemap template `__\ +- `1Γ—6 cubemap template `__\ + +- `6Γ—1 cubemap template `__\ \ **Note:** Redot doesn't support using cubemaps in a :ref:`PanoramaSkyMaterial`. To use a cubemap as a skybox, convert the default :ref:`PanoramaSkyMaterial` to a :ref:`ShaderMaterial` using the **Convert to ShaderMaterial** resource dropdown option, then replace its code with the following: diff --git a/classes/class_cubemaparray.rst b/classes/class_cubemaparray.rst index a9f5aec0550..2eccbf19806 100644 --- a/classes/class_cubemaparray.rst +++ b/classes/class_cubemaparray.rst @@ -23,9 +23,23 @@ Description The primary benefit of **CubemapArray**\ s is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple :ref:`Cubemap`\ s into a shader using a single **CubemapArray**. :ref:`Cubemap`\ s are allocated in adjacent cache regions on the GPU, which makes **CubemapArray**\ s the most efficient way to store multiple :ref:`Cubemap`\ s. -\ **Note:** Redot uses **CubemapArray**\ s internally for many effects, including the :ref:`Sky` if you set :ref:`ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections` to ``true``. To create such a texture file yourself, reimport your image files using the import presets of the File System dock. +Redot uses **CubemapArray**\ s internally for many effects, including the :ref:`Sky` if you set :ref:`ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections` to ``true``. -\ **Note:** **CubemapArray** is not supported in the Compatibility renderer. +To create such a texture file yourself, reimport your image files using the Redot Editor import presets. To create a CubemapArray from code, use :ref:`ImageTextureLayered.create_from_images()` on an instance of the CubemapArray class. + +The expected image order is X+, X-, Y+, Y-, Z+, Z- (in Redot's coordinate system, so Y+ is "up" and Z- is "forward"). You can use one of the following templates as a base: + +- `2Γ—3 cubemap template (default layout option) `__\ + +- `3Γ—2 cubemap template `__\ + +- `1Γ—6 cubemap template `__\ + +- `6Γ—1 cubemap template `__\ + +Multiple layers are stacked on top of each other when using the default vertical import option (with the first layer at the top). Alternatively, you can choose an horizontal layout in the import options (with the first layer at the left). + +\ **Note:** **CubemapArray** is not supported in the Compatibility renderer due to graphics API limitations. .. rst-class:: classref-reftable-group diff --git a/classes/class_curve2d.rst b/classes/class_curve2d.rst index 10dff8229f3..87b89f666b0 100644 --- a/classes/class_curve2d.rst +++ b/classes/class_curve2d.rst @@ -105,7 +105,7 @@ Property Descriptions - |void| **set_bake_interval**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_bake_interval**\ (\ ) -The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the :ref:`get_baked_points` or :ref:`get_baked_length` function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. +The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the :ref:`get_baked_points()` or :ref:`get_baked_length()` function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. .. rst-class:: classref-item-separator @@ -189,7 +189,7 @@ Returns the cache of points as a :ref:`PackedVector2Array` **get_closest_offset**\ (\ to_point\: :ref:`Vector2`\ ) |const| :ref:`πŸ”—` -Returns the closest offset to ``to_point``. This offset is meant to be used in :ref:`sample_baked`. +Returns the closest offset to ``to_point``. This offset is meant to be used in :ref:`sample_baked()`. \ ``to_point`` must be in this curve's local space. @@ -295,7 +295,7 @@ Cubic interpolation tends to follow the curves better, but linear is faster (and :ref:`Transform2D` **sample_baked_with_rotation**\ (\ offset\: :ref:`float` = 0.0, cubic\: :ref:`bool` = false\ ) |const| :ref:`πŸ”—` -Similar to :ref:`sample_baked`, but returns :ref:`Transform2D` that includes a rotation along the curve, with :ref:`Transform2D.origin` as the point position and the :ref:`Transform2D.x` vector pointing in the direction of the path at that point. Returns an empty transform if the length of the curve is ``0``. +Similar to :ref:`sample_baked()`, but returns :ref:`Transform2D` that includes a rotation along the curve, with :ref:`Transform2D.origin` as the point position and the :ref:`Transform2D.x` vector pointing in the direction of the path at that point. Returns an empty transform if the length of the curve is ``0``. :: @@ -316,7 +316,7 @@ Similar to :ref:`sample_baked`, but returns : :ref:`Vector2` **samplef**\ (\ fofs\: :ref:`float`\ ) |const| :ref:`πŸ”—` -Returns the position at the vertex ``fofs``. It calls :ref:`sample` using the integer part of ``fofs`` as ``idx``, and its fractional part as ``t``. +Returns the position at the vertex ``fofs``. It calls :ref:`sample()` using the integer part of ``fofs`` as ``idx``, and its fractional part as ``t``. .. rst-class:: classref-item-separator diff --git a/classes/class_curve3d.rst b/classes/class_curve3d.rst index 48aece00eef..31ec9649f68 100644 --- a/classes/class_curve3d.rst +++ b/classes/class_curve3d.rst @@ -119,7 +119,7 @@ Property Descriptions - |void| **set_bake_interval**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_bake_interval**\ (\ ) -The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the :ref:`get_baked_points` or :ref:`get_baked_length` function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. +The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the :ref:`get_baked_points()` or :ref:`get_baked_length()` function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. .. rst-class:: classref-item-separator @@ -263,7 +263,7 @@ If :ref:`up_vector_enabled` is ``false :ref:`float` **get_closest_offset**\ (\ to_point\: :ref:`Vector3`\ ) |const| :ref:`πŸ”—` -Returns the closest offset to ``to_point``. This offset is meant to be used in :ref:`sample_baked` or :ref:`sample_baked_up_vector`. +Returns the closest offset to ``to_point``. This offset is meant to be used in :ref:`sample_baked()` or :ref:`sample_baked_up_vector()`. \ ``to_point`` must be in this curve's local space. @@ -393,7 +393,7 @@ If the curve has no up vectors, the function sends an error to the console, and :ref:`Transform3D` **sample_baked_with_rotation**\ (\ offset\: :ref:`float` = 0.0, cubic\: :ref:`bool` = false, apply_tilt\: :ref:`bool` = false\ ) |const| :ref:`πŸ”—` -Returns a :ref:`Transform3D` with ``origin`` as point position, ``basis.x`` as sideway vector, ``basis.y`` as up vector, ``basis.z`` as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. See also :ref:`sample_baked`. +Returns a :ref:`Transform3D` with ``origin`` as point position, ``basis.x`` as sideway vector, ``basis.y`` as up vector, ``basis.z`` as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. See also :ref:`sample_baked()`. .. rst-class:: classref-item-separator @@ -405,7 +405,7 @@ Returns a :ref:`Transform3D` with ``origin`` as point positio :ref:`Vector3` **samplef**\ (\ fofs\: :ref:`float`\ ) |const| :ref:`πŸ”—` -Returns the position at the vertex ``fofs``. It calls :ref:`sample` using the integer part of ``fofs`` as ``idx``, and its fractional part as ``t``. +Returns the position at the vertex ``fofs``. It calls :ref:`sample()` using the integer part of ``fofs`` as ``idx``, and its fractional part as ``t``. .. rst-class:: classref-item-separator diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 414acd34735..00df72a60d9 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -185,7 +185,7 @@ The keys of a dictionary can be iterated with the ``for`` keyword: -\ **Note:** Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use :ref:`duplicate`. +\ **Note:** Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use :ref:`duplicate()`. \ **Note:** Erasing elements while iterating over dictionaries is **not** supported and will result in unpredictable behavior. @@ -347,7 +347,7 @@ Creates a typed dictionary from the ``base`` dictionary. A typed dictionary can :ref:`Dictionary` **Dictionary**\ (\ from\: :ref:`Dictionary`\ ) -Returns the same dictionary as ``from``. If you need a copy of the dictionary, use :ref:`duplicate`. +Returns the same dictionary as ``from``. If you need a copy of the dictionary, use :ref:`duplicate()`. .. rst-class:: classref-section-separator @@ -402,7 +402,7 @@ Creates and returns a new copy of the dictionary. If ``deep`` is ``true``, inner Removes the dictionary entry by key, if it exists. Returns ``true`` if the given ``key`` existed in the dictionary, otherwise ``false``. -\ **Note:** Do not erase entries while iterating over the dictionary. You can iterate over the :ref:`keys` array instead. +\ **Note:** Do not erase entries while iterating over the dictionary. You can iterate over the :ref:`keys()` array instead. .. rst-class:: classref-item-separator @@ -416,7 +416,7 @@ Removes the dictionary entry by key, if it exists. Returns ``true`` if the given Finds and returns the first key whose associated value is equal to ``value``, or ``null`` if it is not found. -\ **Note:** ``null`` is also a valid key. If inside the dictionary, :ref:`find_key` may give misleading results. +\ **Note:** ``null`` is also a valid key. If inside the dictionary, :ref:`find_key()` may give misleading results. .. rst-class:: classref-item-separator @@ -440,7 +440,7 @@ Returns the corresponding value for the given ``key`` in the dictionary. If the :ref:`Variant` **get_or_add**\ (\ key\: :ref:`Variant`, default\: :ref:`Variant` = null\ ) :ref:`πŸ”—` -Gets a value and ensures the key is set. If the ``key`` exists in the dictionary, this behaves like :ref:`get`. Otherwise, the ``default`` value is inserted into the dictionary and returned. +Gets a value and ensures the key is set. If the ``key`` exists in the dictionary, this behaves like :ref:`get()`. Otherwise, the ``default`` value is inserted into the dictionary and returned. .. rst-class:: classref-item-separator @@ -452,7 +452,7 @@ Gets a value and ensures the key is set. If the ``key`` exists in the dictionary :ref:`int` **get_typed_key_builtin**\ (\ ) |const| :ref:`πŸ”—` -Returns the built-in :ref:`Variant` type of the typed dictionary's keys as a :ref:`Variant.Type` constant. If the keys are not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed_key`. +Returns the built-in :ref:`Variant` type of the typed dictionary's keys as a :ref:`Variant.Type` constant. If the keys are not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed_key()`. .. rst-class:: classref-item-separator @@ -464,7 +464,7 @@ Returns the built-in :ref:`Variant` type of the typed dictionary' :ref:`StringName` **get_typed_key_class_name**\ (\ ) |const| :ref:`πŸ”—` -Returns the **built-in** class name of the typed dictionary's keys, if the built-in :ref:`Variant` type is :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed_key` and :ref:`Object.get_class`. +Returns the **built-in** class name of the typed dictionary's keys, if the built-in :ref:`Variant` type is :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed_key()` and :ref:`Object.get_class()`. .. rst-class:: classref-item-separator @@ -476,7 +476,7 @@ Returns the **built-in** class name of the typed dictionary's keys, if the built :ref:`Variant` **get_typed_key_script**\ (\ ) |const| :ref:`πŸ”—` -Returns the :ref:`Script` instance associated with this typed dictionary's keys, or ``null`` if it does not exist. See also :ref:`is_typed_key`. +Returns the :ref:`Script` instance associated with this typed dictionary's keys, or ``null`` if it does not exist. See also :ref:`is_typed_key()`. .. rst-class:: classref-item-separator @@ -488,7 +488,7 @@ Returns the :ref:`Script` instance associated with this typed dict :ref:`int` **get_typed_value_builtin**\ (\ ) |const| :ref:`πŸ”—` -Returns the built-in :ref:`Variant` type of the typed dictionary's values as a :ref:`Variant.Type` constant. If the values are not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed_value`. +Returns the built-in :ref:`Variant` type of the typed dictionary's values as a :ref:`Variant.Type` constant. If the values are not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed_value()`. .. rst-class:: classref-item-separator @@ -500,7 +500,7 @@ Returns the built-in :ref:`Variant` type of the typed dictionary' :ref:`StringName` **get_typed_value_class_name**\ (\ ) |const| :ref:`πŸ”—` -Returns the **built-in** class name of the typed dictionary's values, if the built-in :ref:`Variant` type is :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed_value` and :ref:`Object.get_class`. +Returns the **built-in** class name of the typed dictionary's values, if the built-in :ref:`Variant` type is :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed_value()` and :ref:`Object.get_class()`. .. rst-class:: classref-item-separator @@ -512,7 +512,7 @@ Returns the **built-in** class name of the typed dictionary's values, if the bui :ref:`Variant` **get_typed_value_script**\ (\ ) |const| :ref:`πŸ”—` -Returns the :ref:`Script` instance associated with this typed dictionary's values, or ``null`` if it does not exist. See also :ref:`is_typed_value`. +Returns the :ref:`Script` instance associated with this typed dictionary's values, or ``null`` if it does not exist. See also :ref:`is_typed_value()`. .. rst-class:: classref-item-separator @@ -626,7 +626,7 @@ Returns a hashed 32-bit integer value representing the dictionary contents. :ref:`bool` **is_empty**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the dictionary is empty (its size is ``0``). See also :ref:`size`. +Returns ``true`` if the dictionary is empty (its size is ``0``). See also :ref:`size()`. .. rst-class:: classref-item-separator @@ -638,7 +638,7 @@ Returns ``true`` if the dictionary is empty (its size is ``0``). See also :ref:` :ref:`bool` **is_read_only**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the dictionary is read-only. See :ref:`make_read_only`. Dictionaries are automatically read-only if declared with ``const`` keyword. +Returns ``true`` if the dictionary is read-only. See :ref:`make_read_only()`. Dictionaries are automatically read-only if declared with ``const`` keyword. .. rst-class:: classref-item-separator @@ -788,7 +788,7 @@ Adds entries from ``dictionary`` to this dictionary. By default, duplicate keys -\ **Note:** :ref:`merge` is *not* recursive. Nested dictionaries are considered as keys that can be overwritten or not depending on the value of ``overwrite``, but they will never be merged together. +\ **Note:** :ref:`merge()` is *not* recursive. Nested dictionaries are considered as keys that can be overwritten or not depending on the value of ``overwrite``, but they will never be merged together. .. rst-class:: classref-item-separator @@ -800,7 +800,7 @@ Adds entries from ``dictionary`` to this dictionary. By default, duplicate keys :ref:`Dictionary` **merged**\ (\ dictionary\: :ref:`Dictionary`, overwrite\: :ref:`bool` = false\ ) |const| :ref:`πŸ”—` -Returns a copy of this dictionary merged with the other ``dictionary``. By default, duplicate keys are not copied over, unless ``overwrite`` is ``true``. See also :ref:`merge`. +Returns a copy of this dictionary merged with the other ``dictionary``. By default, duplicate keys are not copied over, unless ``overwrite`` is ``true``. See also :ref:`merge()`. This method is useful for quickly making dictionaries with default values: @@ -847,7 +847,7 @@ Sets the value of the element at the given ``key`` to the given ``value``. This :ref:`int` **size**\ (\ ) |const| :ref:`πŸ”—` -Returns the number of entries in the dictionary. Empty dictionaries (``{ }``) always return ``0``. See also :ref:`is_empty`. +Returns the number of entries in the dictionary. Empty dictionaries (``{ }``) always return ``0``. See also :ref:`is_empty()`. .. rst-class:: classref-item-separator @@ -859,7 +859,7 @@ Returns the number of entries in the dictionary. Empty dictionaries (``{ }``) al |void| **sort**\ (\ ) :ref:`πŸ”—` -Sorts the dictionary in-place by key. This can be used to ensure dictionaries with the same contents produce equivalent results when getting the :ref:`keys`, getting the :ref:`values`, and converting to a string. This is also useful when wanting a JSON representation consistent with what is in memory, and useful for storing on a database that requires dictionaries to be sorted. +Sorts the dictionary in-place by key. This can be used to ensure dictionaries with the same contents produce equivalent results when getting the :ref:`keys()`, getting the :ref:`values()`, and converting to a string. This is also useful when wanting a JSON representation consistent with what is in memory, and useful for storing on a database that requires dictionaries to be sorted. .. rst-class:: classref-item-separator @@ -914,7 +914,7 @@ Returns ``true`` if the two dictionaries contain the same keys and values. The o :ref:`Variant` **operator []**\ (\ key\: :ref:`Variant`\ ) :ref:`πŸ”—` -Returns the corresponding value for the given ``key`` in the dictionary. If the entry does not exist, fails and returns ``null``. For safe access, use :ref:`get` or :ref:`has`. +Returns the corresponding value for the given ``key`` in the dictionary. If the entry does not exist, fails and returns ``null``. 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.)` diff --git a/classes/class_diraccess.rst b/classes/class_diraccess.rst index d82b8bc1720..575c16b2337 100644 --- a/classes/class_diraccess.rst +++ b/classes/class_diraccess.rst @@ -89,7 +89,7 @@ Here is an example on how to iterate through the files of a directory: -Keep in mind that file names may change or be remapped after export. If you want to see the actual resource file list as it appears in the editor, use :ref:`ResourceLoader.list_directory` instead. +Keep in mind that file names may change or be remapped after export. If you want to see the actual resource file list as it appears in the editor, use :ref:`ResourceLoader.list_directory()` instead. .. rst-class:: classref-introduction-group @@ -214,7 +214,7 @@ Property Descriptions If ``true``, hidden files are included when navigating the directory. -Affects :ref:`list_dir_begin`, :ref:`get_directories` and :ref:`get_files`. +Affects :ref:`list_dir_begin()`, :ref:`get_directories()` and :ref:`get_files()`. .. rst-class:: classref-item-separator @@ -233,7 +233,7 @@ Affects :ref:`list_dir_begin`, :ref:`get_ If ``true``, ``.`` and ``..`` are included when navigating the directory. -Affects :ref:`list_dir_begin` and :ref:`get_directories`. +Affects :ref:`list_dir_begin()` and :ref:`get_directories()`. .. rst-class:: classref-section-separator @@ -254,7 +254,7 @@ Changes the currently opened directory to the one passed as an argument. The arg Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). -\ **Note:** The new directory must be within the same scope, e.g. when you had opened a directory inside ``res://``, you can't change it to ``user://`` directory. If you need to open a directory in another access scope, use :ref:`open` to create a new instance instead. +\ **Note:** The new directory must be within the same scope, e.g. when you had opened a directory inside ``res://``, you can't change it to ``user://`` directory. If you need to open a directory in another access scope, use :ref:`open()` to create a new instance instead. .. rst-class:: classref-item-separator @@ -282,7 +282,7 @@ Returns one of the :ref:`Error` code constants (:ref:`@ :ref:`Error` **copy_absolute**\ (\ from\: :ref:`String`, to\: :ref:`String`, chmod_flags\: :ref:`int` = -1\ ) |static| :ref:`πŸ”—` -Static version of :ref:`copy`. Supports only absolute paths. +Static version of :ref:`copy()`. Supports only absolute paths. .. rst-class:: classref-item-separator @@ -316,7 +316,7 @@ If ``prefix`` is not empty, it will be prefixed to the directory name, separated If ``keep`` is ``true``, the directory is not deleted when the returned **DirAccess** is freed. -Returns ``null`` if opening the directory failed. You can use :ref:`get_open_error` to check the error that occurred. +Returns ``null`` if opening the directory failed. You can use :ref:`get_open_error()` to check the error that occurred. .. rst-class:: classref-item-separator @@ -328,7 +328,7 @@ Returns ``null`` if opening the directory failed. You can use :ref:`get_open_err :ref:`bool` **current_is_dir**\ (\ ) |const| :ref:`πŸ”—` -Returns whether the current item processed with the last :ref:`get_next` call is a directory (``.`` and ``..`` are considered directories). +Returns whether the current item processed with the last :ref:`get_next()` call is a directory (``.`` and ``..`` are considered directories). .. rst-class:: classref-item-separator @@ -354,7 +354,7 @@ Returns whether the target directory exists. The argument can be relative to the :ref:`bool` **dir_exists_absolute**\ (\ path\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Static version of :ref:`dir_exists`. Supports only absolute paths. +Static version of :ref:`dir_exists()`. Supports only absolute paths. \ **Note:** The returned :ref:`bool` in the editor and after exporting when used on a path in the ``res://`` directory may be different. Some files are converted to engine-specific formats when exported, potentially changing the directory structure. @@ -370,9 +370,9 @@ Static version of :ref:`dir_exists`. Supports Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path. -For a static equivalent, use :ref:`FileAccess.file_exists`. +For a static equivalent, use :ref:`FileAccess.file_exists()`. -\ **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See :ref:`ResourceLoader.exists` for an alternative approach that takes resource remapping into account. +\ **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See :ref:`ResourceLoader.exists()` for an alternative approach that takes resource remapping into account. .. rst-class:: classref-item-separator @@ -396,7 +396,7 @@ Returns the absolute path to the currently opened directory (e.g. ``res://folder :ref:`int` **get_current_drive**\ (\ ) :ref:`πŸ”—` -Returns the currently opened directory's drive index. See :ref:`get_drive_name` to convert returned index to the name of the drive. +Returns the currently opened directory's drive index. See :ref:`get_drive_name()` to convert returned index to the name of the drive. .. rst-class:: classref-item-separator @@ -426,7 +426,7 @@ Affected by :ref:`include_hidden` and : Returns a :ref:`PackedStringArray` containing filenames of the directory contents, excluding files, at the given ``path``. The array is sorted alphabetically. -Use :ref:`get_directories` if you want more control of what gets included. +Use :ref:`get_directories()` if you want more control of what gets included. \ **Note:** The returned directories in the editor and after exporting in the ``res://`` directory may differ as some files are converted to engine-specific formats when exported. @@ -494,7 +494,7 @@ Affected by :ref:`include_hidden`. Returns a :ref:`PackedStringArray` containing filenames of the directory contents, excluding directories, at the given ``path``. The array is sorted alphabetically. -Use :ref:`get_files` if you want more control of what gets included. +Use :ref:`get_files()` if you want more control of what gets included. \ **Note:** When used on a ``res://`` path in an exported project, only the files included in the PCK at the given folder level are returned. In practice, this means that since imported resources are stored in a top-level ``.godot/`` folder, only paths to ``.gd`` and ``.import`` files are returned (plus a few other files, such as ``project.godot`` or ``project.binary`` and the project icon). In an exported project, the list of returned files will also vary depending on :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary`. @@ -510,7 +510,7 @@ Use :ref:`get_files` if you want more control Returns the next element (file or directory) in the current directory. -The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty :ref:`String` and closes the stream automatically (i.e. :ref:`list_dir_end` would not be mandatory in such a case). +The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty :ref:`String` and closes the stream automatically (i.e. :ref:`list_dir_end()` would not be mandatory in such a case). .. rst-class:: classref-item-separator @@ -522,7 +522,7 @@ The name of the file or directory is returned (and not its full path). Once the :ref:`Error` **get_open_error**\ (\ ) |static| :ref:`πŸ”—` -Returns the result of the last :ref:`open` call in the current thread. +Returns the result of the last :ref:`open()` call in the current thread. .. rst-class:: classref-item-separator @@ -588,11 +588,11 @@ Returns ``true`` if the file or directory is a symbolic link, directory junction :ref:`Error` **list_dir_begin**\ (\ ) :ref:`πŸ”—` -Initializes the stream used to list all files and directories using the :ref:`get_next` function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with :ref:`list_dir_end`. +Initializes the stream used to list all files and directories using the :ref:`get_next()` function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with :ref:`list_dir_end()`. Affected by :ref:`include_hidden` and :ref:`include_navigational`. -\ **Note:** The order of files and directories returned by this method is not deterministic, and can vary between operating systems. If you want a list of all files or folders sorted alphabetically, use :ref:`get_files` or :ref:`get_directories`. +\ **Note:** The order of files and directories returned by this method is not deterministic, and can vary between operating systems. If you want a list of all files or folders sorted alphabetically, use :ref:`get_files()` or :ref:`get_directories()`. .. rst-class:: classref-item-separator @@ -604,7 +604,7 @@ Affected by :ref:`include_hidden` and : |void| **list_dir_end**\ (\ ) :ref:`πŸ”—` -Closes the current stream opened with :ref:`list_dir_begin` (whether it has been fully processed with :ref:`get_next` does not matter). +Closes the current stream opened with :ref:`list_dir_begin()` (whether it has been fully processed with :ref:`get_next()` does not matter). .. rst-class:: classref-item-separator @@ -616,7 +616,7 @@ Closes the current stream opened with :ref:`list_dir_begin` **make_dir**\ (\ path\: :ref:`String`\ ) :ref:`πŸ”—` -Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see :ref:`make_dir_recursive`). +Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see :ref:`make_dir_recursive()`). Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). @@ -630,7 +630,7 @@ Returns one of the :ref:`Error` code constants (:ref:`@ :ref:`Error` **make_dir_absolute**\ (\ path\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Static version of :ref:`make_dir`. Supports only absolute paths. +Static version of :ref:`make_dir()`. Supports only absolute paths. .. rst-class:: classref-item-separator @@ -642,7 +642,7 @@ Static version of :ref:`make_dir`. Supports onl :ref:`Error` **make_dir_recursive**\ (\ path\: :ref:`String`\ ) :ref:`πŸ”—` -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. +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 (:ref:`@GlobalScope.OK` on success). @@ -656,7 +656,7 @@ Returns one of the :ref:`Error` code constants (:ref:`@ :ref:`Error` **make_dir_recursive_absolute**\ (\ path\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Static version of :ref:`make_dir_recursive`. Supports only absolute paths. +Static version of :ref:`make_dir_recursive()`. Supports only absolute paths. .. rst-class:: classref-item-separator @@ -670,7 +670,7 @@ Static version of :ref:`make_dir_recursive` to check the error that occurred. +Returns ``null`` if opening the directory failed. You can use :ref:`get_open_error()` to check the error that occurred. .. rst-class:: classref-item-separator @@ -698,7 +698,7 @@ Returns target of the symbolic link. Permanently deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. -If you don't want to delete the file/directory permanently, use :ref:`OS.move_to_trash` instead. +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 (:ref:`@GlobalScope.OK` on success). @@ -712,7 +712,7 @@ Returns one of the :ref:`Error` code constants (:ref:`@ :ref:`Error` **remove_absolute**\ (\ path\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Static version of :ref:`remove`. Supports only absolute paths. +Static version of :ref:`remove()`. Supports only absolute paths. .. rst-class:: classref-item-separator @@ -738,7 +738,7 @@ Returns one of the :ref:`Error` code constants (:ref:`@ :ref:`Error` **rename_absolute**\ (\ from\: :ref:`String`, to\: :ref:`String`\ ) |static| :ref:`πŸ”—` -Static version of :ref:`rename`. Supports only absolute paths. +Static version of :ref:`rename()`. Supports only absolute paths. .. |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_displayserver.rst b/classes/class_displayserver.rst index 6611e3d47f9..2d0928bae33 100644 --- a/classes/class_displayserver.rst +++ b/classes/class_displayserver.rst @@ -272,6 +272,8 @@ Methods +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_system_theme_change_callback`\ (\ callable\: :ref:`Callable`\ ) | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`show_emoji_and_symbol_picker`\ (\ ) |const| | + +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`status_indicator_get_rect`\ (\ id\: :ref:`int`\ ) |const| | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`status_indicator_set_callback`\ (\ id\: :ref:`int`, callback\: :ref:`Callable`\ ) | @@ -408,6 +410,8 @@ Methods +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`window_start_drag`\ (\ window_id\: :ref:`int` = 0\ ) | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`window_start_resize`\ (\ edge\: :ref:`WindowResizeEdge`, window_id\: :ref:`int` = 0\ ) | + +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -504,7 +508,7 @@ Display server supports setting the mouse cursor shape to a custom image. **Wind :ref:`Feature` **FEATURE_NATIVE_DIALOG** = ``9`` -Display server supports spawning text dialogs using the operating system's native look-and-feel. See :ref:`dialog_show`. **Windows, macOS** +Display server supports spawning text dialogs using the operating system's native look-and-feel. See :ref:`dialog_show()`. **Windows, macOS** .. _class_DisplayServer_constant_FEATURE_IME: @@ -592,7 +596,7 @@ Display server supports expanding window content to the title. See :ref:`WINDOW_ :ref:`Feature` **FEATURE_SCREEN_CAPTURE** = ``21`` -Display server supports reading screen pixels. See :ref:`screen_get_pixel`. +Display server supports reading screen pixels. See :ref:`screen_get_pixel()`. .. _class_DisplayServer_constant_FEATURE_STATUS_INDICATOR: @@ -608,7 +612,7 @@ Display server supports application status indicators. :ref:`Feature` **FEATURE_NATIVE_HELP** = ``23`` -Display server supports native help system search callbacks. See :ref:`help_set_search_callbacks`. +Display server supports native help system search callbacks. See :ref:`help_set_search_callbacks()`. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG_INPUT: @@ -616,7 +620,7 @@ Display server supports native help system search callbacks. See :ref:`help_set_ :ref:`Feature` **FEATURE_NATIVE_DIALOG_INPUT** = ``24`` -Display server supports spawning text input dialogs using the operating system's native look-and-feel. See :ref:`dialog_input_text`. **Windows, macOS** +Display server supports spawning text input dialogs using the operating system's native look-and-feel. See :ref:`dialog_input_text()`. **Windows, macOS** .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG_FILE: @@ -624,7 +628,7 @@ Display server supports spawning text input dialogs using the operating system's :ref:`Feature` **FEATURE_NATIVE_DIALOG_FILE** = ``25`` -Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See :ref:`file_dialog_show`. **Windows, macOS, Linux (X11/Wayland), Android** +Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See :ref:`file_dialog_show()`. **Windows, macOS, Linux (X11/Wayland), Android** .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG_FILE_EXTRA: @@ -632,7 +636,7 @@ Display server supports spawning dialogs for selecting files or directories usin :ref:`Feature` **FEATURE_NATIVE_DIALOG_FILE_EXTRA** = ``26`` -The display server supports all features of :ref:`FEATURE_NATIVE_DIALOG_FILE`, with the added functionality of Options and native dialog file access to ``res://`` and ``user://`` paths. See :ref:`file_dialog_show` and :ref:`file_dialog_with_options_show`. **Windows, macOS, Linux (X11/Wayland)** +The display server supports all features of :ref:`FEATURE_NATIVE_DIALOG_FILE`, with the added functionality of Options and native dialog file access to ``res://`` and ``user://`` paths. See :ref:`file_dialog_show()` and :ref:`file_dialog_with_options_show()`. **Windows, macOS, Linux (X11/Wayland)** .. _class_DisplayServer_constant_FEATURE_WINDOW_DRAG: @@ -640,7 +644,7 @@ The display server supports all features of :ref:`FEATURE_NATIVE_DIALOG_FILE` **FEATURE_WINDOW_DRAG** = ``27`` -The display server supports initiating window drag operation on demand. See :ref:`window_start_drag`. +The display server supports initiating window drag and resize operations on demand. See :ref:`window_start_drag()` and :ref:`window_start_resize()`. .. _class_DisplayServer_constant_FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE: @@ -658,6 +662,22 @@ Display server supports :ref:`WINDOW_FLAG_EXCLUDE_FROM_CAPTURE` **FEATURE_NATIVE_DIALOG_FILE_MIME** = ``30`` + +Native file selection dialog supports MIME types as filters. + +.. _class_DisplayServer_constant_FEATURE_EMOJI_AND_SYMBOL_PICKER: + +.. rst-class:: classref-enumeration-constant + +:ref:`Feature` **FEATURE_EMOJI_AND_SYMBOL_PICKER** = ``31`` + +Display server supports system emoji and symbol picker. **Windows, macOS** + .. rst-class:: classref-item-separator ---- @@ -710,6 +730,14 @@ Confines the mouse cursor to the game window, and make it visible. Confines the mouse cursor to the game window, and make it hidden. +.. _class_DisplayServer_constant_MOUSE_MODE_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`MouseMode` **MOUSE_MODE_MAX** = ``5`` + +Max value of the :ref:`MouseMode`. + .. rst-class:: classref-item-separator ---- @@ -1126,6 +1154,8 @@ Full screen window covers the entire display area of a screen and has no border \ **On Linux (X11):** Exclusive full screen mode bypasses compositor. +\ **On Linux (Wayland):** Equivalent to :ref:`WINDOW_MODE_FULLSCREEN`. + \ **Note:** 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. .. rst-class:: classref-item-separator @@ -1144,7 +1174,7 @@ enum **WindowFlags**: :ref:`πŸ”—` :ref:`WindowFlags` **WINDOW_FLAG_RESIZE_DISABLED** = ``0`` -The window can't be resized by dragging its resize grip. It's still possible to resize the window using :ref:`window_set_size`. This flag is ignored for full screen windows. +The window can't be resized by dragging its resize grip. It's still possible to resize the window using :ref:`window_set_size()`. This flag is ignored for full screen windows. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS: @@ -1170,7 +1200,7 @@ The window is floating on top of all other windows. This flag is ignored for ful The window background can be transparent. -\ **Note:** This flag has no effect if :ref:`is_window_transparency_available` returns ``false``. +\ **Note:** This flag has no effect if :ref:`is_window_transparency_available()` returns ``false``. \ **Note:** Transparency support is implemented on Linux (X11/Wayland), macOS, and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. @@ -1188,7 +1218,7 @@ The window can't be focused. No-focus window will ignore all input, except mouse :ref:`WindowFlags` **WINDOW_FLAG_POPUP** = ``5`` -Window is part of menu or :ref:`OptionButton` dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see :ref:`window_set_transient`). +Window is part of menu or :ref:`OptionButton` dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see :ref:`window_set_transient()`). .. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE: @@ -1198,9 +1228,9 @@ Window is part of menu or :ref:`OptionButton` dropdown. This Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons. -Use :ref:`window_set_window_buttons_offset` to adjust minimize/maximize/close buttons offset. +Use :ref:`window_set_window_buttons_offset()` to adjust minimize/maximize/close buttons offset. -Use :ref:`window_get_safe_title_margins` to determine area under the title bar that is not covered by decorations. +Use :ref:`window_get_safe_title_margins()` to determine area under the title bar that is not covered by decorations. \ **Note:** This flag is implemented only on macOS. @@ -1228,7 +1258,7 @@ Window style is overridden, forcing sharp corners. :ref:`WindowFlags` **WINDOW_FLAG_EXCLUDE_FROM_CAPTURE** = ``9`` -Windows is excluded from screenshots taken by :ref:`screen_get_image`, :ref:`screen_get_image_rect`, and :ref:`screen_get_pixel`. +Windows is excluded from screenshots taken by :ref:`screen_get_image()`, :ref:`screen_get_image_rect()`, and :ref:`screen_get_pixel()`. \ **Note:** This flag is implemented on macOS and Windows. @@ -1326,6 +1356,88 @@ Sent when the window title bar decoration is changed (e.g. :ref:`WINDOW_FLAG_EXT ---- +.. _enum_DisplayServer_WindowResizeEdge: + +.. rst-class:: classref-enumeration + +enum **WindowResizeEdge**: :ref:`πŸ”—` + +.. _class_DisplayServer_constant_WINDOW_EDGE_TOP_LEFT: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_TOP_LEFT** = ``0`` + +Top-left edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_TOP: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_TOP** = ``1`` + +Top edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_TOP_RIGHT: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_TOP_RIGHT** = ``2`` + +Top-right edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_LEFT: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_LEFT** = ``3`` + +Left edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_RIGHT: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_RIGHT** = ``4`` + +Right edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_BOTTOM_LEFT: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_BOTTOM_LEFT** = ``5`` + +Bottom-left edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_BOTTOM: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_BOTTOM** = ``6`` + +Bottom edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_BOTTOM_RIGHT: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_BOTTOM_RIGHT** = ``7`` + +Bottom-right edge of a window. + +.. _class_DisplayServer_constant_WINDOW_EDGE_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`WindowResizeEdge` **WINDOW_EDGE_MAX** = ``8`` + +Represents the size of the :ref:`WindowResizeEdge` enum. + +.. rst-class:: classref-item-separator + +---- + .. _enum_DisplayServer_VSyncMode: .. rst-class:: classref-enumeration @@ -1714,7 +1826,7 @@ Creates a new application status indicator with the specified icon, tooltip, and :ref:`CursorShape` **cursor_get_shape**\ (\ ) |const| :ref:`πŸ”—` -Returns the default mouse cursor shape set by :ref:`cursor_set_shape`. +Returns the default mouse cursor shape set by :ref:`cursor_set_shape()`. .. rst-class:: classref-item-separator @@ -1728,7 +1840,7 @@ Returns the default mouse cursor shape set by :ref:`cursor_set_shape` or an :ref:`Image`, and it should not be larger than 256Γ—256 to display correctly. Optionally, ``hotspot`` can be set to offset the image's position relative to the click point. By default, ``hotspot`` is set to the top-left corner of the image. See also :ref:`cursor_set_shape`. +\ ``cursor`` can be either a :ref:`Texture2D` or an :ref:`Image`, and it should not be larger than 256Γ—256 to display correctly. Optionally, ``hotspot`` can be set to offset the image's position relative to the click point. By default, ``hotspot`` is set to the top-left corner of the image. See also :ref:`cursor_set_shape()`. .. rst-class:: classref-item-separator @@ -1740,7 +1852,7 @@ Sets a custom mouse cursor image for the given ``shape``. This means the user's |void| **cursor_set_shape**\ (\ shape\: :ref:`CursorShape`\ ) :ref:`πŸ”—` -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`. +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()`. .. rst-class:: classref-item-separator @@ -1780,7 +1892,7 @@ Shows a text input dialog which uses the operating system's native look-and-feel Shows a text dialog which uses the operating system's native look-and-feel. ``callback`` should accept a single :ref:`int` parameter which corresponds to the index of the pressed button. -\ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG` feature. Supported platforms include macOS and Windows. +\ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG` feature. Supported platforms include macOS, Windows, and Android. .. rst-class:: classref-item-separator @@ -1808,7 +1920,7 @@ Allows the ``process_id`` PID to steal focus from this window. In other words, t Displays OS native dialog for selecting files or directories in the file system. -Each filter string in the ``filters`` array should be formatted like this: ``*.txt,*.doc;Text Files``. The description text of the filter is optional and can be omitted. See also :ref:`FileDialog.filters`. +Each filter string in the ``filters`` array should be formatted like this: ``*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg``. The description text of the filter is optional and can be omitted. It is recommended to set both file extension and MIME type. See also :ref:`FileDialog.filters`. Callbacks have the following arguments: ``status: bool, selected_paths: PackedStringArray, selected_filter_index: int``. **On Android,** callback argument ``selected_filter_index`` is always zero. @@ -1816,13 +1928,13 @@ Callbacks have the following arguments: ``status: bool, selected_paths: PackedSt \ **Note:** ``current_directory`` might be ignored. -\ **Note:** On Android, the filter strings in the ``filters`` array should be specified using MIME types, for example:``image/png, image/jpeg"``. Additionally, the ``mode`` :ref:`FILE_DIALOG_MODE_OPEN_ANY` is not supported on Android. +\ **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types. \ **Note:** On Android and Linux, ``show_hidden`` is ignored. \ **Note:** On Android and macOS, native file dialogs have no title. -\ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions` to get a list of saved bookmarks. +\ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions()` to get a list of saved bookmarks. .. rst-class:: classref-item-separator @@ -1836,7 +1948,7 @@ Callbacks have the following arguments: ``status: bool, selected_paths: PackedSt Displays OS native dialog for selecting files or directories in the file system with additional user selectable options. -Each filter string in the ``filters`` array should be formatted like this: ``*.txt,*.doc;Text Files``. The description text of the filter is optional and can be omitted. See also :ref:`FileDialog.filters`. +Each filter string in the ``filters`` array should be formatted like this: ``*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg``. The description text of the filter is optional and can be omitted. It is recommended to set both file extension and MIME type. See also :ref:`FileDialog.filters`. \ ``options`` is array of :ref:`Dictionary`\ s with the following keys: @@ -1852,11 +1964,13 @@ Callbacks have the following arguments: ``status: bool, selected_paths: PackedSt \ **Note:** ``current_directory`` might be ignored. +\ **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types. + \ **Note:** On Linux (X11), ``show_hidden`` is ignored. \ **Note:** On macOS, native file dialogs have no title. -\ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions` to get a list of saved bookmarks. +\ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions()` to get a list of saved bookmarks. .. rst-class:: classref-item-separator @@ -1868,7 +1982,7 @@ Callbacks have the following arguments: ``status: bool, selected_paths: PackedSt |void| **force_process_and_drop_events**\ (\ ) :ref:`πŸ”—` -Forces window manager processing while ignoring all :ref:`InputEvent`\ s. See also :ref:`process_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. @@ -1910,7 +2024,7 @@ Returns the OS theme base color (default control background). Returns ``Color(0, :ref:`Array`\[:ref:`Rect2`\] **get_display_cutouts**\ (\ ) |const| :ref:`πŸ”—` -Returns an :ref:`Array` of :ref:`Rect2`, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also :ref:`get_display_safe_area`. +Returns an :ref:`Array` of :ref:`Rect2`, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also :ref:`get_display_safe_area()`. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches. @@ -1924,7 +2038,9 @@ Returns an :ref:`Array` of :ref:`Rect2`, each of which :ref:`Rect2i` **get_display_safe_area**\ (\ ) |const| :ref:`πŸ”—` -Returns the unobscured area of the display where interactive controls should be rendered. See also :ref:`get_display_cutouts`. +Returns the unobscured area of the display where interactive controls should be rendered. See also :ref:`get_display_cutouts()`. + +\ **Note:** Currently only implemented on Android and iOS. On other platforms, ``screen_get_usable_rect(SCREEN_OF_MAIN_WINDOW)`` will be returned as a fallback. See also :ref:`screen_get_usable_rect()`. .. rst-class:: classref-item-separator @@ -2000,7 +2116,7 @@ Returns the index of the screen that overlaps the most with the given rectangle. Returns ``true`` if positions of **OK** and **Cancel** buttons are swapped in dialogs. This is enabled by default on Windows 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`. +\ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show()`. .. rst-class:: classref-item-separator @@ -2151,7 +2267,7 @@ Returns index of the inserted item, it's not guaranteed to be the same as ``inde An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask`\ s and :ref:`Key`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`). -\ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked` for more info on how to control it. +\ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked()` for more info on how to control it. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``. @@ -2253,7 +2369,7 @@ Returns index of the inserted item, it's not guaranteed to be the same as ``inde An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask`\ s and :ref:`Key`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`). -\ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked` for more info on how to control it. +\ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked()` for more info on how to control it. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``. @@ -2491,7 +2607,7 @@ Returns the callback of the item accelerator at index ``idx``. **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Returns number of states of a multistate item. See :ref:`global_menu_add_multistate_item` for details. +Returns number of states of a multistate item. See :ref:`global_menu_add_multistate_item()` for details. \ **Note:** This method is implemented only on macOS. @@ -2507,7 +2623,7 @@ Returns number of states of a multistate item. See :ref:`global_menu_add_multist **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item` for details. +Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item()` for details. \ **Note:** This method is implemented only on macOS. @@ -2523,7 +2639,7 @@ Returns the state of a multistate item. See :ref:`global_menu_add_multistate_ite **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_submenu_item` for more info on how to add a submenu. +Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_submenu_item()` for more info on how to add a submenu. \ **Note:** This method is implemented only on macOS. @@ -2539,7 +2655,7 @@ Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_s **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`global_menu_set_item_tag`, which provides a simple way of assigning context data to items. +Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`global_menu_set_item_tag()`, which provides a simple way of assigning context data to items. \ **Note:** This method is implemented only on macOS. @@ -2637,7 +2753,7 @@ Returns ``true`` if the item at index ``idx`` is checked. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked. -See :ref:`global_menu_set_item_disabled` for more info on how to disable an item. +See :ref:`global_menu_set_item_disabled()` for more info on how to disable an item. \ **Note:** This method is implemented only on macOS. @@ -2655,7 +2771,7 @@ See :ref:`global_menu_set_item_disabled` for more info on how to hide an item. +See :ref:`global_menu_set_item_hidden()` for more info on how to hide an item. \ **Note:** This method is implemented only on macOS. @@ -2875,7 +2991,7 @@ Sets the callback of the item at index ``idx``. Callback is emitted when its acc **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Sets number of state of a multistate item. See :ref:`global_menu_add_multistate_item` for details. +Sets number of state of a multistate item. See :ref:`global_menu_add_multistate_item()` for details. \ **Note:** This method is implemented only on macOS. @@ -2909,7 +3025,7 @@ Sets the type of the item at the specified index ``idx`` to radio button. If ``f **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item` for details. +Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item()` for details. \ **Note:** This method is implemented only on macOS. @@ -2941,7 +3057,7 @@ Sets the submenu of the item at index ``idx``. The submenu is the ID of a global **Deprecated:** Use :ref:`NativeMenu` or :ref:`PopupMenu` instead. -Sets the metadata of an item, which may be of any type. You can later get it with :ref:`global_menu_get_item_tag`, which provides a simple way of assigning context data to items. +Sets the metadata of an item, which may be of any type. You can later get it with :ref:`global_menu_get_item_tag()`, which provides a simple way of assigning context data to items. \ **Note:** This method is implemented only on macOS. @@ -3001,7 +3117,7 @@ Registers callables to emit when the menu is respectively about to show or close :ref:`bool` **has_additional_outputs**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` if any additional outputs have been registered via :ref:`register_additional_output`. +Returns ``true`` if any additional outputs have been registered via :ref:`register_additional_output()`. .. rst-class:: classref-item-separator @@ -3235,7 +3351,7 @@ Sets the active keyboard layout. |bitfield|\[:ref:`MouseButtonMask`\] **mouse_get_button_state**\ (\ ) |const| :ref:`πŸ”—` -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`. +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()`. .. rst-class:: classref-item-separator @@ -3247,7 +3363,7 @@ Returns the current state of mouse buttons (whether each button is pressed) as a :ref:`MouseMode` **mouse_get_mode**\ (\ ) |const| :ref:`πŸ”—` -Returns the current mouse mode. See also :ref:`mouse_set_mode`. +Returns the current mouse mode. See also :ref:`mouse_set_mode()`. .. rst-class:: classref-item-separator @@ -3271,7 +3387,7 @@ Returns the mouse cursor's current position in screen coordinates. |void| **mouse_set_mode**\ (\ mouse_mode\: :ref:`MouseMode`\ ) :ref:`πŸ”—` -Sets the current mouse mode. See also :ref:`mouse_get_mode`. +Sets the current mouse mode. See also :ref:`mouse_get_mode()`. .. rst-class:: classref-item-separator @@ -3283,7 +3399,7 @@ Sets the current mouse mode. See also :ref:`mouse_get_mode` -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`. +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`. .. rst-class:: classref-item-separator @@ -3295,7 +3411,7 @@ Perform window manager processing, including input flushing. See also :ref:`forc |void| **register_additional_output**\ (\ object\: :ref:`Object`\ ) :ref:`πŸ”—` -Registers an :ref:`Object` which represents an additional output that will be rendered too, beyond normal windows. The :ref:`Object` is only used as an identifier, which can be later passed to :ref:`unregister_additional_output`. +Registers an :ref:`Object` which represents an additional output that will be rendered too, beyond normal windows. The :ref:`Object` is only used as an identifier, which can be later passed to :ref:`unregister_additional_output()`. This can be used to prevent Redot from skipping rendering when no normal windows are visible. @@ -3384,7 +3500,7 @@ Returns the greatest scale factor of all screens. :ref:`ScreenOrientation` **screen_get_orientation**\ (\ screen\: :ref:`int` = -1\ ) |const| :ref:`πŸ”—` -Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation`. +Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation()`. \ **Note:** This method is implemented on Android and iOS. @@ -3425,7 +3541,7 @@ Returns the screen's top-left corner position in pixels. On multi-monitor setups | | | | +-------------+ +-------+ -See also :ref:`screen_get_size`. +See also :ref:`screen_get_size()`. \ **Note:** On Linux (Wayland) this method always returns ``(0, 0)``. @@ -3441,7 +3557,7 @@ See also :ref:`screen_get_size`. Returns the current refresh rate of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW` (the default value), a screen with the main window will be used. -\ **Note:** Returns ``-1.0`` if the DisplayServer fails to find the refresh rate for the specified screen. On Web, :ref:`screen_get_refresh_rate` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform. +\ **Note:** Returns ``-1.0`` if the DisplayServer fails to find the refresh rate for the specified screen. On Web, :ref:`screen_get_refresh_rate()` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform. To fallback to a default refresh rate if the method fails, try: @@ -3479,7 +3595,7 @@ Returns the scale factor of the specified screen by index. :ref:`Vector2i` **screen_get_size**\ (\ screen\: :ref:`int` = -1\ ) |const| :ref:`πŸ”—` -Returns the screen's size in pixels. See also :ref:`screen_get_position` and :ref:`screen_get_usable_rect`. +Returns the screen's size in pixels. See also :ref:`screen_get_position()` and :ref:`screen_get_usable_rect()`. .. rst-class:: classref-item-separator @@ -3491,7 +3607,7 @@ Returns the screen's size in pixels. See also :ref:`screen_get_position` **screen_get_usable_rect**\ (\ screen\: :ref:`int` = -1\ ) |const| :ref:`πŸ”—` -Returns the portion of the screen that is not obstructed by a status bar in pixels. See also :ref:`screen_get_size`. +Returns the portion of the screen that is not obstructed by a status bar in pixels. See also :ref:`screen_get_size()`. .. rst-class:: classref-item-separator @@ -3503,7 +3619,7 @@ Returns the portion of the screen that is not obstructed by a status bar in pixe :ref:`bool` **screen_is_kept_on**\ (\ ) |const| :ref:`πŸ”—` -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`. +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()`. .. rst-class:: classref-item-separator @@ -3515,7 +3631,7 @@ Returns ``true`` if the screen should never be turned off by the operating syste |void| **screen_set_keep_on**\ (\ enable\: :ref:`bool`\ ) :ref:`πŸ”—` -Sets whether the screen should never be turned off by the operating system's power-saving measures. See also :ref:`screen_is_kept_on`. +Sets whether the screen should never be turned off by the operating system's power-saving measures. See also :ref:`screen_is_kept_on()`. .. rst-class:: classref-item-separator @@ -3527,7 +3643,7 @@ Sets whether the screen should never be turned off by the operating system's pow |void| **screen_set_orientation**\ (\ orientation\: :ref:`ScreenOrientation`, screen\: :ref:`int` = -1\ ) :ref:`πŸ”—` -Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation`. +Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation()`. \ **Note:** On iOS, this method has no effect if :ref:`ProjectSettings.display/window/handheld/orientation` is not set to :ref:`SCREEN_SENSOR`. @@ -3541,7 +3657,7 @@ Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation`\ ) :ref:`πŸ”—` -Sets the window icon (usually displayed in the top-left corner) with an :ref:`Image`. To use icons in the operating system's native format, use :ref:`set_native_icon` instead. +Sets the window icon (usually displayed in the top-left corner) with an :ref:`Image`. To use icons in the operating system's native format, use :ref:`set_native_icon()` instead. \ **Note:** Requires support for :ref:`FEATURE_ICON`. @@ -3555,7 +3671,7 @@ Sets the window icon (usually displayed in the top-left corner) with an :ref:`Im |void| **set_native_icon**\ (\ filename\: :ref:`String`\ ) :ref:`πŸ”—` -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. +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. \ **Note:** Requires support for :ref:`FEATURE_NATIVE_ICON`. @@ -3577,6 +3693,20 @@ Sets the ``callable`` that should be called when system theme settings are chang ---- +.. _class_DisplayServer_method_show_emoji_and_symbol_picker: + +.. rst-class:: classref-method + +|void| **show_emoji_and_symbol_picker**\ (\ ) |const| :ref:`πŸ”—` + +Opens system emoji and symbol picker. + +\ **Note:** This method is implemented on macOS and Windows. + +.. rst-class:: classref-item-separator + +---- + .. _class_DisplayServer_method_status_indicator_get_rect: .. rst-class:: classref-method @@ -3851,7 +3981,7 @@ Adds a callback, which is called when the utterance has started, finished, cance Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first. -- ``voice`` identifier is one of the ``"id"`` values returned by :ref:`tts_get_voices` or one of the values returned by :ref:`tts_get_voices_for_language`. +- ``voice`` identifier is one of the ``"id"`` values returned by :ref:`tts_get_voices()` or one of the values returned by :ref:`tts_get_voices_for_language()`. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest). @@ -3861,7 +3991,7 @@ 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 (X11/Wayland), 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/Wayland), 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. @@ -3895,7 +4025,7 @@ Stops synthesis in progress and removes all utterances from the queue. |void| **unregister_additional_output**\ (\ object\: :ref:`Object`\ ) :ref:`πŸ”—` -Unregisters an :ref:`Object` representing an additional output, that was registered via :ref:`register_additional_output`. +Unregisters an :ref:`Object` representing an additional output, that was registered via :ref:`register_additional_output()`. .. rst-class:: classref-item-separator @@ -3959,7 +4089,7 @@ Shows the virtual keyboard if the platform has one. Sets the mouse cursor position to the given ``position`` relative to an origin at the upper left corner of the currently focused game Window Manager window. -\ **Note:** :ref:`warp_mouse` is only supported on Windows, macOS, and Linux (X11/Wayland). It has no effect on Android, iOS, and Web. +\ **Note:** :ref:`warp_mouse()` is only supported on Windows, macOS, and Linux (X11/Wayland). It has no effect on Android, iOS, and Web. .. rst-class:: classref-item-separator @@ -3995,7 +4125,7 @@ Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID` **window_get_attached_instance_id**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -Returns the :ref:`Object.get_instance_id` of the :ref:`Window` the ``window_id`` is attached to. +Returns the :ref:`Object.get_instance_id()` of the :ref:`Window` the ``window_id`` is attached to. .. rst-class:: classref-item-separator @@ -4007,7 +4137,7 @@ Returns the :ref:`Object.get_instance_id` o :ref:`int` **window_get_current_screen**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -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`. +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()`. .. rst-class:: classref-item-separator @@ -4031,7 +4161,7 @@ Returns the current value of the given window's ``flag``. :ref:`Vector2i` **window_get_max_size**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size`. +Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size()`. .. rst-class:: classref-item-separator @@ -4043,7 +4173,7 @@ Returns the window's maximum size (in pixels). See also :ref:`window_set_max_siz :ref:`Vector2i` **window_get_min_size**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size`. +Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size()`. .. rst-class:: classref-item-separator @@ -4105,7 +4235,7 @@ Returns the position of the client area of the given window on the screen. :ref:`Vector2i` **window_get_position_with_decorations**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -Returns the position of the given window on the screen including the borders drawn by the operating system. See also :ref:`window_get_position`. +Returns the position of the given window on the screen including the borders drawn by the operating system. See also :ref:`window_get_position()`. .. rst-class:: classref-item-separator @@ -4129,7 +4259,7 @@ Returns left margins (``x``), right margins (``y``) and height (``z``) of the ti :ref:`Vector2i` **window_get_size**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -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_size_with_decorations`, :ref:`window_set_size` and :ref:`window_get_position`. +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_size_with_decorations()`, :ref:`window_set_size()` and :ref:`window_get_position()`. .. rst-class:: classref-item-separator @@ -4141,7 +4271,7 @@ Returns the size of the window specified by ``window_id`` (in pixels), excluding :ref:`Vector2i` **window_get_size_with_decorations**\ (\ window_id\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -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`. +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()`. .. rst-class:: classref-item-separator @@ -4255,7 +4385,7 @@ Makes the window specified by ``window_id`` request attention, which is material |void| **window_set_current_screen**\ (\ screen\: :ref:`int`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -Moves the window specified by ``window_id`` to the specified ``screen``. See also :ref:`window_get_current_screen`. +Moves the window specified by ``window_id`` to the specified ``screen``. See also :ref:`window_get_current_screen()`. .. rst-class:: classref-item-separator @@ -4311,7 +4441,7 @@ Enables or disables the given window's given ``flag``. See :ref:`WindowFlags`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -Sets whether `Input Method Editor `__ should be enabled for the window specified by ``window_id``. See also :ref:`window_set_ime_position`. +Sets whether `Input Method Editor `__ should be enabled for the window specified by ``window_id``. See also :ref:`window_set_ime_position()`. .. rst-class:: classref-item-separator @@ -4323,7 +4453,7 @@ Sets whether `Input Method Editor `_ |void| **window_set_ime_position**\ (\ position\: :ref:`Vector2i`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -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``. +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``. .. rst-class:: classref-item-separator @@ -4363,7 +4493,7 @@ Sets the ``callback`` that should be called when text is entered using the virtu |void| **window_set_max_size**\ (\ max_size\: :ref:`Vector2i`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -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 larger than the specified size. See also :ref:`window_get_max_size`. +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 larger than the specified size. See also :ref:`window_get_max_size()`. \ **Note:** It's recommended to change this value using :ref:`Window.max_size` instead. @@ -4379,7 +4509,7 @@ Sets the maximum size of the window specified by ``window_id`` in pixels. Normal |void| **window_set_min_size**\ (\ min_size\: :ref:`Vector2i`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -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 smaller than the specified size. See also :ref:`window_get_min_size`. +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 smaller than the specified size. See also :ref:`window_get_min_size()`. \ **Note:** It's recommended to change this value using :ref:`Window.min_size` instead. @@ -4440,7 +4570,7 @@ Passing an empty array will disable passthrough support (all mouse events will b DisplayServer.WindowSetMousePassthrough(GetNode("Polygon2D").Polygon); // Reset region to default. - DisplayServer.WindowSetMousePassthrough(new Vector2[] {}); + DisplayServer.WindowSetMousePassthrough([]); @@ -4481,7 +4611,7 @@ Sets the position of the given window to ``position``. On multi-monitor setups, | | | | +-------------+ +-------+ -See also :ref:`window_get_position` and :ref:`window_set_size`. +See also :ref:`window_get_position()` and :ref:`window_set_size()`. \ **Note:** It's recommended to change this value using :ref:`Window.position` instead. @@ -4511,7 +4641,7 @@ Sets the ``callback`` that will be called when the window specified by ``window_ |void| **window_set_size**\ (\ size\: :ref:`Vector2i`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -Sets the size of the given window to ``size`` (in pixels). See also :ref:`window_get_size` and :ref:`window_get_position`. +Sets the size of the given window to ``size`` (in pixels). See also :ref:`window_get_size()` and :ref:`window_get_position()`. \ **Note:** It's recommended to change this value using :ref:`Window.size` instead. @@ -4603,9 +4733,23 @@ Sets the ``callback`` that will be called when an event occurs in the window spe |void| **window_start_drag**\ (\ window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` -Starts a drag operation on the window with the given ``window_id``, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features. +Starts an interactive drag operation on the window with the given ``window_id``, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features. -\ **Note:** This method is implemented on Linux(X11/Wayland), macOS, and Windows. +\ **Note:** This method is implemented on Linux (X11/Wayland), macOS, and Windows. + +.. rst-class:: classref-item-separator + +---- + +.. _class_DisplayServer_method_window_start_resize: + +.. rst-class:: classref-method + +|void| **window_start_resize**\ (\ edge\: :ref:`WindowResizeEdge`, window_id\: :ref:`int` = 0\ ) :ref:`πŸ”—` + +Starts an interactive resize operation on the window with the given ``window_id``, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's edge. + +\ **Note:** This method is implemented on Linux (X11/Wayland), macOS, and Windows. .. |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_dtlsserver.rst b/classes/class_dtlsserver.rst index 2d87b3242d0..eeb0e0afef4 100644 --- a/classes/class_dtlsserver.rst +++ b/classes/class_dtlsserver.rst @@ -19,7 +19,7 @@ Helper class to implement a DTLS server. Description ----------- -This class is used to store the state of a DTLS server. Upon :ref:`setup` it converts connected :ref:`PacketPeerUDP` to :ref:`PacketPeerDTLS` accepting them via :ref:`take_connection` as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. +This class is used to store the state of a DTLS server. Upon :ref:`setup()` it converts connected :ref:`PacketPeerUDP` to :ref:`PacketPeerDTLS` accepting them via :ref:`take_connection()` as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. Below a small example of how to use it: @@ -39,7 +39,7 @@ Below a small example of how to use it: server.listen(4242) var key = load("key.key") # Your private key. var cert = load("cert.crt") # Your X509 certificate. - dtls.setup(key, cert) + dtls.setup(TlsOptions.server(key, cert)) func _process(delta): while server.is_connection_available(): @@ -66,19 +66,19 @@ Below a small example of how to use it: { private DtlsServer _dtls = new DtlsServer(); private UdpServer _server = new UdpServer(); - private Godot.Collections.Array _peers = new Godot.Collections.Array(); + private Godot.Collections.Array _peers = []; public override void _Ready() { _server.Listen(4242); var key = GD.Load("key.key"); // Your private key. var cert = GD.Load("cert.crt"); // Your X509 certificate. - _dtls.Setup(key, cert); + _dtls.Setup(TlsOptions.Server(key, cert)); } public override void _Process(double delta) { - while (Server.IsConnectionAvailable()) + while (_server.IsConnectionAvailable()) { PacketPeerUdp peer = _server.TakeConnection(); PacketPeerDtls dtlsPeer = _dtls.TakeConnection(peer); @@ -201,7 +201,7 @@ Method Descriptions :ref:`Error` **setup**\ (\ server_options\: :ref:`TLSOptions`\ ) :ref:`πŸ”—` -Setup the DTLS server to use the given ``server_options``. See :ref:`TLSOptions.server`. +Setup the DTLS server to use the given ``server_options``. See :ref:`TLSOptions.server()`. .. rst-class:: classref-item-separator @@ -213,7 +213,7 @@ Setup the DTLS server to use the given ``server_options``. See :ref:`TLSOptions. :ref:`PacketPeerDTLS` **take_connection**\ (\ udp_peer\: :ref:`PacketPeerUDP`\ ) :ref:`πŸ”—` -Try to initiate the DTLS handshake with the given ``udp_peer`` which must be already connected (see :ref:`PacketPeerUDP.connect_to_host`). +Try to initiate the DTLS handshake with the given ``udp_peer`` which must be already connected (see :ref:`PacketPeerUDP.connect_to_host()`). \ **Note:** You must check that the state of the return PacketPeerUDP is :ref:`PacketPeerDTLS.STATUS_HANDSHAKING`, as it is normal that 50% of the new connections will be invalid due to cookie exchange. diff --git a/classes/class_editorcommandpalette.rst b/classes/class_editorcommandpalette.rst index 6cd27c9d278..f8f335daada 100644 --- a/classes/class_editorcommandpalette.rst +++ b/classes/class_editorcommandpalette.rst @@ -42,7 +42,7 @@ Command key names use slash delimiters to distinguish sections, for example: ``" -\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_command_palette`. +\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_command_palette()`. .. rst-class:: classref-reftable-group diff --git a/classes/class_editorcontextmenuplugin.rst b/classes/class_editorcontextmenuplugin.rst index f5156d6e190..f46422bf2bf 100644 --- a/classes/class_editorcontextmenuplugin.rst +++ b/classes/class_editorcontextmenuplugin.rst @@ -64,7 +64,7 @@ enum **ContextMenuSlot**: :ref:`πŸ”—` **CONTEXT_SLOT_SCENE_TREE** = ``0`` -Context menu of Scene dock. :ref:`_popup_menu` will be called with a list of paths to currently selected nodes, while option callback will receive the list of currently selected nodes. +Context menu of Scene dock. :ref:`_popup_menu()` will be called with a list of paths to currently selected nodes, while option callback will receive the list of currently selected nodes. .. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_FILESYSTEM: @@ -72,7 +72,15 @@ Context menu of Scene dock. :ref:`_popup_menu` **CONTEXT_SLOT_FILESYSTEM** = ``1`` -Context menu of FileSystem dock. :ref:`_popup_menu` and option callback will be called with list of paths of the currently selected files. +Context menu of FileSystem dock. :ref:`_popup_menu()` and option callback will be called with list of paths of the currently selected files. + +.. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_SCRIPT_EDITOR: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SLOT_SCRIPT_EDITOR** = ``2`` + +Context menu of Script editor's script tabs. :ref:`_popup_menu()` will be called with the path to the currently edited script, while option callback will receive reference to that script. .. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_FILESYSTEM_CREATE: @@ -80,15 +88,45 @@ Context menu of FileSystem dock. :ref:`_popup_menu` **CONTEXT_SLOT_FILESYSTEM_CREATE** = ``3`` -The "Create..." submenu of FileSystem dock's context menu. :ref:`_popup_menu` and option callback will be called with list of paths of the currently selected files. +The "Create..." submenu of FileSystem dock's context menu. :ref:`_popup_menu()` and option callback will be called with list of paths of the currently selected files. -.. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_SCRIPT_EDITOR: +.. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_SCRIPT_EDITOR_CODE: .. rst-class:: classref-enumeration-constant -:ref:`ContextMenuSlot` **CONTEXT_SLOT_SCRIPT_EDITOR** = ``2`` +:ref:`ContextMenuSlot` **CONTEXT_SLOT_SCRIPT_EDITOR_CODE** = ``4`` + +Context menu of Script editor's code editor. :ref:`_popup_menu()` will be called with the path to the :ref:`CodeEdit` node. You can fetch it using this code: + +:: + + func _popup_menu(paths): + var code_edit = Engine.get_main_loop().root.get_node(paths[0]); + +The option callback will receive reference to that node. You can use :ref:`CodeEdit` methods to perform symbol lookups etc. + +.. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_SCENE_TABS: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SLOT_SCENE_TABS** = ``5`` + +Context menu of scene tabs. :ref:`_popup_menu()` will be called with the path of the clicked scene, or empty :ref:`PackedStringArray` if the menu was opened on empty space. The option callback will receive the path of the clicked scene, or empty :ref:`String` if none was clicked. + +.. _class_EditorContextMenuPlugin_constant_CONTEXT_SLOT_2D_EDITOR: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SLOT_2D_EDITOR** = ``6`` + +Context menu of 2D editor's basic right-click menu. :ref:`_popup_menu()` will be called with paths to all :ref:`CanvasItem` nodes under the cursor. You can fetch them using this code: + +:: + + func _popup_menu(paths): + var canvas_item = Engine.get_main_loop().root.get_node(paths[0]); # Replace 0 with the desired index. -Context menu of Scene dock. :ref:`_popup_menu` will be called with the path to the currently edited script, while option callback will receive reference to that script. +The paths array is empty if there weren't any nodes under cursor. The option callback will receive a typed array of :ref:`CanvasItem` nodes. .. rst-class:: classref-section-separator @@ -105,7 +143,7 @@ Method Descriptions |void| **_popup_menu**\ (\ paths\: :ref:`PackedStringArray`\ ) |virtual| :ref:`πŸ”—` -Called when creating a context menu, custom options can be added by using the :ref:`add_context_menu_item` or :ref:`add_context_menu_item_from_shortcut` functions. ``paths`` contains currently selected paths (depending on menu), which can be used to conditionally add options. +Called when creating a context menu, custom options can be added by using the :ref:`add_context_menu_item()` or :ref:`add_context_menu_item_from_shortcut()` functions. ``paths`` contains currently selected paths (depending on menu), which can be used to conditionally add options. .. rst-class:: classref-item-separator @@ -124,7 +162,7 @@ Add custom option to the context menu of the plugin's specified slot. When the o func _popup_menu(paths): add_context_menu_item("File Custom options", handle, ICON) -If you want to assign shortcut to the menu item, use :ref:`add_context_menu_item_from_shortcut` instead. +If you want to assign shortcut to the menu item, use :ref:`add_context_menu_item_from_shortcut()` instead. .. rst-class:: classref-item-separator @@ -136,7 +174,7 @@ If you want to assign shortcut to the menu item, use :ref:`add_context_menu_item |void| **add_context_menu_item_from_shortcut**\ (\ name\: :ref:`String`, shortcut\: :ref:`Shortcut`, icon\: :ref:`Texture2D` = null\ ) :ref:`πŸ”—` -Add custom option to the context menu of the plugin's specified slot. The option will have the ``shortcut`` assigned and reuse its callback. The shortcut has to be registered beforehand with :ref:`add_menu_shortcut`. +Add custom option to the context menu of the plugin's specified slot. The option will have the ``shortcut`` assigned and reuse its callback. The shortcut has to be registered beforehand with :ref:`add_menu_shortcut()`. :: @@ -166,7 +204,7 @@ Add a submenu to the context menu of the plugin's specified slot. The submenu is popup_menu.add_item("White") popup_menu.id_pressed.connect(_on_color_submenu_option) - add_context_menu_item("Set Node Color", popup_menu) + add_context_submenu_item("Set Node Color", popup_menu) .. rst-class:: classref-item-separator @@ -178,7 +216,7 @@ Add a submenu to the context menu of the plugin's specified slot. The submenu is |void| **add_menu_shortcut**\ (\ shortcut\: :ref:`Shortcut`, callback\: :ref:`Callable`\ ) :ref:`πŸ”—` -Registers a shortcut associated with the plugin's context menu. This method should be called once (e.g. in plugin's :ref:`Object._init`). ``callback`` will be called when user presses the specified ``shortcut`` while the menu's context is in effect (e.g. FileSystem dock is focused). Callback should take single :ref:`Array` argument; array contents depend on context menu slot. +Registers a shortcut associated with the plugin's context menu. This method should be called once (e.g. in plugin's :ref:`Object._init()`). ``callback`` will be called when user presses the specified ``shortcut`` while the menu's context is in effect (e.g. FileSystem dock is focused). Callback should take single :ref:`Array` argument; array contents depend on context menu slot. :: diff --git a/classes/class_editordebuggerplugin.rst b/classes/class_editordebuggerplugin.rst index 61fae088b64..29f172a7a4a 100644 --- a/classes/class_editordebuggerplugin.rst +++ b/classes/class_editordebuggerplugin.rst @@ -21,11 +21,11 @@ Description **EditorDebuggerPlugin** provides functions related to the editor side of the debugger. -To interact with the debugger, an instance of this class must be added to the editor via :ref:`EditorPlugin.add_debugger_plugin`. +To interact with the debugger, an instance of this class must be added to the editor via :ref:`EditorPlugin.add_debugger_plugin()`. -Once added, the :ref:`_setup_session` callback will be called for every :ref:`EditorDebuggerSession` available to the plugin, and when new ones are created (the sessions may be inactive during this stage). +Once added, the :ref:`_setup_session()` callback will be called for every :ref:`EditorDebuggerSession` available to the plugin, and when new ones are created (the sessions may be inactive during this stage). -You can retrieve the available :ref:`EditorDebuggerSession`\ s via :ref:`get_sessions` or get a specific one via :ref:`get_session`. +You can retrieve the available :ref:`EditorDebuggerSession`\ s via :ref:`get_sessions()` or get a specific one via :ref:`get_session()`. .. tabs:: @@ -90,7 +90,7 @@ To connect on the running game side, use the :ref:`EngineDebugger` and similar functions *called in the editor* do not print anything, the Output Log prints only game messages. +\ **Note:** While the game is running, :ref:`@GlobalScope.print()` and similar functions *called in the editor* do not print anything, the Output Log prints only game messages. .. rst-class:: classref-reftable-group @@ -157,7 +157,7 @@ Override this method to be notified when all breakpoints are cleared in the edit :ref:`bool` **_capture**\ (\ message\: :ref:`String`, data\: :ref:`Array`, session_id\: :ref:`int`\ ) |virtual| :ref:`πŸ”—` -Override this method to process incoming messages. The ``session_id`` is the ID of the :ref:`EditorDebuggerSession` that received the ``message``. Use :ref:`get_session` to retrieve the session. This method should return ``true`` if the message is recognized. +Override this method to process incoming messages. The ``session_id`` is the ID of the :ref:`EditorDebuggerSession` that received the ``message``. Use :ref:`get_session()` to retrieve the session. This method should return ``true`` if the message is recognized. .. rst-class:: classref-item-separator @@ -181,7 +181,7 @@ Override this method to be notified when a breakpoint line has been clicked in t :ref:`bool` **_has_capture**\ (\ capture\: :ref:`String`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to enable receiving messages from the debugger. If ``capture`` is "my_message" then messages starting with "my_message:" will be passes to the :ref:`_capture` method. +Override this method to enable receiving messages from the debugger. If ``capture`` is "my_message" then messages starting with "my_message:" will be passed to the :ref:`_capture()` method. .. rst-class:: classref-item-separator @@ -219,7 +219,7 @@ Returns the :ref:`EditorDebuggerSession` with the g Returns an array of :ref:`EditorDebuggerSession` currently available to this debugger plugin. -\ **Note:** Sessions in the array may be inactive, check their state via :ref:`EditorDebuggerSession.is_active`. +\ **Note:** Sessions in the array may be inactive, check their state via :ref:`EditorDebuggerSession.is_active()`. .. |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_editordebuggersession.rst b/classes/class_editordebuggersession.rst index 35e3bb47328..3ab3c4d4acf 100644 --- a/classes/class_editordebuggersession.rst +++ b/classes/class_editordebuggersession.rst @@ -21,7 +21,7 @@ Description This class cannot be directly instantiated and must be retrieved via a :ref:`EditorDebuggerPlugin`. -You can add tabs to the session UI via :ref:`add_session_tab`, send messages via :ref:`send_message`, and toggle :ref:`EngineProfiler`\ s via :ref:`toggle_profiler`. +You can add tabs to the session UI via :ref:`add_session_tab()`, send messages via :ref:`send_message()`, and toggle :ref:`EngineProfiler`\ s via :ref:`toggle_profiler()`. .. rst-class:: classref-reftable-group diff --git a/classes/class_editorexportplatform.rst b/classes/class_editorexportplatform.rst index 39f545d3e02..a99309dc211 100644 --- a/classes/class_editorexportplatform.rst +++ b/classes/class_editorexportplatform.rst @@ -23,7 +23,7 @@ Description Base resource that provides the functionality of exporting a release build of a project to a platform, from the editor. Stores platform-specific metadata such as the name and supported features of the platform, and performs the exporting of projects, PCK files, and ZIP files. Uses an export template for the platform provided at the time of project exporting. -Used in scripting by :ref:`EditorExportPlugin` to configure platform-specific customization of scenes and resources. See :ref:`EditorExportPlugin._begin_customize_scenes` and :ref:`EditorExportPlugin._begin_customize_resources` for more details. +Used in scripting by :ref:`EditorExportPlugin` to configure platform-specific customization of scenes and resources. See :ref:`EditorExportPlugin._begin_customize_scenes()` and :ref:`EditorExportPlugin._begin_customize_resources()` for more details. .. rst-class:: classref-introduction-group @@ -67,7 +67,7 @@ Methods +-----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`get_forced_export_files`\ (\ ) |static| | +-----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Dictionary` | :ref:`get_internal_export_files`\ (\ ) |static| | + | :ref:`Dictionary` | :ref:`get_internal_export_files`\ (\ preset\: :ref:`EditorExportPreset`, debug\: :ref:`bool`\ ) | +-----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_message_category`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -159,7 +159,7 @@ flags **DebugFlags**: :ref:`πŸ”—` :ref:`DebugFlags` **DEBUG_FLAG_DUMB_CLIENT** = ``1`` -Flag is set if remotely debugged project is expected to use remote file system. If set, :ref:`gen_export_flags` will add ``--remove-fs`` and ``--remote-fs-password`` (if password is set in the editor settings) command line arguments to the list. +Flag is set if remotely debugged project is expected to use remote file system. If set, :ref:`gen_export_flags()` will add ``--remote-fs`` and ``--remote-fs-password`` (if password is set in the editor settings) command line arguments to the list. .. _class_EditorExportPlatform_constant_DEBUG_FLAG_REMOTE_DEBUG: @@ -167,7 +167,7 @@ Flag is set if remotely debugged project is expected to use remote file system. :ref:`DebugFlags` **DEBUG_FLAG_REMOTE_DEBUG** = ``2`` -Flag is set if remote debug is enabled. If set, :ref:`gen_export_flags` will add ``--remote-debug`` and ``--breakpoints`` (if breakpoints are selected in the script editor or added by the plugin) command line arguments to the list. +Flag is set if remote debug is enabled. If set, :ref:`gen_export_flags()` will add ``--remote-debug`` and ``--breakpoints`` (if breakpoints are selected in the script editor or added by the plugin) command line arguments to the list. .. _class_EditorExportPlatform_constant_DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST: @@ -175,7 +175,7 @@ Flag is set if remote debug is enabled. If set, :ref:`gen_export_flags` **DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST** = ``4`` -Flag is set if remotely debugged project is running on the localhost. If set, :ref:`gen_export_flags` will use ``localhost`` instead of :ref:`EditorSettings.network/debug/remote_host` as remote debugger host. +Flag is set if remotely debugged project is running on the localhost. If set, :ref:`gen_export_flags()` will use ``localhost`` instead of :ref:`EditorSettings.network/debug/remote_host` as remote debugger host. .. _class_EditorExportPlatform_constant_DEBUG_FLAG_VIEW_COLLISIONS: @@ -183,7 +183,7 @@ Flag is set if remotely debugged project is running on the localhost. If set, :r :ref:`DebugFlags` **DEBUG_FLAG_VIEW_COLLISIONS** = ``8`` -Flag is set if "Visible Collision Shapes" remote debug option is enabled. If set, :ref:`gen_export_flags` will add ``--debug-collisions`` command line arguments to the list. +Flag is set if "Visible Collision Shapes" remote debug option is enabled. If set, :ref:`gen_export_flags()` will add ``--debug-collisions`` command line arguments to the list. .. _class_EditorExportPlatform_constant_DEBUG_FLAG_VIEW_NAVIGATION: @@ -191,7 +191,7 @@ Flag is set if "Visible Collision Shapes" remote debug option is enabled. If set :ref:`DebugFlags` **DEBUG_FLAG_VIEW_NAVIGATION** = ``16`` -Flag is set if Visible Navigation" remote debug option is enabled. If set, :ref:`gen_export_flags` will add ``--debug-navigation`` command line arguments to the list. +Flag is set if Visible Navigation" remote debug option is enabled. If set, :ref:`gen_export_flags()` will add ``--debug-navigation`` command line arguments to the list. .. rst-class:: classref-section-separator @@ -288,7 +288,7 @@ Exports project files for the specified preset. This method can be used to imple \ ``shared_cb`` is called for exported native shared/static libraries and have the following arguments: ``file_path: String``, ``tags: PackedStringArray``, ``target_folder: String``. -\ **Note:** ``file_index`` and ``file_count`` are intended for progress tracking only and aren't necesserely unique and precise. +\ **Note:** ``file_index`` and ``file_count`` are intended for progress tracking only and aren't necessarily unique and precise. .. rst-class:: classref-item-separator @@ -372,7 +372,7 @@ Returns array of core file names that always should be exported regardless of pr .. rst-class:: classref-method -:ref:`Dictionary` **get_internal_export_files**\ (\ ) |static| :ref:`πŸ”—` +:ref:`Dictionary` **get_internal_export_files**\ (\ preset\: :ref:`EditorExportPreset`, debug\: :ref:`bool`\ ) :ref:`πŸ”—` Returns additional files that should always be exported regardless of preset configuration, and are not part of the project source. The returned :ref:`Dictionary` contains filename keys (:ref:`String`) and their corresponding raw data (:ref:`PackedByteArray`). diff --git a/classes/class_editorexportplatformandroid.rst b/classes/class_editorexportplatformandroid.rst index a9761943dde..813afbf2177 100644 --- a/classes/class_editorexportplatformandroid.rst +++ b/classes/class_editorexportplatformandroid.rst @@ -54,6 +54,8 @@ Properties +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`custom_template/release` | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`gesture/swipe_to_dismiss` | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`gradle_build/android_source_template` | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`gradle_build/compress_native_libraries` | @@ -430,8 +432,6 @@ Properties +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`version/name` | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`wear_os/swipe_to_dismiss` | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`xr_features/xr_mode` | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -570,6 +570,22 @@ Path to an APK file to use as a custom export template for release exports. If l ---- +.. _class_EditorExportPlatformAndroid_property_gesture/swipe_to_dismiss: + +.. rst-class:: classref-property + +:ref:`bool` **gesture/swipe_to_dismiss** :ref:`πŸ”—` + +If ``true``, `Swipe to dismiss `__ will be enabled. + +This functionality is intended for smartwatches and is generally ignored on standard Android devices. However, some devices may not ignore it. Therefore, it is recommended to keep this feature disabled for standard Android apps to avoid unexpected behavior. + +\ **Note:** This is ``false`` by default. To enable this behavior, :ref:`gradle_build/use_gradle_build` is required. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorExportPlatformAndroid_property_gradle_build/android_source_template: .. rst-class:: classref-property @@ -2772,7 +2788,7 @@ Allows an application to write to the user dictionary. :ref:`bool` **screen/immersive_mode** :ref:`πŸ”—` -If ``true``, hides navigation and status bar. See :ref:`DisplayServer.window_set_mode` to toggle it at runtime. +If ``true``, hides navigation and status bar. See :ref:`DisplayServer.window_set_mode()` to toggle it at runtime. .. rst-class:: classref-item-separator @@ -2862,20 +2878,6 @@ Application version visible to the user. Falls back to :ref:`ProjectSettings.app ---- -.. _class_EditorExportPlatformAndroid_property_wear_os/swipe_to_dismiss: - -.. rst-class:: classref-property - -:ref:`bool` **wear_os/swipe_to_dismiss** :ref:`πŸ”—` - -If ``true``, `Swipe to dismiss `__ will be enabled on Wear OS. - -\ **Note:** This is ``true`` by default. To disable this behavior, :ref:`gradle_build/use_gradle_build` is required. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorExportPlatformAndroid_property_xr_features/xr_mode: .. rst-class:: classref-property diff --git a/classes/class_editorexportplatformextension.rst b/classes/class_editorexportplatformextension.rst index 01e1709bca3..03030487075 100644 --- a/classes/class_editorexportplatformextension.rst +++ b/classes/class_editorexportplatformextension.rst @@ -21,7 +21,7 @@ Description External :ref:`EditorExportPlatform` implementations should inherit from this class. -To use :ref:`EditorExportPlatform`, register it using the :ref:`EditorPlugin.add_export_platform` method first. +To use :ref:`EditorExportPlatform`, register it using the :ref:`EditorPlugin.add_export_platform()` method first. .. rst-class:: classref-reftable-group @@ -118,9 +118,9 @@ Method Descriptions **Optional.**\ -Returns ``true``, if specified ``preset`` is valid and can be exported. Use :ref:`set_config_error` and :ref:`set_config_missing_templates` to set error details. +Returns ``true``, if specified ``preset`` is valid and can be exported. Use :ref:`set_config_error()` and :ref:`set_config_missing_templates()` to set error details. -Usual implementation can call :ref:`_has_valid_export_configuration` and :ref:`_has_valid_project_configuration` to determine if export is possible. +Usual implementation can call :ref:`_has_valid_export_configuration()` and :ref:`_has_valid_project_configuration()` to determine if export is possible. .. rst-class:: classref-item-separator @@ -186,7 +186,7 @@ Creates a full project at ``path`` for the specified ``preset``. This method is called when "Export" button is pressed in the export dialog. -This method implementation can call :ref:`EditorExportPlatform.save_pack` or :ref:`EditorExportPlatform.save_zip` to use default PCK/ZIP export process, or calls :ref:`EditorExportPlatform.export_project_files` and implement custom callback for processing each exported file. +This method implementation can call :ref:`EditorExportPlatform.save_pack()` or :ref:`EditorExportPlatform.save_zip()` to use default PCK/ZIP export process, or calls :ref:`EditorExportPlatform.export_project_files()` and implement custom callback for processing each exported file. .. rst-class:: classref-item-separator @@ -318,11 +318,11 @@ Additionally, the following keys are supported: - ``default_value: Variant``, default value of the property. -- ``update_visibility: bool``, if set to ``true``, :ref:`_get_export_option_visibility` is called for each property when this property is changed. +- ``update_visibility: bool``, if set to ``true``, :ref:`_get_export_option_visibility()` is called for each property when this property is changed. -- ``required: bool``, if set to ``true``, this property warnings are critical, and should be resolved to make export possible. This value is a hint for the :ref:`_has_valid_export_configuration` implementation, and not used by the engine directly. +- ``required: bool``, if set to ``true``, this property warnings are critical, and should be resolved to make export possible. This value is a hint for the :ref:`_has_valid_export_configuration()` implementation, and not used by the engine directly. -See also :ref:`Object._get_property_list`. +See also :ref:`Object._get_property_list()`. .. rst-class:: classref-item-separator @@ -336,7 +336,7 @@ See also :ref:`Object._get_property_list`. +Returns platform logo displayed in the export dialog, logo should be 32x32 adjusted to the current editor scale, see :ref:`EditorInterface.get_editor_scale()`. .. rst-class:: classref-item-separator @@ -364,7 +364,7 @@ Returns export platform name. **Optional.**\ -Returns one-click deploy menu item icon for the specified ``device``, icon should be 16x16 adjusted to the current editor scale, see :ref:`EditorInterface.get_editor_scale`. +Returns one-click deploy menu item icon for the specified ``device``, icon should be 16x16 adjusted to the current editor scale, see :ref:`EditorInterface.get_editor_scale()`. .. rst-class:: classref-item-separator @@ -476,7 +476,7 @@ Returns array of platform specific features for the specified ``preset``. **Optional.**\ -Returns icon of the one-click deploy menu button, icon should be 16x16 adjusted to the current editor scale, see :ref:`EditorInterface.get_editor_scale`. +Returns icon of the one-click deploy menu button, icon should be 16x16 adjusted to the current editor scale, see :ref:`EditorInterface.get_editor_scale()`. .. rst-class:: classref-item-separator @@ -574,7 +574,7 @@ Returns ``true`` if export options list is changed and presets should be updated :ref:`String` **get_config_error**\ (\ ) |const| :ref:`πŸ”—` -Returns current configuration error message text. This method should be called only from the :ref:`_can_export`, :ref:`_has_valid_export_configuration`, or :ref:`_has_valid_project_configuration` implementations. +Returns current configuration error message text. This method should be called only from the :ref:`_can_export()`, :ref:`_has_valid_export_configuration()`, or :ref:`_has_valid_project_configuration()` implementations. .. rst-class:: classref-item-separator @@ -586,7 +586,7 @@ Returns current configuration error message text. This method should be called o :ref:`bool` **get_config_missing_templates**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true`` is export templates are missing from the current configuration. This method should be called only from the :ref:`_can_export`, :ref:`_has_valid_export_configuration`, or :ref:`_has_valid_project_configuration` implementations. +Returns ``true`` is export templates are missing from the current configuration. This method should be called only from the :ref:`_can_export()`, :ref:`_has_valid_export_configuration()`, or :ref:`_has_valid_project_configuration()` implementations. .. rst-class:: classref-item-separator @@ -598,7 +598,7 @@ Returns ``true`` is export templates are missing from the current configuration. |void| **set_config_error**\ (\ error_text\: :ref:`String`\ ) |const| :ref:`πŸ”—` -Sets current configuration error message text. This method should be called only from the :ref:`_can_export`, :ref:`_has_valid_export_configuration`, or :ref:`_has_valid_project_configuration` implementations. +Sets current configuration error message text. This method should be called only from the :ref:`_can_export()`, :ref:`_has_valid_export_configuration()`, or :ref:`_has_valid_project_configuration()` implementations. .. rst-class:: classref-item-separator @@ -610,7 +610,7 @@ Sets current configuration error message text. This method should be called only |void| **set_config_missing_templates**\ (\ missing_templates\: :ref:`bool`\ ) |const| :ref:`πŸ”—` -Set to ``true`` is export templates are missing from the current configuration. This method should be called only from the :ref:`_can_export`, :ref:`_has_valid_export_configuration`, or :ref:`_has_valid_project_configuration` implementations. +Set to ``true`` is export templates are missing from the current configuration. This method should be called only from the :ref:`_can_export()`, :ref:`_has_valid_export_configuration()`, or :ref:`_has_valid_project_configuration()` implementations. .. |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_editorexportplatformios.rst b/classes/class_editorexportplatformios.rst index 6daf10c1a51..6aba17f6cb3 100644 --- a/classes/class_editorexportplatformios.rst +++ b/classes/class_editorexportplatformios.rst @@ -50,8 +50,6 @@ Properties +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`application/export_project_only` | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`application/generate_simulator_library_if_missing` | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`application/icon_interpolation` | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`application/min_ios_version` | @@ -639,18 +637,6 @@ If ``true``, exports iOS project files without building an XCArchive or ``.ipa`` ---- -.. _class_EditorExportPlatformIOS_property_application/generate_simulator_library_if_missing: - -.. rst-class:: classref-property - -:ref:`bool` **application/generate_simulator_library_if_missing** :ref:`πŸ”—` - -If ``true``, and ARM64 simulator library is missing from the export template, it is automatically generated from ARM64 device library. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorExportPlatformIOS_property_application/icon_interpolation: .. rst-class:: classref-property diff --git a/classes/class_editorexportplatformlinuxbsd.rst b/classes/class_editorexportplatformlinuxbsd.rst index 082c9a7912d..45b54dc1f56 100644 --- a/classes/class_editorexportplatformlinuxbsd.rst +++ b/classes/class_editorexportplatformlinuxbsd.rst @@ -78,7 +78,7 @@ Application executable architecture. Supported architectures: ``x86_32``, ``x86_64``, ``arm64``, ``arm32``, ``rv64``, ``ppc64``, ``ppc32``, and ``loongarch64``. -Official export templates include ``x86_32`` and ``x86_64`` binaries only. +Official export templates include ``x86_32``, ``x86_64``, ``arm32``, and ``arm64`` binaries only. .. rst-class:: classref-item-separator diff --git a/classes/class_editorexportplatformweb.rst b/classes/class_editorexportplatformweb.rst index 42c1a0207c4..51c742a4adb 100644 --- a/classes/class_editorexportplatformweb.rst +++ b/classes/class_editorexportplatformweb.rst @@ -363,7 +363,7 @@ If ``false``, the exported game will not support threads. As a result, it is mor :ref:`bool` **vram_texture_compression/for_desktop** :ref:`πŸ”—` -If ``true``, allows textures to be optimized for desktop through the S3TC algorithm. +If ``true``, allows textures to be optimized for desktop through the S3TC/BPTC algorithm. .. rst-class:: classref-item-separator @@ -375,7 +375,7 @@ If ``true``, allows textures to be optimized for desktop through the S3TC algori :ref:`bool` **vram_texture_compression/for_mobile** :ref:`πŸ”—` -If ``true`` allows textures to be optimized for mobile through the ETC2 algorithm. +If ``true`` allows textures to be optimized for mobile through the ETC2/ASTC algorithm. .. |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_editorexportplatformwindows.rst b/classes/class_editorexportplatformwindows.rst index c38597dfbe0..8e6f0c55c1d 100644 --- a/classes/class_editorexportplatformwindows.rst +++ b/classes/class_editorexportplatformwindows.rst @@ -299,8 +299,6 @@ Application executable architecture. Supported architectures: ``x86_32``, ``x86_64``, and ``arm64``. -Official export templates include ``x86_32`` and ``x86_64`` binaries only. - .. rst-class:: classref-item-separator ---- diff --git a/classes/class_editorexportplugin.rst b/classes/class_editorexportplugin.rst index 6a27ae0b839..11368832cc2 100644 --- a/classes/class_editorexportplugin.rst +++ b/classes/class_editorexportplugin.rst @@ -19,9 +19,9 @@ A script that is executed when exporting the project. Description ----------- -**EditorExportPlugin**\ s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, :ref:`_export_begin` is called at the beginning of the export process and then :ref:`_export_file` is called for each exported file. +**EditorExportPlugin**\ s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, :ref:`_export_begin()` is called at the beginning of the export process and then :ref:`_export_file()` is called for each exported file. -To use **EditorExportPlugin**, register it using the :ref:`EditorPlugin.add_export_plugin` method first. +To use **EditorExportPlugin**, register it using the :ref:`EditorPlugin.add_export_plugin()` method first. .. rst-class:: classref-introduction-group @@ -133,7 +133,7 @@ Method Descriptions Return ``true`` if this plugin will customize resources based on the platform and features used. -When enabled, :ref:`_get_customization_configuration_hash` and :ref:`_customize_resource` will be called and must be implemented. +When enabled, :ref:`_get_customization_configuration_hash()` and :ref:`_customize_resource()` will be called and must be implemented. .. rst-class:: classref-item-separator @@ -147,9 +147,9 @@ When enabled, :ref:`_get_customization_configuration_hash` and :ref:`_customize_scene` will be called and must be implemented. +When enabled, :ref:`_get_customization_configuration_hash()` and :ref:`_customize_scene()` will be called and must be implemented. -\ **Note:** :ref:`_customize_scene` will only be called for scenes that have been modified since the last export. +\ **Note:** :ref:`_customize_scene()` will only be called for scenes that have been modified since the last export. .. rst-class:: classref-item-separator @@ -165,9 +165,9 @@ Customize a resource. If changes are made to it, return the same or a new resour The ``path`` argument is only used when customizing an actual file, otherwise this means that this resource is part of another one and it will be empty. -Implementing this method is required if :ref:`_begin_customize_resources` returns ``true``. +Implementing this method is required if :ref:`_begin_customize_resources()` returns ``true``. -\ **Note:** When customizing any of the following types and returning another resource, the other resource should not be skipped using :ref:`skip` in :ref:`_export_file`: +\ **Note:** When customizing any of the following types and returning another resource, the other resource should not be skipped using :ref:`skip()` in :ref:`_export_file()`: - :ref:`AtlasTexture`\ @@ -193,7 +193,7 @@ Implementing this method is required if :ref:`_begin_customize_resources` returns ``true``. +Implementing this method is required if :ref:`_begin_customize_scenes()` returns ``true``. .. rst-class:: classref-item-separator @@ -253,9 +253,9 @@ Virtual method to be overridden by the user. Called when the export is finished. |void| **_export_file**\ (\ path\: :ref:`String`, type\: :ref:`String`, features\: :ref:`PackedStringArray`\ ) |virtual| :ref:`πŸ”—` -Virtual method to be overridden by the user. Called for each exported file before :ref:`_customize_resource` and :ref:`_customize_scene`. The arguments can be used to identify the file. ``path`` is the path of the file, ``type`` is the :ref:`Resource` represented by the file (e.g. :ref:`PackedScene`), and ``features`` is the list of features for the export. +Virtual method to be overridden by the user. Called for each exported file before :ref:`_customize_resource()` and :ref:`_customize_scene()`. The arguments can be used to identify the file. ``path`` is the path of the file, ``type`` is the :ref:`Resource` represented by the file (e.g. :ref:`PackedScene`), and ``features`` is the list of features for the export. -Calling :ref:`skip` inside this callback will make the file not included in the export. +Calling :ref:`skip()` inside this callback will make the file not included in the export. .. rst-class:: classref-item-separator @@ -361,7 +361,7 @@ Virtual method to be overridden by the user. This is used at export time to upda Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations. -Implementing this method is required if :ref:`_begin_customize_resources` returns ``true``. +Implementing this method is required if :ref:`_begin_customize_resources()` returns ``true``. .. rst-class:: classref-item-separator @@ -401,7 +401,7 @@ Validates ``option`` and returns the visibility for the specified ``platform``. Check the requirements for the given ``option`` and return a non-empty warning string if they are not met. -\ **Note:** Use :ref:`get_option` to check the value of the export options. +\ **Note:** Use :ref:`get_option()` to check the value of the export options. .. rst-class:: classref-item-separator @@ -417,7 +417,7 @@ Return a list of export options that can be configured for this export plugin. Each element in the return value is a :ref:`Dictionary` with the following keys: -- ``option``: A dictionary with the structure documented by :ref:`Object.get_property_list`, but all keys are optional. +- ``option``: A dictionary with the structure documented by :ref:`Object.get_property_list()`, but all keys are optional. - ``default_value``: The default value for this option. @@ -477,7 +477,7 @@ Implementing this method is required. :ref:`bool` **_should_update_export_options**\ (\ platform\: :ref:`EditorExportPlatform`\ ) |virtual| |const| :ref:`πŸ”—` -Return ``true``, if the result of :ref:`_get_export_options` has changed and the export options of preset corresponding to ``platform`` should be updated. +Return ``true``, if the result of :ref:`_get_export_options()` has changed and the export options of preset corresponding to ``platform`` should be updated. .. rst-class:: classref-item-separator @@ -503,9 +503,9 @@ Return ``true`` if the plugin supports the given ``platform``. Adds a custom file to be exported. ``path`` is the virtual path that can be used to load the file, ``file`` is the binary data of the file. -When called inside :ref:`_export_file` and ``remap`` is ``true``, the current file will not be exported, but instead remapped to this custom file. ``remap`` is ignored when called in other places. +When called inside :ref:`_export_file()` and ``remap`` is ``true``, the current file will not be exported, but instead remapped to this custom file. ``remap`` is ignored when called in other places. -\ ``file`` will not be imported, so consider using :ref:`_customize_resource` to remap imported resources. +\ ``file`` will not be imported, so consider using :ref:`_customize_resource()` to remap imported resources. .. rst-class:: classref-item-separator @@ -543,7 +543,7 @@ Adds a C++ code to the iOS export. The final code is created from the code appen Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary. -\ **Note:** For static libraries (\*.a) works in same way as :ref:`add_ios_framework`. +\ **Note:** For static libraries (\*.a) works in same way as :ref:`add_ios_framework()`. \ **Note:** This method should not be used for System libraries as they are already present on the device. @@ -659,7 +659,7 @@ Returns currently used export preset. :ref:`Variant` **get_option**\ (\ name\: :ref:`StringName`\ ) |const| :ref:`πŸ”—` -Returns the current value of an export option supplied by :ref:`_get_export_options`. +Returns the current value of an export option supplied by :ref:`_get_export_options()`. .. rst-class:: classref-item-separator @@ -671,7 +671,7 @@ Returns the current value of an export option supplied by :ref:`_get_export_opti |void| **skip**\ (\ ) :ref:`πŸ”—` -To be called inside :ref:`_export_file`. Skips the current file, so it's not included in the export. +To be called inside :ref:`_export_file()`. Skips the current file, so it's not included in the export. .. |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_editorexportpreset.rst b/classes/class_editorexportpreset.rst index 38c10078ce6..60904aa6767 100644 --- a/classes/class_editorexportpreset.rst +++ b/classes/class_editorexportpreset.rst @@ -273,7 +273,7 @@ Method Descriptions :ref:`bool` **are_advanced_options_enabled**\ (\ ) |const| :ref:`πŸ”—` -Returns ``true``, is "Advanced" toggle is enabled in the export dialog. +Returns ``true`` if "Advanced" toggle is enabled in the export dialog. .. rst-class:: classref-item-separator @@ -297,7 +297,7 @@ Returns string with a comma separated list of custom features. :ref:`Dictionary` **get_customized_files**\ (\ ) |const| :ref:`πŸ”—` -Returns :ref:`Dictionary` of files selected in the "Resources" tab of the export dialog. Dictionary keys are file names and values are export mode - ``"strip``, ``"keep"``, or ``"remove"``. See also :ref:`get_file_export_mode`. +Returns :ref:`Dictionary` of files selected in the "Resources" tab of the export dialog. Dictionary keys are file names and values are export mode - ``"strip"``, ``"keep"``, or ``"remove"``. See also :ref:`get_file_export_mode()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editorfeatureprofile.rst b/classes/class_editorfeatureprofile.rst index 3e0adcdbb68..f1aafb896b9 100644 --- a/classes/class_editorfeatureprofile.rst +++ b/classes/class_editorfeatureprofile.rst @@ -225,9 +225,9 @@ Returns ``true`` if the ``feature`` is disabled. When a feature is disabled, it :ref:`Error` **load_from_file**\ (\ path\: :ref:`String`\ ) :ref:`πŸ”—` -Loads an editor feature profile from a file. The file must follow the JSON format obtained by using the feature profile manager's **Export** button or the :ref:`save_to_file` method. +Loads an editor feature profile from a file. The file must follow the JSON format obtained by using the feature profile manager's **Export** button or the :ref:`save_to_file()` method. -\ **Note:** Feature profiles created via the user interface are loaded from the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir`. +\ **Note:** Feature profiles created via the user interface are loaded from the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir()`. .. rst-class:: classref-item-separator @@ -239,9 +239,9 @@ Loads an editor feature profile from a file. The file must follow the JSON forma :ref:`Error` **save_to_file**\ (\ path\: :ref:`String`\ ) :ref:`πŸ”—` -Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's **Import** button or the :ref:`load_from_file` method. +Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's **Import** button or the :ref:`load_from_file()` method. -\ **Note:** Feature profiles created via the user interface are saved in the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir`. +\ **Note:** Feature profiles created via the user interface are saved in the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editorfiledialog.rst b/classes/class_editorfiledialog.rst index c739d3ed75f..fce551203dc 100644 --- a/classes/class_editorfiledialog.rst +++ b/classes/class_editorfiledialog.rst @@ -21,6 +21,8 @@ Description **EditorFileDialog** is an enhanced version of :ref:`FileDialog` available only to editor plugins. Additional features include list of favorited/recent files and the ability to see files as thumbnails grid instead of list. +Unlike :ref:`FileDialog`, **EditorFileDialog** does not have a property for using native dialogs. Instead, native dialogs can be enabled globally via the :ref:`EditorSettings.interface/editor/use_native_file_dialogs` editor setting. They are also enabled automatically when running in sandbox (e.g. on macOS). + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_editorfilesystem.rst b/classes/class_editorfilesystem.rst index 0515f96921c..404539665ca 100644 --- a/classes/class_editorfilesystem.rst +++ b/classes/class_editorfilesystem.rst @@ -21,7 +21,7 @@ Description This object holds information of all resources in the filesystem, their types, etc. -\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_filesystem`. +\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_filesystem()`. .. rst-class:: classref-reftable-group @@ -205,9 +205,9 @@ Returns ``true`` if the filesystem is being scanned. Reimports a set of files. Call this if these files or their ``.import`` files were directly edited by script or an external program. -If the file type changed or the file was newly created, use :ref:`update_file` or :ref:`scan`. +If the file type changed or the file was newly created, use :ref:`update_file()` or :ref:`scan()`. -\ **Note:** This function blocks until the import is finished. However, the main loop iteration, including timers and :ref:`Node._process`, will occur during the import process due to progress bar updates. Avoid calls to :ref:`reimport_files` or :ref:`scan` while an import is in progress. +\ **Note:** This function blocks until the import is finished. However, the main loop iteration, including timers and :ref:`Node._process()`, will occur during the import process due to progress bar updates. Avoid calls to :ref:`reimport_files()` or :ref:`scan()` while an import is in progress. .. rst-class:: classref-item-separator @@ -245,7 +245,7 @@ Check if the source of any imported resource changed. Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program. -This will not import the file. To reimport, call :ref:`reimport_files` or :ref:`scan` methods. +This will not import the file. To reimport, call :ref:`reimport_files()` or :ref:`scan()` methods. .. |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_editorimportplugin.rst b/classes/class_editorimportplugin.rst index 7ccb2b25985..6df2268045b 100644 --- a/classes/class_editorimportplugin.rst +++ b/classes/class_editorimportplugin.rst @@ -21,7 +21,7 @@ Description **EditorImportPlugin**\ s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. -EditorImportPlugins work by associating with specific file extensions and a resource type. See :ref:`_get_recognized_extensions` and :ref:`_get_resource_type`. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the ``.godot/imported`` directory (see :ref:`ProjectSettings.application/config/use_hidden_project_data_directory`). +EditorImportPlugins work by associating with specific file extensions and a resource type. See :ref:`_get_recognized_extensions()` and :ref:`_get_resource_type()`. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the ``.godot/imported`` directory (see :ref:`ProjectSettings.application/config/use_hidden_project_data_directory`). Below is an example EditorImportPlugin that imports a :ref:`Mesh` from a file with the extension ".special" or ".spec": @@ -85,7 +85,7 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh` fr public override string[] _GetRecognizedExtensions() { - return new string[] { "special", "spec" }; + return ["special", "spec"]; } public override string _GetSaveExtension() @@ -110,14 +110,14 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh` fr public override Godot.Collections.Array _GetImportOptions(string path, int presetIndex) { - return new Godot.Collections.Array - { + return + [ new Godot.Collections.Dictionary { { "name", "myOption" }, { "default_value", false }, - } - }; + }, + ]; } public override Error _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array platformVariants, Godot.Collections.Array genFiles) @@ -137,7 +137,7 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh` fr -To use **EditorImportPlugin**, register it using the :ref:`EditorPlugin.add_import_plugin` method first. +To use **EditorImportPlugin**, register it using the :ref:`EditorPlugin.add_import_plugin()` method first. .. rst-class:: classref-introduction-group @@ -306,7 +306,7 @@ Returns ``true`` to make all options always visible. :ref:`int` **_get_preset_count**\ (\ ) |virtual| |const| :ref:`πŸ”—` -Gets the number of initial presets defined by the plugin. Use :ref:`_get_import_options` to get the default options for the preset and :ref:`_get_preset_name` to get the name of the preset. +Gets the number of initial presets defined by the plugin. Use :ref:`_get_import_options()` to get the default options for the preset and :ref:`_get_preset_name()` to get the name of the preset. .. rst-class:: classref-item-separator @@ -404,7 +404,7 @@ This method must be overridden to do the actual importing work. See this class' :ref:`Error` **append_import_external_resource**\ (\ path\: :ref:`String`, custom_options\: :ref:`Dictionary` = {}, custom_importer\: :ref:`String` = "", generator_parameters\: :ref:`Variant` = null\ ) :ref:`πŸ”—` -This function can only be called during the :ref:`_import` callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the ``custom_options``. Additionally, in cases where multiple importers can handle a file, the ``custom_importer`` can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. ``generator_parameters`` defines optional extra metadata which will be stored as ``generator_parameters`` in the ``remap`` section of the ``.import`` file, for example to store a md5 hash of the source data. +This function can only be called during the :ref:`_import()` callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the ``custom_options``. Additionally, in cases where multiple importers can handle a file, the ``custom_importer`` can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. ``generator_parameters`` defines optional extra metadata which will be stored as ``generator_parameters`` in the ``remap`` section of the ``.import`` file, for example to store a md5 hash of the source data. .. |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_editorinspector.rst b/classes/class_editorinspector.rst index 0ae74125c56..9efa9d3fc90 100644 --- a/classes/class_editorinspector.rst +++ b/classes/class_editorinspector.rst @@ -19,9 +19,9 @@ A control used to edit properties of an object. Description ----------- -This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the **EditorInspector** used in the editor's Inspector dock, use :ref:`EditorInterface.get_inspector`. +This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the **EditorInspector** used in the editor's Inspector dock, use :ref:`EditorInterface.get_inspector()`. -\ **EditorInspector** will show properties in the same order as the array returned by :ref:`Object.get_property_list`. +\ **EditorInspector** will show properties in the same order as the array returned by :ref:`Object.get_property_list()`. If a property's name is path-like (i.e. if it contains forward slashes), **EditorInspector** will create nested sections for "directories" along the path. For example, if a property is named ``highlighting/gdscript/node_path_color``, it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section. @@ -44,8 +44,6 @@ Properties +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | follow_focus | ``true`` (overrides :ref:`ScrollContainer`) | - +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`ScrollMode` | horizontal_scroll_mode | ``0`` (overrides :ref:`ScrollContainer`) | +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ diff --git a/classes/class_editorinspectorplugin.rst b/classes/class_editorinspectorplugin.rst index 9d13dc70898..cec4bb7d73c 100644 --- a/classes/class_editorinspectorplugin.rst +++ b/classes/class_editorinspectorplugin.rst @@ -21,17 +21,17 @@ Description **EditorInspectorPlugin** allows adding custom property editors to :ref:`EditorInspector`. -When an object is edited, the :ref:`_can_handle` function is called and must return ``true`` if the object type is supported. +When an object is edited, the :ref:`_can_handle()` function is called and must return ``true`` if the object type is supported. -If supported, the function :ref:`_parse_begin` will be called, allowing to place custom controls at the beginning of the class. +If supported, the function :ref:`_parse_begin()` will be called, allowing to place custom controls at the beginning of the class. -Subsequently, the :ref:`_parse_category` and :ref:`_parse_property` are called for every category and property. They offer the ability to add custom controls to the inspector too. +Subsequently, the :ref:`_parse_category()` and :ref:`_parse_property()` are called for every category and property. They offer the ability to add custom controls to the inspector too. -Finally, :ref:`_parse_end` will be called. +Finally, :ref:`_parse_end()` will be called. On each of these calls, the "add" functions can be called. -To use **EditorInspectorPlugin**, register it using the :ref:`EditorPlugin.add_inspector_plugin` method first. +To use **EditorInspectorPlugin**, register it using the :ref:`EditorPlugin.add_inspector_plugin()` method first. .. rst-class:: classref-introduction-group diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst index 5f227c64846..e61ff32c6c1 100644 --- a/classes/class_editorinterface.rst +++ b/classes/class_editorinterface.rst @@ -59,119 +59,119 @@ Methods .. table:: :widths: auto - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`edit_node`\ (\ node\: :ref:`Node`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`edit_resource`\ (\ resource\: :ref:`Resource`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`edit_script`\ (\ script\: :ref:`Script`, line\: :ref:`int` = -1, column\: :ref:`int` = 0, grab_focus\: :ref:`bool` = true\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Control` | :ref:`get_base_control`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorCommandPalette` | :ref:`get_command_palette`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_directory`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_feature_profile`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_path`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`get_edited_scene_root`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`VBoxContainer` | :ref:`get_editor_main_screen`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorPaths` | :ref:`get_editor_paths`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_editor_scale`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorSettings` | :ref:`get_editor_settings`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Theme` | :ref:`get_editor_theme`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorToaster` | :ref:`get_editor_toaster`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorUndoRedoManager` | :ref:`get_editor_undo_redo`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`SubViewport` | :ref:`get_editor_viewport_2d`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`SubViewport` | :ref:`get_editor_viewport_3d`\ (\ idx\: :ref:`int` = 0\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`FileSystemDock` | :ref:`get_file_system_dock`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorInspector` | :ref:`get_inspector`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_open_scenes`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_playing_scene`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorFileSystem` | :ref:`get_resource_filesystem`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorResourcePreview` | :ref:`get_resource_previewer`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`ScriptEditor` | :ref:`get_script_editor`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_selected_paths`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorSelection` | :ref:`get_selection`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`inspect_object`\ (\ object\: :ref:`Object`, for_property\: :ref:`String` = "", inspector_only\: :ref:`bool` = false\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_multi_window_enabled`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_playing_scene`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_plugin_enabled`\ (\ plugin\: :ref:`String`\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Array`\[:ref:`Texture2D`\] | :ref:`make_mesh_previews`\ (\ meshes\: :ref:`Array`\[:ref:`Mesh`\], preview_size\: :ref:`int`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`mark_scene_as_unsaved`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`open_scene_from_path`\ (\ scene_filepath\: :ref:`String`, set_inherited\: :ref:`bool` = false\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`play_current_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`play_custom_scene`\ (\ scene_filepath\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`play_main_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_create_dialog`\ (\ callback\: :ref:`Callable`, base_type\: :ref:`StringName` = "", current_type\: :ref:`String` = "", dialog_title\: :ref:`String` = "", type_blocklist\: :ref:`Array`\[:ref:`StringName`\] = [], type_suffixes\: :ref:`Dictionary` = {}\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog`\ (\ dialog\: :ref:`Window`, rect\: :ref:`Rect2i` = Rect2i(0, 0, 0, 0)\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog_centered`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0)\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog_centered_clamped`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0), fallback_ratio\: :ref:`float` = 0.75\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog_centered_ratio`\ (\ dialog\: :ref:`Window`, ratio\: :ref:`float` = 0.8\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_method_selector`\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, current_value\: :ref:`String` = ""\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_node_selector`\ (\ callback\: :ref:`Callable`, valid_types\: :ref:`Array`\[:ref:`StringName`\] = [], current_value\: :ref:`Node` = null\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_property_selector`\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array(), current_value\: :ref:`String` = ""\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_quick_open`\ (\ callback\: :ref:`Callable`, base_types\: :ref:`Array`\[:ref:`StringName`\] = []\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`reload_scene_from_path`\ (\ scene_filepath\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`restart_editor`\ (\ save\: :ref:`bool` = true\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`save_all_scenes`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`save_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`save_scene_as`\ (\ path\: :ref:`String`, with_preview\: :ref:`bool` = true\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`select_file`\ (\ file\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_current_feature_profile`\ (\ profile_name\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_main_screen_editor`\ (\ name\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_plugin_enabled`\ (\ plugin\: :ref:`String`, enabled\: :ref:`bool`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`stop_playing_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`edit_node`\ (\ node\: :ref:`Node`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`edit_resource`\ (\ resource\: :ref:`Resource`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`edit_script`\ (\ script\: :ref:`Script`, line\: :ref:`int` = -1, column\: :ref:`int` = 0, grab_focus\: :ref:`bool` = true\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Control` | :ref:`get_base_control`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorCommandPalette` | :ref:`get_command_palette`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_directory`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_feature_profile`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_path`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`get_edited_scene_root`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`VBoxContainer` | :ref:`get_editor_main_screen`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorPaths` | :ref:`get_editor_paths`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_editor_scale`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorSettings` | :ref:`get_editor_settings`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Theme` | :ref:`get_editor_theme`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorToaster` | :ref:`get_editor_toaster`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorUndoRedoManager` | :ref:`get_editor_undo_redo`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubViewport` | :ref:`get_editor_viewport_2d`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubViewport` | :ref:`get_editor_viewport_3d`\ (\ idx\: :ref:`int` = 0\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`FileSystemDock` | :ref:`get_file_system_dock`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorInspector` | :ref:`get_inspector`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_open_scenes`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_playing_scene`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorFileSystem` | :ref:`get_resource_filesystem`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorResourcePreview` | :ref:`get_resource_previewer`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ScriptEditor` | :ref:`get_script_editor`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_selected_paths`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorSelection` | :ref:`get_selection`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`inspect_object`\ (\ object\: :ref:`Object`, for_property\: :ref:`String` = "", inspector_only\: :ref:`bool` = false\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_multi_window_enabled`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing_scene`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_plugin_enabled`\ (\ plugin\: :ref:`String`\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Array`\[:ref:`Texture2D`\] | :ref:`make_mesh_previews`\ (\ meshes\: :ref:`Array`\[:ref:`Mesh`\], preview_size\: :ref:`int`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`mark_scene_as_unsaved`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`open_scene_from_path`\ (\ scene_filepath\: :ref:`String`, set_inherited\: :ref:`bool` = false\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`play_current_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`play_custom_scene`\ (\ scene_filepath\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`play_main_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_create_dialog`\ (\ callback\: :ref:`Callable`, base_type\: :ref:`StringName` = "", current_type\: :ref:`String` = "", dialog_title\: :ref:`String` = "", type_blocklist\: :ref:`Array`\[:ref:`StringName`\] = []\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog`\ (\ dialog\: :ref:`Window`, rect\: :ref:`Rect2i` = Rect2i(0, 0, 0, 0)\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog_centered`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0)\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog_centered_clamped`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0), fallback_ratio\: :ref:`float` = 0.75\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog_centered_ratio`\ (\ dialog\: :ref:`Window`, ratio\: :ref:`float` = 0.8\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_method_selector`\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, current_value\: :ref:`String` = ""\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_node_selector`\ (\ callback\: :ref:`Callable`, valid_types\: :ref:`Array`\[:ref:`StringName`\] = [], current_value\: :ref:`Node` = null\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_property_selector`\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array(), current_value\: :ref:`String` = ""\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_quick_open`\ (\ callback\: :ref:`Callable`, base_types\: :ref:`Array`\[:ref:`StringName`\] = []\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`reload_scene_from_path`\ (\ scene_filepath\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`restart_editor`\ (\ save\: :ref:`bool` = true\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`save_all_scenes`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`save_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`save_scene_as`\ (\ path\: :ref:`String`, with_preview\: :ref:`bool` = true\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`select_file`\ (\ file\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_current_feature_profile`\ (\ profile_name\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_main_screen_editor`\ (\ name\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_plugin_enabled`\ (\ plugin\: :ref:`String`, enabled\: :ref:`bool`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`stop_playing_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -239,7 +239,7 @@ Edits the given :ref:`Node`. The node will be also selected if it's |void| **edit_resource**\ (\ resource\: :ref:`Resource`\ ) :ref:`πŸ”—` -Edits the given :ref:`Resource`. If the resource is a :ref:`Script` you can also edit it with :ref:`edit_script` to specify the line and column position. +Edits the given :ref:`Resource`. If the resource is a :ref:`Script` you can also edit it with :ref:`edit_script()` to specify the line and column position. .. rst-class:: classref-item-separator @@ -291,7 +291,7 @@ Returns the editor's :ref:`EditorCommandPalette` ins :ref:`String` **get_current_directory**\ (\ ) |const| :ref:`πŸ”—` -Returns the current directory being viewed in the :ref:`FileSystemDock`. If a file is selected, its base directory will be returned using :ref:`String.get_base_dir` instead. +Returns the current directory being viewed in the :ref:`FileSystemDock`. If a file is selected, its base directory will be returned using :ref:`String.get_base_dir()` instead. .. rst-class:: classref-item-separator @@ -305,9 +305,9 @@ Returns the current directory being viewed in the :ref:`FileSystemDock`, you must load the feature profile using :ref:`EditorFeatureProfile.load_from_file`. +In order to get a reference to the :ref:`EditorFeatureProfile`, you must load the feature profile using :ref:`EditorFeatureProfile.load_from_file()`. -\ **Note:** Feature profiles created via the user interface are loaded from the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir`. +\ **Note:** Feature profiles created via the user interface are loaded from the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir()`. .. rst-class:: classref-item-separator @@ -343,7 +343,7 @@ Returns the edited (current) scene's root :ref:`Node`. :ref:`VBoxContainer` **get_editor_main_screen**\ (\ ) |const| :ref:`πŸ”—` -Returns the editor control responsible for main screen plugins and tools. Use it with plugins that implement :ref:`EditorPlugin._has_main_screen`. +Returns the editor control responsible for main screen plugins and tools. Use it with plugins that implement :ref:`EditorPlugin._has_main_screen()`. \ **Note:** This node is a :ref:`VBoxContainer`, which means that if you add a :ref:`Control` child to it, you need to set the child's :ref:`Control.size_flags_vertical` to :ref:`Control.SIZE_EXPAND_FILL` to make it use the full available space. @@ -447,7 +447,7 @@ Returns the 2D editor :ref:`SubViewport`. It does not have a :ref:`SubViewport` **get_editor_viewport_3d**\ (\ idx\: :ref:`int` = 0\ ) |const| :ref:`πŸ”—` -Returns the specified 3D editor :ref:`SubViewport`, from ``0`` to ``3``. The viewport can be used to access the active editor cameras with :ref:`Viewport.get_camera_3d`. +Returns the specified 3D editor :ref:`SubViewport`, from ``0`` to ``3``. The viewport can be used to access the active editor cameras with :ref:`Viewport.get_camera_3d()`. .. rst-class:: classref-item-separator @@ -697,7 +697,9 @@ Plays the main scene. .. rst-class:: classref-method -|void| **popup_create_dialog**\ (\ callback\: :ref:`Callable`, base_type\: :ref:`StringName` = "", current_type\: :ref:`String` = "", dialog_title\: :ref:`String` = "", type_blocklist\: :ref:`Array`\[:ref:`StringName`\] = [], type_suffixes\: :ref:`Dictionary` = {}\ ) :ref:`πŸ”—` +|void| **popup_create_dialog**\ (\ callback\: :ref:`Callable`, base_type\: :ref:`StringName` = "", current_type\: :ref:`String` = "", dialog_title\: :ref:`String` = "", type_blocklist\: :ref:`Array`\[:ref:`StringName`\] = []\ ) :ref:`πŸ”—` + +**Experimental:** This method may be changed or removed in future versions. Pops up an editor dialog for creating an object. @@ -711,22 +713,6 @@ The ``dialog_title`` allows you to define a custom title for the dialog. This is The ``type_blocklist`` contains a list of type names, and the types in the blocklist will be hidden from the create dialog. -The ``type_suffixes`` is a dictionary, with keys being :ref:`StringName`\ s and values being :ref:`String`\ s. Custom suffixes override the default suffixes which are file names of their scripts. For example, if you set a custom suffix as "Custom Suffix" for a global script type, - -.. code:: text - - Node - |- MyCustomNode (my_custom_node.gd) - -will be - -.. code:: text - - Node - |- MyCustomNode (Custom Suffix) - -Bear in mind that when a built-in type does not have any custom suffix, its suffix will be removed. The suffix of a type created from a script will fall back to its script file name. For global types by scripts, if you customize their suffixes to an empty string, their suffixes will be removed. - \ **Note:** Trying to list the base type in the ``type_blocklist`` will hide all types derived from the base type from the create dialog. .. rst-class:: classref-item-separator @@ -739,9 +725,9 @@ Bear in mind that when a built-in type does not have any custom suffix, its suff |void| **popup_dialog**\ (\ dialog\: :ref:`Window`, rect\: :ref:`Rect2i` = Rect2i(0, 0, 0, 0)\ ) :ref:`πŸ”—` -Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive`. The dialog must have no current parent, otherwise the method fails. +Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive()`. The dialog must have no current parent, otherwise the method fails. -See also :ref:`Window.set_unparent_when_invisible`. +See also :ref:`Window.set_unparent_when_invisible()`. .. rst-class:: classref-item-separator @@ -753,9 +739,9 @@ See also :ref:`Window.set_unparent_when_invisible`, minsize\: :ref:`Vector2i` = Vector2i(0, 0)\ ) :ref:`πŸ”—` -Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered`. The dialog must have no current parent, otherwise the method fails. +Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered()`. The dialog must have no current parent, otherwise the method fails. -See also :ref:`Window.set_unparent_when_invisible`. +See also :ref:`Window.set_unparent_when_invisible()`. .. rst-class:: classref-item-separator @@ -767,9 +753,9 @@ See also :ref:`Window.set_unparent_when_invisible`, minsize\: :ref:`Vector2i` = Vector2i(0, 0), fallback_ratio\: :ref:`float` = 0.75\ ) :ref:`πŸ”—` -Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered_clamped`. The dialog must have no current parent, otherwise the method fails. +Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered_clamped()`. The dialog must have no current parent, otherwise the method fails. -See also :ref:`Window.set_unparent_when_invisible`. +See also :ref:`Window.set_unparent_when_invisible()`. .. rst-class:: classref-item-separator @@ -781,9 +767,9 @@ See also :ref:`Window.set_unparent_when_invisible`, ratio\: :ref:`float` = 0.8\ ) :ref:`πŸ”—` -Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered_ratio`. The dialog must have no current parent, otherwise the method fails. +Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered_ratio()`. The dialog must have no current parent, otherwise the method fails. -See also :ref:`Window.set_unparent_when_invisible`. +See also :ref:`Window.set_unparent_when_invisible()`. .. rst-class:: classref-item-separator @@ -833,7 +819,7 @@ Pops up an editor dialog for selecting a :ref:`Node` from the edited |void| **popup_property_selector**\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array(), current_value\: :ref:`String` = ""\ ) :ref:`πŸ”—` -Pops up an editor dialog for selecting properties from ``object``. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected property path (see :ref:`NodePath.get_as_property_path`) or the empty path ``^""`` if the dialog is canceled. If ``type_filter`` is provided, the dialog will only show properties that match one of the listed :ref:`Variant.Type` values. If ``current_value`` is provided, the property will be selected automatically in the property list, if it exists. +Pops up an editor dialog for selecting properties from ``object``. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected property path (see :ref:`NodePath.get_as_property_path()`) or the empty path ``^""`` if the dialog is canceled. If ``type_filter`` is provided, the dialog will only show properties that match one of the listed :ref:`Variant.Type` values. If ``current_value`` is provided, the property will be selected automatically in the property list, if it exists. :: @@ -945,7 +931,7 @@ Selects and activates the specified feature profile with the given ``profile_nam A feature profile can be created programmatically using the :ref:`EditorFeatureProfile` class. -\ **Note:** The feature profile that gets activated must be located in the ``feature_profiles`` directory, as a file with the ``.profile`` extension. If a profile could not be found, an error occurs. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir`. +\ **Note:** The feature profile that gets activated must be located in the ``feature_profiles`` directory, as a file with the ``.profile`` extension. If a profile could not be found, an error occurs. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editornode3dgizmo.rst b/classes/class_editornode3dgizmo.rst index e5977c727be..59b5f87621f 100644 --- a/classes/class_editornode3dgizmo.rst +++ b/classes/class_editornode3dgizmo.rst @@ -110,11 +110,11 @@ Method Descriptions |void| **_commit_handle**\ (\ id\: :ref:`int`, secondary\: :ref:`bool`, restore\: :ref:`Variant`, cancel\: :ref:`bool`\ ) |virtual| :ref:`πŸ”—` -Override this method to commit a handle being edited (handles must have been previously added by :ref:`add_handles`). This usually means creating an :ref:`UndoRedo` action for the change, using the current handle value as "do" and the ``restore`` argument as "undo". +Override this method to commit a handle being edited (handles must have been previously added by :ref:`add_handles()`). This usually means creating an :ref:`UndoRedo` action for the change, using the current handle value as "do" and the ``restore`` argument as "undo". If the ``cancel`` argument is ``true``, the ``restore`` value should be directly set, without any :ref:`UndoRedo` action. -The ``secondary`` argument is ``true`` when the committed handle is secondary (see :ref:`add_handles` for more information). +The ``secondary`` argument is ``true`` when the committed handle is secondary (see :ref:`add_handles()` for more information). .. rst-class:: classref-item-separator @@ -126,7 +126,7 @@ The ``secondary`` argument is ``true`` when the committed handle is secondary (s |void| **_commit_subgizmos**\ (\ ids\: :ref:`PackedInt32Array`, restores\: :ref:`Array`\[:ref:`Transform3D`\], cancel\: :ref:`bool`\ ) |virtual| :ref:`πŸ”—` -Override this method to commit a group of subgizmos being edited (see :ref:`_subgizmos_intersect_ray` and :ref:`_subgizmos_intersect_frustum`). This usually means creating an :ref:`UndoRedo` action for the change, using the current transforms as "do" and the ``restores`` transforms as "undo". +Override this method to commit a group of subgizmos being edited (see :ref:`_subgizmos_intersect_ray()` and :ref:`_subgizmos_intersect_frustum()`). This usually means creating an :ref:`UndoRedo` action for the change, using the current transforms as "do" and the ``restores`` transforms as "undo". If the ``cancel`` argument is ``true``, the ``restores`` transforms should be directly set, without any :ref:`UndoRedo` action. @@ -140,9 +140,9 @@ If the ``cancel`` argument is ``true``, the ``restores`` transforms should be di :ref:`String` **_get_handle_name**\ (\ id\: :ref:`int`, secondary\: :ref:`bool`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return the name of an edited handle (handles must have been previously added by :ref:`add_handles`). Handles can be named for reference to the user when editing. +Override this method to return the name of an edited handle (handles must have been previously added by :ref:`add_handles()`). Handles can be named for reference to the user when editing. -The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`add_handles` for more information). +The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`add_handles()` for more information). .. rst-class:: classref-item-separator @@ -154,9 +154,9 @@ The ``secondary`` argument is ``true`` when the requested handle is secondary (s :ref:`Variant` **_get_handle_value**\ (\ id\: :ref:`int`, secondary\: :ref:`bool`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the ``restore`` argument in :ref:`_commit_handle`. +Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the ``restore`` argument in :ref:`_commit_handle()`. -The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`add_handles` for more information). +The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`add_handles()` for more information). .. rst-class:: classref-item-separator @@ -168,7 +168,7 @@ The ``secondary`` argument is ``true`` when the requested handle is secondary (s :ref:`Transform3D` **_get_subgizmo_transform**\ (\ id\: :ref:`int`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the ``restore`` argument in :ref:`_commit_subgizmos`. +Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the ``restore`` argument in :ref:`_commit_subgizmos()`. .. rst-class:: classref-item-separator @@ -182,7 +182,7 @@ Override this method to return the current transform of a subgizmo. This transfo Override this method to return ``true`` whenever the given handle should be highlighted in the editor. -The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`add_handles` for more information). +The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`add_handles()` for more information). .. rst-class:: classref-item-separator @@ -194,7 +194,7 @@ The ``secondary`` argument is ``true`` when the requested handle is secondary (s |void| **_redraw**\ (\ ) |virtual| :ref:`πŸ”—` -Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call :ref:`clear` at the beginning of this method and then add visual elements depending on the node's properties. +Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call :ref:`clear()` at the beginning of this method and then add visual elements depending on the node's properties. .. rst-class:: classref-item-separator @@ -206,9 +206,9 @@ Override this method to add all the gizmo elements whenever a gizmo update is re |void| **_set_handle**\ (\ id\: :ref:`int`, secondary\: :ref:`bool`, camera\: :ref:`Camera3D`, point\: :ref:`Vector2`\ ) |virtual| :ref:`πŸ”—` -Override this method to update the node properties when the user drags a gizmo handle (previously added with :ref:`add_handles`). The provided ``point`` is the mouse position in screen coordinates and the ``camera`` can be used to convert it to raycasts. +Override this method to update the node properties when the user drags a gizmo handle (previously added with :ref:`add_handles()`). The provided ``point`` is the mouse position in screen coordinates and the ``camera`` can be used to convert it to raycasts. -The ``secondary`` argument is ``true`` when the edited handle is secondary (see :ref:`add_handles` for more information). +The ``secondary`` argument is ``true`` when the edited handle is secondary (see :ref:`add_handles()` for more information). .. rst-class:: classref-item-separator @@ -220,7 +220,7 @@ The ``secondary`` argument is ``true`` when the edited handle is secondary (see |void| **_set_subgizmo_transform**\ (\ id\: :ref:`int`, transform\: :ref:`Transform3D`\ ) |virtual| :ref:`πŸ”—` -Override this method to update the node properties during subgizmo editing (see :ref:`_subgizmos_intersect_ray` and :ref:`_subgizmos_intersect_frustum`). The ``transform`` is given in the :ref:`Node3D`'s local coordinate system. +Override this method to update the node properties during subgizmo editing (see :ref:`_subgizmos_intersect_ray()` and :ref:`_subgizmos_intersect_frustum()`). The ``transform`` is given in the :ref:`Node3D`'s local coordinate system. .. rst-class:: classref-item-separator @@ -232,7 +232,7 @@ Override this method to update the node properties during subgizmo editing (see :ref:`PackedInt32Array` **_subgizmos_intersect_frustum**\ (\ camera\: :ref:`Camera3D`, frustum\: :ref:`Array`\[:ref:`Plane`\]\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to allow selecting subgizmos using mouse drag box selection. Given a ``camera`` and a ``frustum``, this method should return which subgizmos are contained within the frustum. The ``frustum`` argument consists of an array with all the :ref:`Plane`\ s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform` or :ref:`_commit_subgizmos`. +Override this method to allow selecting subgizmos using mouse drag box selection. Given a ``camera`` and a ``frustum``, this method should return which subgizmos are contained within the frustum. The ``frustum`` argument consists of an array with all the :ref:`Plane`\ s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform()` or :ref:`_commit_subgizmos()`. .. rst-class:: classref-item-separator @@ -244,7 +244,7 @@ Override this method to allow selecting subgizmos using mouse drag box selection :ref:`int` **_subgizmos_intersect_ray**\ (\ camera\: :ref:`Camera3D`, point\: :ref:`Vector2`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to allow selecting subgizmos using mouse clicks. Given a ``camera`` and a ``point`` in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform` or :ref:`_commit_subgizmos`. +Override this method to allow selecting subgizmos using mouse clicks. Given a ``camera`` and a ``point`` in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform()` or :ref:`_commit_subgizmos()`. .. rst-class:: classref-item-separator @@ -256,7 +256,7 @@ Override this method to allow selecting subgizmos using mouse clicks. Given a `` |void| **add_collision_segments**\ (\ segments\: :ref:`PackedVector3Array`\ ) :ref:`πŸ”—` -Adds the specified ``segments`` to the gizmo's collision shape for picking. Call this method during :ref:`_redraw`. +Adds the specified ``segments`` to the gizmo's collision shape for picking. Call this method during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -268,7 +268,7 @@ Adds the specified ``segments`` to the gizmo's collision shape for picking. Call |void| **add_collision_triangles**\ (\ triangles\: :ref:`TriangleMesh`\ ) :ref:`πŸ”—` -Adds collision triangles to the gizmo for picking. A :ref:`TriangleMesh` can be generated from a regular :ref:`Mesh` too. Call this method during :ref:`_redraw`. +Adds collision triangles to the gizmo for picking. A :ref:`TriangleMesh` can be generated from a regular :ref:`Mesh` too. Call this method during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -284,7 +284,7 @@ Adds a list of handles (points) which can be used to edit the properties of the The ``secondary`` argument marks the added handles as secondary, meaning they will normally have lower selection priority than regular handles. When the user is holding the shift key secondary handles will switch to have higher priority than regular handles. This change in priority can be used to place multiple handles at the same point while still giving the user control on their selection. -There are virtual methods which will be called upon editing of these handles. Call this method during :ref:`_redraw`. +There are virtual methods which will be called upon editing of these handles. Call this method during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -296,7 +296,7 @@ There are virtual methods which will be called upon editing of these handles. Ca |void| **add_lines**\ (\ lines\: :ref:`PackedVector3Array`, material\: :ref:`Material`, billboard\: :ref:`bool` = false, modulate\: :ref:`Color` = Color(1, 1, 1, 1)\ ) :ref:`πŸ”—` -Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this method during :ref:`_redraw`. +Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this method during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -308,7 +308,7 @@ Adds lines to the gizmo (as sets of 2 points), with a given material. The lines |void| **add_mesh**\ (\ mesh\: :ref:`Mesh`, material\: :ref:`Material` = null, transform\: :ref:`Transform3D` = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0), skeleton\: :ref:`SkinReference` = null\ ) :ref:`πŸ”—` -Adds a mesh to the gizmo with the specified ``material``, local ``transform`` and ``skeleton``. Call this method during :ref:`_redraw`. +Adds a mesh to the gizmo with the specified ``material``, local ``transform`` and ``skeleton``. Call this method during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -320,7 +320,7 @@ Adds a mesh to the gizmo with the specified ``material``, local ``transform`` an |void| **add_unscaled_billboard**\ (\ material\: :ref:`Material`, default_scale\: :ref:`float` = 1, modulate\: :ref:`Color` = Color(1, 1, 1, 1)\ ) :ref:`πŸ”—` -Adds an unscaled billboard for visualization and selection. Call this method during :ref:`_redraw`. +Adds an unscaled billboard for visualization and selection. Call this method during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -356,7 +356,7 @@ Returns the :ref:`Node3D` node associated with this gizmo. :ref:`EditorNode3DGizmoPlugin` **get_plugin**\ (\ ) |const| :ref:`πŸ”—` -Returns the :ref:`EditorNode3DGizmoPlugin` that owns this gizmo. It's useful to retrieve materials using :ref:`EditorNode3DGizmoPlugin.get_material`. +Returns the :ref:`EditorNode3DGizmoPlugin` that owns this gizmo. It's useful to retrieve materials using :ref:`EditorNode3DGizmoPlugin.get_material()`. .. rst-class:: classref-item-separator @@ -368,7 +368,7 @@ Returns the :ref:`EditorNode3DGizmoPlugin` that o :ref:`PackedInt32Array` **get_subgizmo_selection**\ (\ ) |const| :ref:`πŸ”—` -Returns a list of the currently selected subgizmos. Can be used to highlight selected elements during :ref:`_redraw`. +Returns a list of the currently selected subgizmos. Can be used to highlight selected elements during :ref:`_redraw()`. .. rst-class:: classref-item-separator @@ -380,7 +380,7 @@ Returns a list of the currently selected subgizmos. Can be used to highlight sel :ref:`bool` **is_subgizmo_selected**\ (\ id\: :ref:`int`\ ) |const| :ref:`πŸ”—` -Returns ``true`` if the given subgizmo is currently selected. Can be used to highlight selected elements during :ref:`_redraw`. +Returns ``true`` if the given subgizmo is currently selected. Can be used to highlight selected elements during :ref:`_redraw()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editornode3dgizmoplugin.rst b/classes/class_editornode3dgizmoplugin.rst index 73b435bffbb..5bdbc2e5dd9 100644 --- a/classes/class_editornode3dgizmoplugin.rst +++ b/classes/class_editornode3dgizmoplugin.rst @@ -21,7 +21,7 @@ Description **EditorNode3DGizmoPlugin** allows you to define a new type of Gizmo. There are two main ways to do so: extending **EditorNode3DGizmoPlugin** for the simpler gizmos, or creating a new :ref:`EditorNode3DGizmo` type. See the tutorial in the documentation for more info. -To use **EditorNode3DGizmoPlugin**, register it using the :ref:`EditorPlugin.add_node_3d_gizmo_plugin` method first. +To use **EditorNode3DGizmoPlugin**, register it using the :ref:`EditorPlugin.add_node_3d_gizmo_plugin()` method first. .. rst-class:: classref-introduction-group @@ -127,11 +127,11 @@ Override this method to define whether the gizmos handled by this plugin can be |void| **_commit_handle**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, handle_id\: :ref:`int`, secondary\: :ref:`bool`, restore\: :ref:`Variant`, cancel\: :ref:`bool`\ ) |virtual| :ref:`πŸ”—` -Override this method to commit a handle being edited (handles must have been previously added by :ref:`EditorNode3DGizmo.add_handles` during :ref:`_redraw`). This usually means creating an :ref:`UndoRedo` action for the change, using the current handle value as "do" and the ``restore`` argument as "undo". +Override this method to commit a handle being edited (handles must have been previously added by :ref:`EditorNode3DGizmo.add_handles()` during :ref:`_redraw()`). This usually means creating an :ref:`UndoRedo` action for the change, using the current handle value as "do" and the ``restore`` argument as "undo". If the ``cancel`` argument is ``true``, the ``restore`` value should be directly set, without any :ref:`UndoRedo` action. -The ``secondary`` argument is ``true`` when the committed handle is secondary (see :ref:`EditorNode3DGizmo.add_handles` for more information). +The ``secondary`` argument is ``true`` when the committed handle is secondary (see :ref:`EditorNode3DGizmo.add_handles()` for more information). Called for this plugin's active gizmos. @@ -145,7 +145,7 @@ Called for this plugin's active gizmos. |void| **_commit_subgizmos**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, ids\: :ref:`PackedInt32Array`, restores\: :ref:`Array`\[:ref:`Transform3D`\], cancel\: :ref:`bool`\ ) |virtual| :ref:`πŸ”—` -Override this method to commit a group of subgizmos being edited (see :ref:`_subgizmos_intersect_ray` and :ref:`_subgizmos_intersect_frustum`). This usually means creating an :ref:`UndoRedo` action for the change, using the current transforms as "do" and the ``restores`` transforms as "undo". +Override this method to commit a group of subgizmos being edited (see :ref:`_subgizmos_intersect_ray()` and :ref:`_subgizmos_intersect_frustum()`). This usually means creating an :ref:`UndoRedo` action for the change, using the current transforms as "do" and the ``restores`` transforms as "undo". If the ``cancel`` argument is ``true``, the ``restores`` transforms should be directly set, without any :ref:`UndoRedo` action. As with all subgizmo methods, transforms are given in local space respect to the gizmo's Node3D. Called for this plugin's active gizmos. @@ -159,7 +159,7 @@ If the ``cancel`` argument is ``true``, the ``restores`` transforms should be di :ref:`EditorNode3DGizmo` **_create_gizmo**\ (\ for_node_3d\: :ref:`Node3D`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return a custom :ref:`EditorNode3DGizmo` for the 3D nodes of your choice, return ``null`` for the rest of nodes. See also :ref:`_has_gizmo`. +Override this method to return a custom :ref:`EditorNode3DGizmo` for the 3D nodes of your choice, return ``null`` for the rest of nodes. See also :ref:`_has_gizmo()`. .. rst-class:: classref-item-separator @@ -183,7 +183,7 @@ Override this method to provide the name that will appear in the gizmo visibilit :ref:`String` **_get_handle_name**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, handle_id\: :ref:`int`, secondary\: :ref:`bool`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to provide gizmo's handle names. The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`EditorNode3DGizmo.add_handles` for more information). Called for this plugin's active gizmos. +Override this method to provide gizmo's handle names. The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`EditorNode3DGizmo.add_handles()` for more information). Called for this plugin's active gizmos. .. rst-class:: classref-item-separator @@ -195,9 +195,9 @@ Override this method to provide gizmo's handle names. The ``secondary`` argument :ref:`Variant` **_get_handle_value**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, handle_id\: :ref:`int`, secondary\: :ref:`bool`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the ``restore`` argument in :ref:`_commit_handle`. +Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the ``restore`` argument in :ref:`_commit_handle()`. -The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`EditorNode3DGizmo.add_handles` for more information). +The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`EditorNode3DGizmo.add_handles()` for more information). Called for this plugin's active gizmos. @@ -225,7 +225,7 @@ All built-in editor gizmos return a priority of ``-1``. If not overridden, this :ref:`Transform3D` **_get_subgizmo_transform**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, subgizmo_id\: :ref:`int`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the ``restore`` argument in :ref:`_commit_subgizmos`. Called for this plugin's active gizmos. +Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the ``restore`` argument in :ref:`_commit_subgizmos()`. Called for this plugin's active gizmos. .. rst-class:: classref-item-separator @@ -249,7 +249,7 @@ Override this method to define which Node3D nodes have a gizmo from this plugin. :ref:`bool` **_is_handle_highlighted**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, handle_id\: :ref:`int`, secondary\: :ref:`bool`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to return ``true`` whenever to given handle should be highlighted in the editor. The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`EditorNode3DGizmo.add_handles` for more information). Called for this plugin's active gizmos. +Override this method to return ``true`` whenever to given handle should be highlighted in the editor. The ``secondary`` argument is ``true`` when the requested handle is secondary (see :ref:`EditorNode3DGizmo.add_handles()` for more information). Called for this plugin's active gizmos. .. rst-class:: classref-item-separator @@ -273,7 +273,7 @@ Override this method to define whether Node3D with this gizmo should be selectab |void| **_redraw**\ (\ gizmo\: :ref:`EditorNode3DGizmo`\ ) |virtual| :ref:`πŸ”—` -Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call :ref:`EditorNode3DGizmo.clear` at the beginning of this method and then add visual elements depending on the node's properties. +Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call :ref:`EditorNode3DGizmo.clear()` at the beginning of this method and then add visual elements depending on the node's properties. .. rst-class:: classref-item-separator @@ -285,9 +285,9 @@ Override this method to add all the gizmo elements whenever a gizmo update is re |void| **_set_handle**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, handle_id\: :ref:`int`, secondary\: :ref:`bool`, camera\: :ref:`Camera3D`, screen_pos\: :ref:`Vector2`\ ) |virtual| :ref:`πŸ”—` -Override this method to update the node's properties when the user drags a gizmo handle (previously added with :ref:`EditorNode3DGizmo.add_handles`). The provided ``screen_pos`` is the mouse position in screen coordinates and the ``camera`` can be used to convert it to raycasts. +Override this method to update the node's properties when the user drags a gizmo handle (previously added with :ref:`EditorNode3DGizmo.add_handles()`). The provided ``screen_pos`` is the mouse position in screen coordinates and the ``camera`` can be used to convert it to raycasts. -The ``secondary`` argument is ``true`` when the edited handle is secondary (see :ref:`EditorNode3DGizmo.add_handles` for more information). +The ``secondary`` argument is ``true`` when the edited handle is secondary (see :ref:`EditorNode3DGizmo.add_handles()` for more information). Called for this plugin's active gizmos. @@ -301,7 +301,7 @@ Called for this plugin's active gizmos. |void| **_set_subgizmo_transform**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, subgizmo_id\: :ref:`int`, transform\: :ref:`Transform3D`\ ) |virtual| :ref:`πŸ”—` -Override this method to update the node properties during subgizmo editing (see :ref:`_subgizmos_intersect_ray` and :ref:`_subgizmos_intersect_frustum`). The ``transform`` is given in the Node3D's local coordinate system. Called for this plugin's active gizmos. +Override this method to update the node properties during subgizmo editing (see :ref:`_subgizmos_intersect_ray()` and :ref:`_subgizmos_intersect_frustum()`). The ``transform`` is given in the Node3D's local coordinate system. Called for this plugin's active gizmos. .. rst-class:: classref-item-separator @@ -313,7 +313,7 @@ Override this method to update the node properties during subgizmo editing (see :ref:`PackedInt32Array` **_subgizmos_intersect_frustum**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, camera\: :ref:`Camera3D`, frustum_planes\: :ref:`Array`\[:ref:`Plane`\]\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to allow selecting subgizmos using mouse drag box selection. Given a ``camera`` and ``frustum_planes``, this method should return which subgizmos are contained within the frustums. The ``frustum_planes`` argument consists of an array with all the :ref:`Plane`\ s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform` or :ref:`_commit_subgizmos`. Called for this plugin's active gizmos. +Override this method to allow selecting subgizmos using mouse drag box selection. Given a ``camera`` and ``frustum_planes``, this method should return which subgizmos are contained within the frustums. The ``frustum_planes`` argument consists of an array with all the :ref:`Plane`\ s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform()` or :ref:`_commit_subgizmos()`. Called for this plugin's active gizmos. .. rst-class:: classref-item-separator @@ -325,7 +325,7 @@ Override this method to allow selecting subgizmos using mouse drag box selection :ref:`int` **_subgizmos_intersect_ray**\ (\ gizmo\: :ref:`EditorNode3DGizmo`, camera\: :ref:`Camera3D`, screen_pos\: :ref:`Vector2`\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to allow selecting subgizmos using mouse clicks. Given a ``camera`` and a ``screen_pos`` in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform` or :ref:`_commit_subgizmos`. Called for this plugin's active gizmos. +Override this method to allow selecting subgizmos using mouse clicks. Given a ``camera`` and a ``screen_pos`` in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like :ref:`_get_subgizmo_transform()` or :ref:`_commit_subgizmos()`. Called for this plugin's active gizmos. .. rst-class:: classref-item-separator @@ -337,7 +337,7 @@ Override this method to allow selecting subgizmos using mouse clicks. Given a `` |void| **add_material**\ (\ name\: :ref:`String`, material\: :ref:`StandardMaterial3D`\ ) :ref:`πŸ”—` -Adds a new material to the internal material list for the plugin. It can then be accessed with :ref:`get_material`. Should not be overridden. +Adds a new material to the internal material list for the plugin. It can then be accessed with :ref:`get_material()`. Should not be overridden. .. rst-class:: classref-item-separator @@ -349,7 +349,7 @@ Adds a new material to the internal material list for the plugin. It can then be |void| **create_handle_material**\ (\ name\: :ref:`String`, billboard\: :ref:`bool` = false, texture\: :ref:`Texture2D` = null\ ) :ref:`πŸ”—` -Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material` and used in :ref:`EditorNode3DGizmo.add_handles`. Should not be overridden. +Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material()` and used in :ref:`EditorNode3DGizmo.add_handles()`. Should not be overridden. You can optionally provide a texture to use instead of the default icon. @@ -363,7 +363,7 @@ You can optionally provide a texture to use instead of the default icon. |void| **create_icon_material**\ (\ name\: :ref:`String`, texture\: :ref:`Texture2D`, on_top\: :ref:`bool` = false, color\: :ref:`Color` = Color(1, 1, 1, 1)\ ) :ref:`πŸ”—` -Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material` and used in :ref:`EditorNode3DGizmo.add_unscaled_billboard`. Should not be overridden. +Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material()` and used in :ref:`EditorNode3DGizmo.add_unscaled_billboard()`. Should not be overridden. .. rst-class:: classref-item-separator @@ -375,7 +375,7 @@ Creates an icon material with its variants (selected and/or editable) and adds t |void| **create_material**\ (\ name\: :ref:`String`, color\: :ref:`Color`, billboard\: :ref:`bool` = false, on_top\: :ref:`bool` = false, use_vertex_color\: :ref:`bool` = false\ ) :ref:`πŸ”—` -Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material` and used in :ref:`EditorNode3DGizmo.add_mesh` and :ref:`EditorNode3DGizmo.add_lines`. Should not be overridden. +Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material()` and used in :ref:`EditorNode3DGizmo.add_mesh()` and :ref:`EditorNode3DGizmo.add_lines()`. Should not be overridden. .. rst-class:: classref-item-separator diff --git a/classes/class_editorpaths.rst b/classes/class_editorpaths.rst index f027e563d49..1b86cefd8f6 100644 --- a/classes/class_editorpaths.rst +++ b/classes/class_editorpaths.rst @@ -21,7 +21,7 @@ Description This editor-only singleton returns OS-specific paths to various data folders and files. It can be used in editor plugins to ensure files are saved in the correct location on each operating system. -\ **Note:** This singleton is not accessible in exported projects. Attempting to access it in an exported project will result in a script error as the singleton won't be declared. To prevent script errors in exported projects, use :ref:`Engine.has_singleton` to check whether the singleton is available before using it. +\ **Note:** This singleton is not accessible in exported projects. Attempting to access it in an exported project will result in a script error as the singleton won't be declared. To prevent script errors in exported projects, use :ref:`Engine.has_singleton()` to check whether the singleton is available before using it. \ **Note:** On the Linux/BSD platform, Redot complies with the `XDG Base Directory Specification `__. You can override environment variables following the specification to change the editor and project data paths. @@ -141,7 +141,7 @@ Returns the project-specific editor settings path. Projects all have a unique su :ref:`String` **get_self_contained_file**\ (\ ) |const| :ref:`πŸ”—` -Returns the absolute path to the self-contained file that makes the current Redot editor instance be considered as self-contained. Returns an empty string if the current Redot editor instance isn't self-contained. See also :ref:`is_self_contained`. +Returns the absolute path to the self-contained file that makes the current Redot editor instance be considered as self-contained. Returns an empty string if the current Redot editor instance isn't self-contained. See also :ref:`is_self_contained()`. .. rst-class:: classref-item-separator @@ -155,7 +155,7 @@ Returns the absolute path to the self-contained file that makes the current Redo Returns ``true`` if the editor is marked as self-contained, ``false`` otherwise. When self-contained mode is enabled, user configuration, data and cache files are saved in an ``editor_data/`` folder next to the editor binary. This makes portable usage easier and ensures the Redot editor minimizes file writes outside its own folder. Self-contained mode is not available for exported projects. -Self-contained mode can be enabled by creating a file named ``._sc_`` or ``_sc_`` in the same folder as the editor binary or macOS .app bundle while the editor is not running. See also :ref:`get_self_contained_file`. +Self-contained mode can be enabled by creating a file named ``._sc_`` or ``_sc_`` in the same folder as the editor binary or macOS .app bundle while the editor is not running. See also :ref:`get_self_contained_file()`. \ **Note:** On macOS, quarantine flag should be manually removed before using self-contained mode, see `Running on macOS `__. diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst index 81a22005ba2..20acbaf09b8 100644 --- a/classes/class_editorplugin.rst +++ b/classes/class_editorplugin.rst @@ -525,7 +525,7 @@ This is used, for example, in shader editors to let the plugin know that it must This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs. -This method must return a boolean. If this method returns ``false``, the project will not run. The run is aborted immediately, so this also prevents all other plugins' :ref:`_build` methods from running. +This method must return a boolean. If this method returns ``false``, the project will not run. The run is aborted immediately, so this also prevents all other plugins' :ref:`_build()` methods from running. .. rst-class:: classref-item-separator @@ -587,7 +587,7 @@ Called by the engine when the user enables the **EditorPlugin** in the Plugin ta |void| **_forward_3d_draw_over_viewport**\ (\ viewport_control\: :ref:`Control`\ ) |virtual| :ref:`πŸ”—` -Called by the engine when the 3D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays`. +Called by the engine when the 3D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays()`. .. tabs:: @@ -636,9 +636,9 @@ Called by the engine when the 3D editor's viewport is updated. Use the ``overlay |void| **_forward_3d_force_draw_over_viewport**\ (\ viewport_control\: :ref:`Control`\ ) |virtual| :ref:`πŸ”—` -This method is the same as :ref:`_forward_3d_draw_over_viewport`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. +This method is the same as :ref:`_forward_3d_draw_over_viewport()`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. -You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled`. +You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled()`. .. rst-class:: classref-item-separator @@ -650,7 +650,7 @@ You need to enable calling of this method by using :ref:`set_force_draw_over_for :ref:`int` **_forward_3d_gui_input**\ (\ viewport_camera\: :ref:`Camera3D`, event\: :ref:`InputEvent`\ ) |virtual| :ref:`πŸ”—` -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. +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. .. tabs:: @@ -702,7 +702,7 @@ This method must return :ref:`AFTER_GUI_INPUT_PASS`\ ) |virtual| :ref:`πŸ”—` -Called by the engine when the 2D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays`. +Called by the engine when the 2D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays()`. .. tabs:: @@ -751,9 +751,9 @@ Called by the engine when the 2D editor's viewport is updated. Use the ``overlay |void| **_forward_canvas_force_draw_over_viewport**\ (\ viewport_control\: :ref:`Control`\ ) |virtual| :ref:`πŸ”—` -This method is the same as :ref:`_forward_canvas_draw_over_viewport`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. +This method is the same as :ref:`_forward_canvas_draw_over_viewport()`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. -You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled`. +You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled()`. .. rst-class:: classref-item-separator @@ -765,7 +765,7 @@ You need to enable calling of this method by using :ref:`set_force_draw_over_for :ref:`bool` **_forward_canvas_gui_input**\ (\ event\: :ref:`InputEvent`\ ) |virtual| :ref:`πŸ”—` -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. If this method returns ``true``, ``event`` is intercepted by this **EditorPlugin**, otherwise ``event`` is forwarded to other Editor classes. +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. If this method returns ``true``, ``event`` is intercepted by this **EditorPlugin**, otherwise ``event`` is forwarded to other Editor classes. .. tabs:: @@ -888,13 +888,13 @@ For main screen plugins, this appears at the top of the screen, to the right of :ref:`Dictionary` **_get_state**\ (\ ) |virtual| |const| :ref:`πŸ”—` -Override this method to provide a state data you want to be saved, like view position, grid settings, folding, etc. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). This data is automatically saved for each scene in an ``editstate`` file in the editor metadata folder. If you want to store global (scene-independent) editor data for your plugin, you can use :ref:`_get_window_layout` instead. +Override this method to provide a state data you want to be saved, like view position, grid settings, folding, etc. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). This data is automatically saved for each scene in an ``editstate`` file in the editor metadata folder. If you want to store global (scene-independent) editor data for your plugin, you can use :ref:`_get_window_layout()` instead. -Use :ref:`_set_state` to restore your saved state. +Use :ref:`_set_state()` to restore your saved state. \ **Note:** This method should not be used to save important settings that should persist with the project. -\ **Note:** You must implement :ref:`_get_plugin_name` for the state to be stored and restored correctly. +\ **Note:** You must implement :ref:`_get_plugin_name()` for the state to be stored and restored correctly. :: @@ -916,7 +916,7 @@ Override this method to provide a custom message that lists unsaved changes. The When closing a scene, ``for_scene`` is the path to the scene being closed. You can use it to handle built-in resources in that scene. -If the user confirms saving, :ref:`_save_external_data` will be called, before closing the editor. +If the user confirms saving, :ref:`_save_external_data()` will be called, before closing the editor. :: @@ -950,9 +950,9 @@ If the plugin has no scene-specific changes, you can ignore the calls when closi |void| **_get_window_layout**\ (\ configuration\: :ref:`ConfigFile`\ ) |virtual| :ref:`πŸ”—` -Override this method to provide the GUI layout of the plugin or any other data you want to be stored. This is used to save the project's editor layout when :ref:`queue_save_layout` is called or the editor layout was changed (for example changing the position of a dock). The data is stored in the ``editor_layout.cfg`` file in the editor metadata directory. +Override this method to provide the GUI layout of the plugin or any other data you want to be stored. This is used to save the project's editor layout when :ref:`queue_save_layout()` is called or the editor layout was changed (for example changing the position of a dock). The data is stored in the ``editor_layout.cfg`` file in the editor metadata directory. -Use :ref:`_set_window_layout` to restore your saved layout. +Use :ref:`_set_window_layout()` to restore your saved layout. :: @@ -970,7 +970,7 @@ Use :ref:`_set_window_layout` **_handles**\ (\ object\: :ref:`Object`\ ) |virtual| |const| :ref:`πŸ”—` -Implement this function if your plugin edits a specific type of object (Resource or Node). If you return ``true``, then you will get the functions :ref:`_edit` and :ref:`_make_visible` called when the editor requests them. If you have declared the methods :ref:`_forward_canvas_gui_input` and :ref:`_forward_3d_gui_input` these will be called too. +Implement this function if your plugin edits a specific type of object (Resource or Node). If you return ``true``, then you will get the functions :ref:`_edit()` and :ref:`_make_visible()` called when the editor requests them. If you have declared the methods :ref:`_forward_canvas_gui_input()` and :ref:`_forward_3d_gui_input()` these will be called too. \ **Note:** Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors. @@ -986,9 +986,9 @@ Implement this function if your plugin edits a specific type of object (Resource Returns ``true`` if this is a main screen editor plugin (it goes in the workspace selector together with **2D**, **3D**, **Script** and **AssetLib**). -When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of :ref:`EditorInterface.get_editor_main_screen` and made visible inside :ref:`_make_visible`. +When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of :ref:`EditorInterface.get_editor_main_screen()` and made visible inside :ref:`_make_visible()`. -Use :ref:`_get_plugin_name` and :ref:`_get_plugin_icon` to customize the plugin button's appearance. +Use :ref:`_get_plugin_name()` and :ref:`_get_plugin_icon()` to customize the plugin button's appearance. :: @@ -1047,9 +1047,9 @@ This method is called after the editor saves the project or when it's closed. It |void| **_set_state**\ (\ state\: :ref:`Dictionary`\ ) |virtual| :ref:`πŸ”—` -Restore the state saved by :ref:`_get_state`. This method is called when the current scene tab is changed in the editor. +Restore the state saved by :ref:`_get_state()`. This method is called when the current scene tab is changed in the editor. -\ **Note:** Your plugin must implement :ref:`_get_plugin_name`, otherwise it will not be recognized and this method will not be called. +\ **Note:** Your plugin must implement :ref:`_get_plugin_name()`, otherwise it will not be recognized and this method will not be called. :: @@ -1067,7 +1067,7 @@ Restore the state saved by :ref:`_get_state`\ ) |virtual| :ref:`πŸ”—` -Restore the plugin GUI layout and data saved by :ref:`_get_window_layout`. This method is called for every plugin on editor startup. Use the provided ``configuration`` file to read your saved data. +Restore the plugin GUI layout and data saved by :ref:`_get_window_layout()`. This method is called for every plugin on editor startup. Use the provided ``configuration`` file to read your saved data. :: @@ -1111,7 +1111,7 @@ See :ref:`ContextMenuSlot` for ava :ref:`Button` **add_control_to_bottom_panel**\ (\ control\: :ref:`Control`, title\: :ref:`String`, shortcut\: :ref:`Shortcut` = null\ ) :ref:`πŸ”—` -Adds a control to the bottom panel (together with Output, Debug, Animation, etc.). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_bottom_panel` and free it with :ref:`Node.queue_free`. +Adds a control to the bottom panel (together with Output, Debug, Animation, etc.). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_bottom_panel()` and free it with :ref:`Node.queue_free()`. Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the bottom panel's visibility. See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use :kbd:`Alt` modifier. @@ -1129,7 +1129,7 @@ Adds a custom control to a container (see :ref:`CustomControlContainer` and free it with :ref:`Node.queue_free`. +When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_container()` and free it with :ref:`Node.queue_free()`. .. rst-class:: classref-item-separator @@ -1145,7 +1145,7 @@ Adds the control to a specific dock slot (see :ref:`DockSlot` and free it with :ref:`Node.queue_free`. +When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_docks()` and free it with :ref:`Node.queue_free()`. Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the dock's visibility once it's moved to the bottom panel (this shortcut does not affect the dock otherwise). See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use :kbd:`Alt` modifier. @@ -1165,7 +1165,7 @@ When a given node or resource is selected, the base type will be instantiated (e \ **Note:** The base type is the base engine class which this type's class hierarchy inherits, not any custom type parent classes. -You can use the virtual method :ref:`_handles` to check if your custom object is being edited by checking the script or using the ``is`` keyword. +You can use the virtual method :ref:`_handles()` to check if your custom object is being edited by checking the script or using the ``is`` keyword. During run-time, this will be a simple object with a script so this function does not need to be called then. @@ -1207,7 +1207,7 @@ Registers a new :ref:`EditorExportPlatform`. Export Registers a new :ref:`EditorExportPlugin`. Export plugins are used to perform tasks when the project is being exported. -See :ref:`add_inspector_plugin` for an example of how to register a plugin. +See :ref:`add_inspector_plugin()` for an example of how to register a plugin. .. rst-class:: classref-item-separator @@ -1223,9 +1223,9 @@ Registers a new :ref:`EditorImportPlugin`. Import plug If ``first_priority`` is ``true``, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. -\ **Note:** If you want to import custom 3D asset formats use :ref:`add_scene_format_importer_plugin` instead. +\ **Note:** If you want to import custom 3D asset formats use :ref:`add_scene_format_importer_plugin()` instead. -See :ref:`add_inspector_plugin` for an example of how to register a plugin. +See :ref:`add_inspector_plugin()` for an example of how to register a plugin. .. rst-class:: classref-item-separator @@ -1239,7 +1239,7 @@ See :ref:`add_inspector_plugin` Registers a new :ref:`EditorInspectorPlugin`. Inspector plugins are used to extend :ref:`EditorInspector` and provide custom configuration tools for your object's properties. -\ **Note:** Always use :ref:`remove_inspector_plugin` to remove the registered :ref:`EditorInspectorPlugin` when your **EditorPlugin** is disabled to prevent leaks and an unexpected behavior. +\ **Note:** Always use :ref:`remove_inspector_plugin()` to remove the registered :ref:`EditorInspectorPlugin` when your **EditorPlugin** is disabled to prevent leaks and an unexpected behavior. .. tabs:: @@ -1269,7 +1269,7 @@ Registers a new :ref:`EditorInspectorPlugin`. Inspe Registers a new :ref:`EditorNode3DGizmoPlugin`. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a :ref:`Node3D`. -See :ref:`add_inspector_plugin` for an example of how to register a plugin. +See :ref:`add_inspector_plugin()` for an example of how to register a plugin. .. rst-class:: classref-item-separator @@ -1335,7 +1335,7 @@ Adds a custom menu item to **Project > Tools** named ``name``. When clicked, the |void| **add_tool_submenu_item**\ (\ name\: :ref:`String`, submenu\: :ref:`PopupMenu`\ ) :ref:`πŸ”—` -Adds a custom :ref:`PopupMenu` submenu under **Project > Tools >** ``name``. Use :ref:`remove_tool_menu_item` on plugin clean up to remove the menu. +Adds a custom :ref:`PopupMenu` submenu under **Project > Tools >** ``name``. Use :ref:`remove_tool_menu_item()` on plugin clean up to remove the menu. .. rst-class:: classref-item-separator @@ -1499,7 +1499,7 @@ Removes the specified context menu plugin. |void| **remove_control_from_bottom_panel**\ (\ control\: :ref:`Control`\ ) :ref:`πŸ”—` -Removes the control from the bottom panel. You have to manually :ref:`Node.queue_free` the control. +Removes the control from the bottom panel. You have to manually :ref:`Node.queue_free()` the control. .. rst-class:: classref-item-separator @@ -1511,7 +1511,7 @@ Removes the control from the bottom panel. You have to manually :ref:`Node.queue |void| **remove_control_from_container**\ (\ container\: :ref:`CustomControlContainer`, control\: :ref:`Control`\ ) :ref:`πŸ”—` -Removes the control from the specified container. You have to manually :ref:`Node.queue_free` the control. +Removes the control from the specified container. You have to manually :ref:`Node.queue_free()` the control. .. rst-class:: classref-item-separator @@ -1523,7 +1523,7 @@ Removes the control from the specified container. You have to manually :ref:`Nod |void| **remove_control_from_docks**\ (\ control\: :ref:`Control`\ ) :ref:`πŸ”—` -Removes the control from the dock. You have to manually :ref:`Node.queue_free` the control. +Removes the control from the dock. You have to manually :ref:`Node.queue_free()` the control. .. rst-class:: classref-item-separator @@ -1535,7 +1535,7 @@ Removes the control from the dock. You have to manually :ref:`Node.queue_free`\ ) :ref:`πŸ”—` -Removes a custom type added by :ref:`add_custom_type`. +Removes a custom type added by :ref:`add_custom_type()`. .. rst-class:: classref-item-separator @@ -1559,7 +1559,7 @@ Removes the debugger plugin with given script from the Debugger. |void| **remove_export_platform**\ (\ platform\: :ref:`EditorExportPlatform`\ ) :ref:`πŸ”—` -Removes an export platform registered by :ref:`add_export_platform`. +Removes an export platform registered by :ref:`add_export_platform()`. .. rst-class:: classref-item-separator @@ -1571,7 +1571,7 @@ Removes an export platform registered by :ref:`add_export_platform`\ ) :ref:`πŸ”—` -Removes an export plugin registered by :ref:`add_export_plugin`. +Removes an export plugin registered by :ref:`add_export_plugin()`. .. rst-class:: classref-item-separator @@ -1583,7 +1583,7 @@ Removes an export plugin registered by :ref:`add_export_plugin`\ ) :ref:`πŸ”—` -Removes an import plugin registered by :ref:`add_import_plugin`. +Removes an import plugin registered by :ref:`add_import_plugin()`. .. rst-class:: classref-item-separator @@ -1595,7 +1595,7 @@ Removes an import plugin registered by :ref:`add_import_plugin`\ ) :ref:`πŸ”—` -Removes an inspector plugin registered by :ref:`add_inspector_plugin`. +Removes an inspector plugin registered by :ref:`add_inspector_plugin()`. .. rst-class:: classref-item-separator @@ -1607,7 +1607,7 @@ Removes an inspector plugin registered by :ref:`add_inspector_plugin`\ ) :ref:`πŸ”—` -Removes a gizmo plugin registered by :ref:`add_node_3d_gizmo_plugin`. +Removes a gizmo plugin registered by :ref:`add_node_3d_gizmo_plugin()`. .. rst-class:: classref-item-separator @@ -1619,7 +1619,7 @@ Removes a gizmo plugin registered by :ref:`add_node_3d_gizmo_plugin`\ ) :ref:`πŸ”—` -Removes a resource conversion plugin registered by :ref:`add_resource_conversion_plugin`. +Removes a resource conversion plugin registered by :ref:`add_resource_conversion_plugin()`. .. rst-class:: classref-item-separator @@ -1631,7 +1631,7 @@ Removes a resource conversion plugin registered by :ref:`add_resource_conversion |void| **remove_scene_format_importer_plugin**\ (\ scene_format_importer\: :ref:`EditorSceneFormatImporter`\ ) :ref:`πŸ”—` -Removes a scene format importer registered by :ref:`add_scene_format_importer_plugin`. +Removes a scene format importer registered by :ref:`add_scene_format_importer_plugin()`. .. rst-class:: classref-item-separator @@ -1643,7 +1643,7 @@ Removes a scene format importer registered by :ref:`add_scene_format_importer_pl |void| **remove_scene_post_import_plugin**\ (\ scene_import_plugin\: :ref:`EditorScenePostImportPlugin`\ ) :ref:`πŸ”—` -Remove the :ref:`EditorScenePostImportPlugin`, added with :ref:`add_scene_post_import_plugin`. +Remove the :ref:`EditorScenePostImportPlugin`, added with :ref:`add_scene_post_import_plugin()`. .. rst-class:: classref-item-separator @@ -1667,7 +1667,7 @@ Removes a menu ``name`` from **Project > Tools**. |void| **remove_translation_parser_plugin**\ (\ parser\: :ref:`EditorTranslationParserPlugin`\ ) :ref:`πŸ”—` -Removes a custom translation parser plugin registered by :ref:`add_translation_parser_plugin`. +Removes a custom translation parser plugin registered by :ref:`add_translation_parser_plugin()`. .. rst-class:: classref-item-separator @@ -1679,7 +1679,7 @@ Removes a custom translation parser plugin registered by :ref:`add_translation_p |void| **remove_undo_redo_inspector_hook_callback**\ (\ callable\: :ref:`Callable`\ ) :ref:`πŸ”—` -Removes a callback previously added by :ref:`add_undo_redo_inspector_hook_callback`. +Removes a callback previously added by :ref:`add_undo_redo_inspector_hook_callback()`. .. rst-class:: classref-item-separator @@ -1703,7 +1703,7 @@ Sets the tab icon for the given control in a dock slot. Setting to ``null`` remo |void| **set_force_draw_over_forwarding_enabled**\ (\ ) :ref:`πŸ”—` -Enables calling of :ref:`_forward_canvas_force_draw_over_viewport` for the 2D editor and :ref:`_forward_3d_force_draw_over_viewport` for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. +Enables calling of :ref:`_forward_canvas_force_draw_over_viewport()` for the 2D editor and :ref:`_forward_3d_force_draw_over_viewport()` for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. .. rst-class:: classref-item-separator @@ -1715,7 +1715,7 @@ Enables calling of :ref:`_forward_canvas_force_draw_over_viewport` -Use this method if you always want to receive inputs from 3D view screen inside :ref:`_forward_3d_gui_input`. It might be especially usable if your plugin will want to use raycast in the scene. +Use this method if you always want to receive inputs from 3D view screen inside :ref:`_forward_3d_gui_input()`. It might be especially usable if your plugin will want to use raycast in the scene. .. rst-class:: classref-item-separator @@ -1727,7 +1727,7 @@ Use this method if you always want to receive inputs from 3D view screen inside :ref:`int` **update_overlays**\ (\ ) |const| :ref:`πŸ”—` -Updates the overlays of the 2D and 3D editor viewport. Causes methods :ref:`_forward_canvas_draw_over_viewport`, :ref:`_forward_canvas_force_draw_over_viewport`, :ref:`_forward_3d_draw_over_viewport` and :ref:`_forward_3d_force_draw_over_viewport` to be called. +Updates the overlays of the 2D and 3D editor viewport. Causes methods :ref:`_forward_canvas_draw_over_viewport()`, :ref:`_forward_canvas_force_draw_over_viewport()`, :ref:`_forward_3d_draw_over_viewport()` and :ref:`_forward_3d_force_draw_over_viewport()` to be called. .. |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_editorproperty.rst b/classes/class_editorproperty.rst index ace6bcf63c7..1613490d044 100644 --- a/classes/class_editorproperty.rst +++ b/classes/class_editorproperty.rst @@ -36,6 +36,10 @@ Properties +-----------------------------+-------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`deletable` | ``false`` | +-----------------------------+-------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`draw_background` | ``true`` | + +-----------------------------+-------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`draw_label` | ``true`` | + +-----------------------------+-------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`draw_warning` | ``false`` | +-----------------------------+-------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`keying` | ``false`` | @@ -102,7 +106,7 @@ Signals **multiple_properties_changed**\ (\ properties\: :ref:`PackedStringArray`, value\: :ref:`Array`\ ) :ref:`πŸ”—` -Emit it if you want multiple properties modified at the same time. Do not use if added via :ref:`EditorInspectorPlugin._parse_property`. +Emit it if you want multiple properties modified at the same time. Do not use if added via :ref:`EditorInspectorPlugin._parse_property()`. .. rst-class:: classref-item-separator @@ -138,7 +142,7 @@ Emitted when the revertability (i.e., whether it has a non-default value and thu **property_changed**\ (\ property\: :ref:`StringName`, value\: :ref:`Variant`, field\: :ref:`StringName`, changing\: :ref:`bool`\ ) :ref:`πŸ”—` -Do not emit this manually, use the :ref:`emit_changed` method instead. +Do not emit this manually, use the :ref:`emit_changed()` method instead. .. rst-class:: classref-item-separator @@ -298,6 +302,40 @@ Used by the inspector, set to ``true`` when the property can be deleted by the u ---- +.. _class_EditorProperty_property_draw_background: + +.. rst-class:: classref-property + +:ref:`bool` **draw_background** = ``true`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_draw_background**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_draw_background**\ (\ ) + +Used by the inspector, set to ``true`` when the property label is drawn. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorProperty_property_draw_label: + +.. rst-class:: classref-property + +:ref:`bool` **draw_label** = ``true`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_draw_label**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_draw_label**\ (\ ) + +Used by the inspector, set to ``true`` when the property background is drawn. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorProperty_property_draw_warning: .. rst-class:: classref-property @@ -500,7 +538,7 @@ Gets the edited object. :ref:`StringName` **get_edited_property**\ (\ ) |const| :ref:`πŸ”—` -Gets the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin._parse_property`), then this will return the property. +Gets the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin._parse_property()`), then this will return the property. .. rst-class:: classref-item-separator @@ -536,7 +574,7 @@ Draw property as selected. Used by the inspector. |void| **set_bottom_editor**\ (\ editor\: :ref:`Control`\ ) :ref:`πŸ”—` -Puts the ``editor`` control below the property label. The control must be previously added using :ref:`Node.add_child`. +Puts the ``editor`` control below the property label. The control must be previously added using :ref:`Node.add_child()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editorresourceconversionplugin.rst b/classes/class_editorresourceconversionplugin.rst index 176250642ce..4684dcf74d9 100644 --- a/classes/class_editorresourceconversionplugin.rst +++ b/classes/class_editorresourceconversionplugin.rst @@ -43,7 +43,7 @@ Below shows an example of a basic plugin that will convert an :ref:`ImageTexture -To use an **EditorResourceConversionPlugin**, register it using the :ref:`EditorPlugin.add_resource_conversion_plugin` method first. +To use an **EditorResourceConversionPlugin**, register it using the :ref:`EditorPlugin.add_resource_conversion_plugin()` method first. .. rst-class:: classref-reftable-group @@ -76,7 +76,7 @@ Method Descriptions :ref:`Resource` **_convert**\ (\ resource\: :ref:`Resource`\ ) |virtual| |const| :ref:`πŸ”—` -Takes an input :ref:`Resource` and converts it to the type given in :ref:`_converts_to`. The returned :ref:`Resource` is the result of the conversion, and the input :ref:`Resource` remains unchanged. +Takes an input :ref:`Resource` and converts it to the type given in :ref:`_converts_to()`. The returned :ref:`Resource` is the result of the conversion, and the input :ref:`Resource` remains unchanged. .. rst-class:: classref-item-separator diff --git a/classes/class_editorresourcepicker.rst b/classes/class_editorresourcepicker.rst index 18f9ee301ec..eaa3f431f79 100644 --- a/classes/class_editorresourcepicker.rst +++ b/classes/class_editorresourcepicker.rst @@ -161,7 +161,7 @@ The edited resource value. - |void| **set_toggle_mode**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_toggle_mode**\ (\ ) -If ``true``, the main button with the resource preview works in the toggle mode. Use :ref:`set_toggle_pressed` to manually set the state. +If ``true``, the main button with the resource preview works in the toggle mode. Use :ref:`set_toggle_pressed()` to manually set the state. .. rst-class:: classref-section-separator @@ -178,7 +178,7 @@ Method Descriptions :ref:`bool` **_handle_menu_selected**\ (\ id\: :ref:`int`\ ) |virtual| :ref:`πŸ”—` -This virtual method can be implemented to handle context menu items not handled by default. See :ref:`_set_create_options`. +This virtual method can be implemented to handle context menu items not handled by default. See :ref:`_set_create_options()`. .. rst-class:: classref-item-separator @@ -192,7 +192,7 @@ This virtual method can be implemented to handle context menu items not handled This virtual method is called when updating the context menu of **EditorResourcePicker**. Implement this method to override the "New ..." items with your own options. ``menu_node`` is a reference to the :ref:`PopupMenu` node. -\ **Note:** Implement :ref:`_handle_menu_selected` to handle these custom items. +\ **Note:** Implement :ref:`_handle_menu_selected()` to handle these custom items. .. rst-class:: classref-item-separator diff --git a/classes/class_editorresourcepreview.rst b/classes/class_editorresourcepreview.rst index ca36a28aa36..59bde0e1dea 100644 --- a/classes/class_editorresourcepreview.rst +++ b/classes/class_editorresourcepreview.rst @@ -21,7 +21,7 @@ Description This node is used to generate previews for resources or files. -\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_previewer`. +\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_previewer()`. .. rst-class:: classref-reftable-group diff --git a/classes/class_editorresourcepreviewgenerator.rst b/classes/class_editorresourcepreviewgenerator.rst index 55323806086..91c385fb1f4 100644 --- a/classes/class_editorresourcepreviewgenerator.rst +++ b/classes/class_editorresourcepreviewgenerator.rst @@ -56,7 +56,7 @@ Method Descriptions :ref:`bool` **_can_generate_small_preview**\ (\ ) |virtual| |const| :ref:`πŸ”—` -If this function returns ``true``, the generator will call :ref:`_generate` or :ref:`_generate_from_path` for small previews as well. +If this function returns ``true``, the generator will call :ref:`_generate()` or :ref:`_generate_from_path()` for small previews as well. By default, it returns ``false``. @@ -76,7 +76,7 @@ Returning ``null`` is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). -\ ``metadata`` dictionary can be modified to store file-specific metadata that can be used in :ref:`EditorResourceTooltipPlugin._make_tooltip_for_path` (like image size, sample length etc.). +\ ``metadata`` dictionary can be modified to store file-specific metadata that can be used in :ref:`EditorResourceTooltipPlugin._make_tooltip_for_path()` (like image size, sample length etc.). .. rst-class:: classref-item-separator @@ -88,13 +88,13 @@ Care must be taken because this function is always called from a thread (not the :ref:`Texture2D` **_generate_from_path**\ (\ path\: :ref:`String`, size\: :ref:`Vector2i`, metadata\: :ref:`Dictionary`\ ) |virtual| |const| :ref:`πŸ”—` -Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call :ref:`_generate`. +Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call :ref:`_generate()`. Returning ``null`` is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). -\ ``metadata`` dictionary can be modified to store file-specific metadata that can be used in :ref:`EditorResourceTooltipPlugin._make_tooltip_for_path` (like image size, sample length etc.). +\ ``metadata`` dictionary can be modified to store file-specific metadata that can be used in :ref:`EditorResourceTooltipPlugin._make_tooltip_for_path()` (like image size, sample length etc.). .. rst-class:: classref-item-separator @@ -106,7 +106,7 @@ Care must be taken because this function is always called from a thread (not the :ref:`bool` **_generate_small_preview_automatically**\ (\ ) |virtual| |const| :ref:`πŸ”—` -If this function returns ``true``, the generator will automatically generate the small previews from the normal preview texture generated by the methods :ref:`_generate` or :ref:`_generate_from_path`. +If this function returns ``true``, the generator will automatically generate the small previews from the normal preview texture generated by the methods :ref:`_generate()` or :ref:`_generate_from_path()`. By default, it returns ``false``. diff --git a/classes/class_editorresourcetooltipplugin.rst b/classes/class_editorresourcetooltipplugin.rst index f8899f5f2b5..72c10196393 100644 --- a/classes/class_editorresourcetooltipplugin.rst +++ b/classes/class_editorresourcetooltipplugin.rst @@ -21,7 +21,7 @@ Description Resource tooltip plugins are used by :ref:`FileSystemDock` to generate customized tooltips for specific resources. E.g. tooltip for a :ref:`Texture2D` displays a bigger preview and the texture's dimensions. -A plugin must be first registered with :ref:`FileSystemDock.add_resource_tooltip_plugin`. When the user hovers a resource in filesystem dock which is handled by the plugin, :ref:`_make_tooltip_for_path` is called to create the tooltip. It works similarly to :ref:`Control._make_custom_tooltip`. +A plugin must be first registered with :ref:`FileSystemDock.add_resource_tooltip_plugin()`. When the user hovers a resource in filesystem dock which is handled by the plugin, :ref:`_make_tooltip_for_path()` is called to create the tooltip. It works similarly to :ref:`Control._make_custom_tooltip()`. .. rst-class:: classref-reftable-group @@ -68,13 +68,13 @@ Return ``true`` if the plugin is going to handle the given :ref:`Resource`). +The ``metadata`` dictionary is provided by preview generator (see :ref:`EditorResourcePreviewGenerator._generate()`). \ ``base`` is the base default tooltip, which is a :ref:`VBoxContainer` with a file name, type and size labels. If another plugin handled the same file type, ``base`` will be output from the previous plugin. For best result, make sure the base tooltip is part of the returned :ref:`Control`. -\ **Note:** It's unadvised to use :ref:`ResourceLoader.load`, especially with heavy resources like models or textures, because it will make the editor unresponsive when creating the tooltip. You can use :ref:`request_thumbnail` if you want to display a preview in your tooltip. +\ **Note:** It's unadvised to use :ref:`ResourceLoader.load()`, especially with heavy resources like models or textures, because it will make the editor unresponsive when creating the tooltip. You can use :ref:`request_thumbnail()` if you want to display a preview in your tooltip. -\ **Note:** If you decide to discard the ``base``, make sure to call :ref:`Node.queue_free`, because it's not freed automatically. +\ **Note:** If you decide to discard the ``base``, make sure to call :ref:`Node.queue_free()`, because it's not freed automatically. :: diff --git a/classes/class_editorsceneformatimporter.rst b/classes/class_editorsceneformatimporter.rst index 155cc953e82..e610ebc751e 100644 --- a/classes/class_editorsceneformatimporter.rst +++ b/classes/class_editorsceneformatimporter.rst @@ -23,7 +23,7 @@ Description **EditorSceneFormatImporter** allows to define an importer script for a third-party 3D format. -To use **EditorSceneFormatImporter**, register it using the :ref:`EditorPlugin.add_scene_format_importer_plugin` method first. +To use **EditorSceneFormatImporter**, register it using the :ref:`EditorPlugin.add_scene_format_importer_plugin()` method first. .. rst-class:: classref-reftable-group @@ -33,17 +33,19 @@ Methods .. table:: :widths: auto - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`_get_extensions`\ (\ ) |virtual| |const| | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_get_import_flags`\ (\ ) |virtual| |const| | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`_get_import_options`\ (\ path\: :ref:`String`\ ) |virtual| | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`_get_option_visibility`\ (\ path\: :ref:`String`, for_animation\: :ref:`bool`, option\: :ref:`String`\ ) |virtual| |const| | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Object` | :ref:`_import_scene`\ (\ path\: :ref:`String`, flags\: :ref:`int`, options\: :ref:`Dictionary`\ ) |virtual| | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`_get_extensions`\ (\ ) |virtual| |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`_get_import_options`\ (\ path\: :ref:`String`\ ) |virtual| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_get_option_visibility`\ (\ path\: :ref:`String`, for_animation\: :ref:`bool`, option\: :ref:`String`\ ) |virtual| |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Object` | :ref:`_import_scene`\ (\ path\: :ref:`String`, flags\: :ref:`int`, options\: :ref:`Dictionary`\ ) |virtual| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_import_option`\ (\ name\: :ref:`String`, value\: :ref:`Variant`\ ) | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_import_option_advanced`\ (\ type\: :ref:`Variant.Type`, name\: :ref:`String`, default_value\: :ref:`Variant`, hint\: :ref:`PropertyHint` = 0, hint_string\: :ref:`String` = "", usage_flags\: :ref:`int` = 6\ ) | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -153,65 +155,71 @@ Method Descriptions :ref:`PackedStringArray` **_get_extensions**\ (\ ) |virtual| |const| :ref:`πŸ”—` -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Return supported file extensions for this scene importer. .. rst-class:: classref-item-separator ---- -.. _class_EditorSceneFormatImporter_private_method__get_import_flags: +.. _class_EditorSceneFormatImporter_private_method__get_import_options: .. rst-class:: classref-method -:ref:`int` **_get_import_flags**\ (\ ) |virtual| |const| :ref:`πŸ”—` +|void| **_get_import_options**\ (\ path\: :ref:`String`\ ) |virtual| :ref:`πŸ”—` + +Override to add general import options. These will appear in the main import dock on the editor. Add options via :ref:`add_import_option()` and :ref:`add_import_option_advanced()`. -.. container:: contribute +\ **Note:** All **EditorSceneFormatImporter** and :ref:`EditorScenePostImportPlugin` instances will add options for all files. It is good practice to check the file extension when ``path`` is non-empty. - There is currently no description for this method. Please help us by :ref:`contributing one `! +When the user is editing project settings, ``path`` will be empty. It is recommended to add all options when ``path`` is empty to allow the user to customize Import Defaults. .. rst-class:: classref-item-separator ---- -.. _class_EditorSceneFormatImporter_private_method__get_import_options: +.. _class_EditorSceneFormatImporter_private_method__get_option_visibility: .. rst-class:: classref-method -|void| **_get_import_options**\ (\ path\: :ref:`String`\ ) |virtual| :ref:`πŸ”—` - -.. container:: contribute +:ref:`Variant` **_get_option_visibility**\ (\ path\: :ref:`String`, for_animation\: :ref:`bool`, option\: :ref:`String`\ ) |virtual| |const| :ref:`πŸ”—` - There is currently no description for this method. Please help us by :ref:`contributing one `! +Should return ``true`` to show the given option, ``false`` to hide the given option, or ``null`` to ignore. .. rst-class:: classref-item-separator ---- -.. _class_EditorSceneFormatImporter_private_method__get_option_visibility: +.. _class_EditorSceneFormatImporter_private_method__import_scene: .. rst-class:: classref-method -:ref:`Variant` **_get_option_visibility**\ (\ path\: :ref:`String`, for_animation\: :ref:`bool`, option\: :ref:`String`\ ) |virtual| |const| :ref:`πŸ”—` - -.. container:: contribute +:ref:`Object` **_import_scene**\ (\ path\: :ref:`String`, flags\: :ref:`int`, options\: :ref:`Dictionary`\ ) |virtual| :ref:`πŸ”—` - There is currently no description for this method. Please help us by :ref:`contributing one `! +Perform the bulk of the scene import logic here, for example using :ref:`GLTFDocument` or :ref:`FBXDocument`. .. rst-class:: classref-item-separator ---- -.. _class_EditorSceneFormatImporter_private_method__import_scene: +.. _class_EditorSceneFormatImporter_method_add_import_option: .. rst-class:: classref-method -:ref:`Object` **_import_scene**\ (\ path\: :ref:`String`, flags\: :ref:`int`, options\: :ref:`Dictionary`\ ) |virtual| :ref:`πŸ”—` +|void| **add_import_option**\ (\ name\: :ref:`String`, value\: :ref:`Variant`\ ) :ref:`πŸ”—` -.. container:: contribute +Add a specific import option (name and default value only). This function can only be called from :ref:`_get_import_options()`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorSceneFormatImporter_method_add_import_option_advanced: + +.. rst-class:: classref-method + +|void| **add_import_option_advanced**\ (\ type\: :ref:`Variant.Type`, name\: :ref:`String`, default_value\: :ref:`Variant`, hint\: :ref:`PropertyHint` = 0, hint_string\: :ref:`String` = "", usage_flags\: :ref:`int` = 6\ ) :ref:`πŸ”—` - There is currently no description for this method. Please help us by :ref:`contributing one `! +Add a specific import option. This function can only be called from :ref:`_get_import_options()`. .. |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_editorscenepostimport.rst b/classes/class_editorscenepostimport.rst index 9488231d60c..b651bedc06d 100644 --- a/classes/class_editorscenepostimport.rst +++ b/classes/class_editorscenepostimport.rst @@ -21,7 +21,7 @@ Description Imported scenes can be automatically modified right after import by setting their **Custom Script** Import property to a ``tool`` script that inherits from this class. -The :ref:`_post_import` callback receives the imported scene's root node and returns the modified version of the scene: +The :ref:`_post_import()` callback receives the imported scene's root node and returns the modified version of the scene: .. tabs:: diff --git a/classes/class_editorscenepostimportplugin.rst b/classes/class_editorscenepostimportplugin.rst index cd8b733f50b..991cdde3394 100644 --- a/classes/class_editorscenepostimportplugin.rst +++ b/classes/class_editorscenepostimportplugin.rst @@ -179,7 +179,7 @@ Method Descriptions |void| **_get_import_options**\ (\ path\: :ref:`String`\ ) |virtual| :ref:`πŸ”—` -Override to add general import options. These will appear in the main import dock on the editor. Add options via :ref:`add_import_option` and :ref:`add_import_option_advanced`. +Override to add general import options. These will appear in the main import dock on the editor. Add options via :ref:`add_import_option()` and :ref:`add_import_option_advanced()`. .. rst-class:: classref-item-separator @@ -191,7 +191,7 @@ Override to add general import options. These will appear in the main import doc |void| **_get_internal_import_options**\ (\ category\: :ref:`int`\ ) |virtual| :ref:`πŸ”—` -Override to add internal import options. These will appear in the 3D scene import dialog. Add options via :ref:`add_import_option` and :ref:`add_import_option_advanced`. +Override to add internal import options. These will appear in the 3D scene import dialog. Add options via :ref:`add_import_option()` and :ref:`add_import_option_advanced()`. .. rst-class:: classref-item-separator @@ -265,6 +265,8 @@ Post process the scene. This function is called after the final scene has been c Pre Process the scene. This function is called right after the scene format loader loaded the scene and no changes have been made. +Pre process may be used to adjust internal import options in the ``"nodes"``, ``"meshes"``, ``"animations"`` or ``"materials"`` keys inside ``get_option_value("_subresources")``. + .. rst-class:: classref-item-separator ---- @@ -275,7 +277,7 @@ Pre Process the scene. This function is called right after the scene format load |void| **add_import_option**\ (\ name\: :ref:`String`, value\: :ref:`Variant`\ ) :ref:`πŸ”—` -Add a specific import option (name and default value only). This function can only be called from :ref:`_get_import_options` and :ref:`_get_internal_import_options`. +Add a specific import option (name and default value only). This function can only be called from :ref:`_get_import_options()` and :ref:`_get_internal_import_options()`. .. rst-class:: classref-item-separator @@ -287,7 +289,7 @@ Add a specific import option (name and default value only). This function can on |void| **add_import_option_advanced**\ (\ type\: :ref:`Variant.Type`, name\: :ref:`String`, default_value\: :ref:`Variant`, hint\: :ref:`PropertyHint` = 0, hint_string\: :ref:`String` = "", usage_flags\: :ref:`int` = 6\ ) :ref:`πŸ”—` -Add a specific import option. This function can only be called from :ref:`_get_import_options` and :ref:`_get_internal_import_options`. +Add a specific import option. This function can only be called from :ref:`_get_import_options()` and :ref:`_get_internal_import_options()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editorscript.rst b/classes/class_editorscript.rst index 5f8b9e7b068..a01339d2457 100644 --- a/classes/class_editorscript.rst +++ b/classes/class_editorscript.rst @@ -19,7 +19,7 @@ Base script that can be used to add extension functions to the editor. Description ----------- -Scripts extending this class and implementing its :ref:`_run` method can be executed from the Script Editor's **File > Run** menu option (or by pressing :kbd:`Ctrl + Shift + X`) while the editor is running. This is useful for adding custom in-editor functionality to Redot. For more complex additions, consider using :ref:`EditorPlugin`\ s instead. +Scripts extending this class and implementing its :ref:`_run()` method can be executed from the Script Editor's **File > Run** menu option (or by pressing :kbd:`Ctrl + Shift + X`) while the editor is running. This is useful for adding custom in-editor functionality to Redot. For more complex additions, consider using :ref:`EditorPlugin`\ s instead. \ **Note:** Extending scripts need to have ``tool`` mode enabled. @@ -126,7 +126,7 @@ Returns the :ref:`EditorInterface` singleton instance. :ref:`Node` **get_scene**\ (\ ) |const| :ref:`πŸ”—` -Returns the edited (current) scene's root :ref:`Node`. Equivalent of :ref:`EditorInterface.get_edited_scene_root`. +Returns the edited (current) scene's root :ref:`Node`. Equivalent of :ref:`EditorInterface.get_edited_scene_root()`. .. |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_editorselection.rst b/classes/class_editorselection.rst index 18187de1a20..7860cbf1f9c 100644 --- a/classes/class_editorselection.rst +++ b/classes/class_editorselection.rst @@ -21,7 +21,7 @@ Description This object manages the SceneTree selection in the editor. -\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_selection`. +\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_selection()`. .. rst-class:: classref-reftable-group @@ -77,7 +77,7 @@ Method Descriptions Adds a node to the selection. -\ **Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use :ref:`EditorInterface.edit_node`. +\ **Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use :ref:`EditorInterface.edit_node()`. .. rst-class:: classref-item-separator diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index e64289296f5..285a2565af5 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -48,7 +48,7 @@ Accessing the settings can be done using the following methods, such as: -\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_editor_settings`. +\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_editor_settings()`. .. rst-class:: classref-reftable-group @@ -97,6 +97,8 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`docks/scene_tree/center_node_on_reparent` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`docks/scene_tree/hide_filtered_out_parents` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`docks/scene_tree/start_create_dialog_fully_expanded` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/2d/bone_color1` | @@ -213,6 +215,8 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/fog_volume` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/gridmap_grid` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/instantiated` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/joint` | @@ -241,6 +245,12 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/skeleton` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/spring_bone_collision` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/spring_bone_inside_collision` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/spring_bone_joint` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/stream_player_3d` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/3d_gizmos/gizmo_colors/visibility_notifier` | @@ -273,8 +283,6 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/bone_mapper/handle_colors/unset` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`editors/grid_map/editor_side` | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`editors/grid_map/palette_min_width` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`editors/grid_map/pick_distance` | @@ -595,6 +603,8 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`network/tls/editor_tls_certificates` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`network/tls/enable_tls_v1.3` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`project_manager/default_renderer` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`project_manager/directory_naming_convention` | @@ -617,7 +627,7 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`run/window_placement/android_window` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`run/window_placement/play_window_pip_mode` | + | :ref:`int` | :ref:`run/window_placement/game_embed_mode` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`run/window_placement/rect` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -665,6 +675,8 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`text_editor/appearance/whitespace/line_spacing` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`text_editor/behavior/documentation/enable_tooltips` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`text_editor/behavior/files/auto_reload_and_parse_scripts_on_save` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`text_editor/behavior/files/auto_reload_scripts_on_external_change` | @@ -1175,6 +1187,18 @@ If ``true``, new node created when reparenting node(s) will be positioned at the ---- +.. _class_EditorSettings_property_docks/scene_tree/hide_filtered_out_parents: + +.. rst-class:: classref-property + +:ref:`bool` **docks/scene_tree/hide_filtered_out_parents** :ref:`πŸ”—` + +If ``true``, the scene tree dock will only show nodes that match the filter, without showing parents that don't. This settings can also be changed in the Scene dock's top menu. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_docks/scene_tree/start_create_dialog_fully_expanded: .. rst-class:: classref-property @@ -1905,6 +1929,18 @@ The 3D editor gizmo color for :ref:`FogVolume` nodes. ---- +.. _class_EditorSettings_property_editors/3d_gizmos/gizmo_colors/gridmap_grid: + +.. rst-class:: classref-property + +:ref:`Color` **editors/3d_gizmos/gizmo_colors/gridmap_grid** :ref:`πŸ”—` + +The 3D editor gizmo color for the :ref:`GridMap` grid. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_editors/3d_gizmos/gizmo_colors/instantiated: .. rst-class:: classref-property @@ -2073,6 +2109,42 @@ The 3D editor gizmo color used for :ref:`Skeleton3D` nodes. ---- +.. _class_EditorSettings_property_editors/3d_gizmos/gizmo_colors/spring_bone_collision: + +.. rst-class:: classref-property + +:ref:`Color` **editors/3d_gizmos/gizmo_colors/spring_bone_collision** :ref:`πŸ”—` + +The 3D editor gizmo color used for :ref:`SpringBoneCollision3D` nodes. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorSettings_property_editors/3d_gizmos/gizmo_colors/spring_bone_inside_collision: + +.. rst-class:: classref-property + +:ref:`Color` **editors/3d_gizmos/gizmo_colors/spring_bone_inside_collision** :ref:`πŸ”—` + +The 3D editor gizmo color used for :ref:`SpringBoneCollision3D` nodes with inside mode. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorSettings_property_editors/3d_gizmos/gizmo_colors/spring_bone_joint: + +.. rst-class:: classref-property + +:ref:`Color` **editors/3d_gizmos/gizmo_colors/spring_bone_joint** :ref:`πŸ”—` + +The 3D editor gizmo color used for :ref:`SpringBoneSimulator3D` nodes. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_editors/3d_gizmos/gizmo_colors/stream_player_3d: .. rst-class:: classref-property @@ -2275,18 +2347,6 @@ The modulate color to use for "past" frames displayed in the animation editor's ---- -.. _class_EditorSettings_property_editors/grid_map/editor_side: - -.. rst-class:: classref-property - -:ref:`int` **editors/grid_map/editor_side** :ref:`πŸ”—` - -Specifies the side of 3D editor's viewport where GridMap's mesh palette will appear. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorSettings_property_editors/grid_map/palette_min_width: .. rst-class:: classref-property @@ -2969,10 +3029,37 @@ Port used for file server when exporting project with remote file system. :ref:`String` **filesystem/import/blender/blender_path** :ref:`πŸ”—` -The path to the directory containing the Blender executable used for converting the Blender 3D scene files ``.blend`` to glTF 2.0 format during import. Blender 3.0 or later is required. +The path to the Blender executable used for converting the Blender 3D scene files ``.blend`` to glTF 2.0 format during import. Blender 3.0 or later is required. To enable this feature for your specific project, use :ref:`ProjectSettings.filesystem/import/blender/enabled`. +If this setting is empty, Blender's default paths will be detected and used automatically if present in this order: + +\ **Windows:**\ + +:: + + - C:\Program Files\Blender Foundation\blender.exe + - C:\Program Files (x86)\Blender Foundation\blender.exe + +\ **macOS:**\ + +:: + + - /opt/homebrew/bin/blender + - /opt/local/bin/blender + - /usr/local/bin/blender + - /usr/local/opt/blender + - /Applications/Blender.app/Contents/MacOS/Blender + +\ **Linux/\*BSD:**\ + +:: + + - /usr/bin/blender + - /usr/local/bin/blender + - /opt/blender/bin/blender + .. rst-class:: classref-item-separator ---- @@ -3601,7 +3688,9 @@ If ``true``, embed modal windows such as docks inside the main editor window. Wh This is equivalent to :ref:`ProjectSettings.display/window/subwindows/embed_subwindows` in the running project, except the setting's value is inverted. -\ **Note:** To query whether the editor can use multiple windows in an editor plugin, use :ref:`EditorInterface.is_multi_window_enabled` instead of querying the value of this editor setting. +\ **Note:** To query whether the editor can use multiple windows in an editor plugin, use :ref:`EditorInterface.is_multi_window_enabled()` instead of querying the value of this editor setting. + +\ **Note:** If ``true``, game embedding is disabled. .. rst-class:: classref-item-separator @@ -3917,11 +4006,11 @@ If ``true``, display OpenType features marked as ``hidden`` by the font file in :ref:`bool` **interface/multi_window/enable** :ref:`πŸ”—` -If ``true``, multiple window support in editor is enabled. The following panels can become dedicated windows (i.e. made floating): Docks, Script editor, and Shader editor. +If ``true``, multiple window support in editor is enabled. The following panels can become dedicated windows (i.e. made floating): Docks, Script editor, Shader editor, and Game Workspace. \ **Note:** When :ref:`interface/editor/single_window_mode` is ``true``, the multi window support is always disabled. -\ **Note:** To query whether the editor can use multiple windows in an editor plugin, use :ref:`EditorInterface.is_multi_window_enabled` instead of querying the value of this editor setting. +\ **Note:** To query whether the editor can use multiple windows in an editor plugin, use :ref:`EditorInterface.is_multi_window_enabled()` instead of querying the value of this editor setting. .. rst-class:: classref-item-separator @@ -4373,6 +4462,20 @@ The TLS certificate bundle to use for HTTP requests made within the editor (e.g. ---- +.. _class_EditorSettings_property_network/tls/enable_tls_v1.3: + +.. rst-class:: classref-property + +:ref:`bool` **network/tls/enable_tls_v1.3** :ref:`πŸ”—` + +If ``true``, enable TLSv1.3 negotiation. + +\ **Note:** Only supported when using Mbed TLS 3.0 or later (Linux distribution packages may be compiled against older system Mbed TLS packages), otherwise the maximum supported TLS version is always TLSv1.2. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_project_manager/default_renderer: .. rst-class:: classref-property @@ -4511,29 +4614,19 @@ Specifies how the Play window is launched relative to the Android editor. - **Side-by-side with Editor** will launch the Play window side-by-side with the Editor window. -- **Launch in PiP mode** will launch the Play window directly in picture-in-picture (PiP) mode if PiP mode is supported and enabled. When maximized, the Play window will occupy the same window as the Editor. - \ **Note:** Only available in the Android editor. .. rst-class:: classref-item-separator ---- -.. _class_EditorSettings_property_run/window_placement/play_window_pip_mode: +.. _class_EditorSettings_property_run/window_placement/game_embed_mode: .. rst-class:: classref-property -:ref:`int` **run/window_placement/play_window_pip_mode** :ref:`πŸ”—` - -Specifies the picture-in-picture (PiP) mode for the Play window. - -- **Disabled:** PiP is disabled for the Play window. - -- **Enabled:** If the device supports it, PiP is always enabled for the Play window. The Play window will contain a button to enter PiP mode. +:ref:`int` **run/window_placement/game_embed_mode** :ref:`πŸ”—` -- **Enabled when Play window is same as Editor** (default for Android editor): If the device supports it, PiP is enabled when the Play window is the same as the Editor. The Play window will contain a button to enter PiP mode. - -\ **Note:** Only available in the Android editor. +Overrides game embedding setting for all newly opened projects. If enabled, game embedding settings are not saved. .. rst-class:: classref-item-separator @@ -4547,6 +4640,8 @@ Specifies the picture-in-picture (PiP) mode for the Play window. The window mode to use to display the project when starting the project from the editor. +\ **Note:** Game embedding is not available for "Force Maximized" or "Force Fullscreen." + .. rst-class:: classref-item-separator ---- @@ -4815,6 +4910,18 @@ The space to add between lines (in pixels). Greater line spacing can help improv ---- +.. _class_EditorSettings_property_text_editor/behavior/documentation/enable_tooltips: + +.. rst-class:: classref-property + +:ref:`bool` **text_editor/behavior/documentation/enable_tooltips** :ref:`πŸ”—` + +If ``true``, documentation tooltips will appear when hovering over a symbol. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_text_editor/behavior/files/auto_reload_and_parse_scripts_on_save: .. rst-class:: classref-property @@ -6040,7 +6147,7 @@ Adds a custom property info to a property. The dictionary must contain: :ref:`bool` **check_changed_settings_in_group**\ (\ setting_prefix\: :ref:`String`\ ) |const| :ref:`πŸ”—` -Checks if any settings with the prefix ``setting_prefix`` exist in the set of changed settings. See also :ref:`get_changed_settings`. +Checks if any settings with the prefix ``setting_prefix`` exist in the set of changed settings. See also :ref:`get_changed_settings()`. .. rst-class:: classref-item-separator @@ -6088,7 +6195,7 @@ Returns the list of favorite files and directories for this project. :ref:`Variant` **get_project_metadata**\ (\ section\: :ref:`String`, key\: :ref:`String`, default\: :ref:`Variant` = null\ ) |const| :ref:`πŸ”—` -Returns project-specific metadata for the ``section`` and ``key`` specified. If the metadata doesn't exist, ``default`` will be returned instead. See also :ref:`set_project_metadata`. +Returns project-specific metadata for the ``section`` and ``key`` specified. If the metadata doesn't exist, ``default`` will be returned instead. See also :ref:`set_project_metadata()`. .. rst-class:: classref-item-separator @@ -6112,7 +6219,7 @@ Returns the list of recently visited folders in the file dialog for this project :ref:`Variant` **get_setting**\ (\ name\: :ref:`String`\ ) |const| :ref:`πŸ”—` -Returns the value of the setting specified by ``name``. This is equivalent to using :ref:`Object.get` on the EditorSettings instance. +Returns the value of the setting specified by ``name``. This is equivalent to using :ref:`Object.get()` on the EditorSettings instance. .. rst-class:: classref-item-separator @@ -6136,7 +6243,7 @@ Returns ``true`` if the setting specified by ``name`` exists, ``false`` otherwis |void| **mark_setting_changed**\ (\ setting\: :ref:`String`\ ) :ref:`πŸ”—` -Marks the passed editor setting as being changed, see :ref:`get_changed_settings`. Only settings which exist (see :ref:`has_setting`) will be accepted. +Marks the passed editor setting as being changed, see :ref:`get_changed_settings()`. Only settings which exist (see :ref:`has_setting()`) will be accepted. .. rst-class:: classref-item-separator @@ -6184,7 +6291,7 @@ Sets the initial value of the setting specified by ``name`` to ``value``. This i |void| **set_project_metadata**\ (\ section\: :ref:`String`, key\: :ref:`String`, data\: :ref:`Variant`\ ) :ref:`πŸ”—` -Sets project-specific metadata with the ``section``, ``key`` and ``data`` specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also :ref:`get_project_metadata`. +Sets project-specific metadata with the ``section``, ``key`` and ``data`` specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also :ref:`get_project_metadata()`. .. rst-class:: classref-item-separator @@ -6208,7 +6315,7 @@ Sets the list of recently visited folders in the file dialog for this project. |void| **set_setting**\ (\ name\: :ref:`String`, value\: :ref:`Variant`\ ) :ref:`πŸ”—` -Sets the ``value`` of the setting specified by ``name``. This is equivalent to using :ref:`Object.set` on the EditorSettings instance. +Sets the ``value`` of the setting specified by ``name``. This is equivalent to using :ref:`Object.set()` on the EditorSettings instance. .. |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_editorspinslider.rst b/classes/class_editorspinslider.rst index 90da8882eac..28164041c37 100644 --- a/classes/class_editorspinslider.rst +++ b/classes/class_editorspinslider.rst @@ -31,23 +31,25 @@ Properties .. table:: :widths: auto - +--------------------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ - | :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`` | - +--------------------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ - | |bitfield|\[:ref:`SizeFlags`\] | size_flags_vertical | ``1`` (overrides :ref:`Control`) | - +--------------------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ - | :ref:`float` | step | ``1.0`` (overrides :ref:`Range`) | - +--------------------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`suffix` | ``""`` | - +--------------------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ + +--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`editing_integer` | ``false`` | + +--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :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`` | + +--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | |bitfield|\[:ref:`SizeFlags`\] | size_flags_vertical | ``1`` (overrides :ref:`Control`) | + +--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`float` | step | ``1.0`` (overrides :ref:`Range`) | + +--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`suffix` | ``""`` | + +--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -137,6 +139,23 @@ Emitted when the value form loses focus. Property Descriptions --------------------- +.. _class_EditorSpinSlider_property_editing_integer: + +.. rst-class:: classref-property + +:ref:`bool` **editing_integer** = ``false`` :ref:`πŸ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_editing_integer**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_editing_integer**\ (\ ) + +If ``true``, the **EditorSpinSlider** is considered to be editing an integer value. If ``false``, the **EditorSpinSlider** is considered to be editing a floating-point value. This is used to determine whether a slider should be drawn. The slider is only drawn for floats; integers use up-down arrows similar to :ref:`SpinBox` instead. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSpinSlider_property_flat: .. rst-class:: classref-property diff --git a/classes/class_editorsyntaxhighlighter.rst b/classes/class_editorsyntaxhighlighter.rst index 4603771ce95..e8e94489e85 100644 --- a/classes/class_editorsyntaxhighlighter.rst +++ b/classes/class_editorsyntaxhighlighter.rst @@ -23,7 +23,7 @@ Description Base class that all :ref:`SyntaxHighlighter`\ s used by the :ref:`ScriptEditor` extend from. -Add a syntax highlighter to an individual script by calling :ref:`ScriptEditorBase.add_syntax_highlighter`. To apply to all scripts on open, call :ref:`ScriptEditor.register_syntax_highlighter`. +Add a syntax highlighter to an individual script by calling :ref:`ScriptEditorBase.add_syntax_highlighter()`. To apply to all scripts on open, call :ref:`ScriptEditor.register_syntax_highlighter()`. .. rst-class:: classref-reftable-group diff --git a/classes/class_editortoaster.rst b/classes/class_editortoaster.rst index f6df8b0b398..50ef8b2bf0c 100644 --- a/classes/class_editortoaster.rst +++ b/classes/class_editortoaster.rst @@ -21,7 +21,7 @@ Description This object manages the functionality and display of toast notifications within the editor, ensuring timely and informative alerts are presented to users. -\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_editor_toaster`. +\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_editor_toaster()`. .. rst-class:: classref-reftable-group diff --git a/classes/class_editortranslationparserplugin.rst b/classes/class_editortranslationparserplugin.rst index 0a6e48b6ff4..e4d750b73b0 100644 --- a/classes/class_editortranslationparserplugin.rst +++ b/classes/class_editortranslationparserplugin.rst @@ -19,11 +19,9 @@ Plugin for adding custom parsers to extract strings that are to be translated fr Description ----------- -**EditorTranslationParserPlugin** is invoked when a file is being parsed to extract strings that require translation. To define the parsing and string extraction logic, override the :ref:`_parse_file` method in script. +**EditorTranslationParserPlugin** is invoked when a file is being parsed to extract strings that require translation. To define the parsing and string extraction logic, override the :ref:`_parse_file()` method in script. -Add the extracted strings to argument ``msgids`` or ``msgids_context_plural`` if context or plural is used. - -When adding to ``msgids_context_plural``, you must add the data using the format ``["A", "B", "C"]``, where ``A`` represents the extracted string, ``B`` represents the context, and ``C`` represents the plural version of the extracted string. If you want to add only context but not plural, put ``""`` for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples. +The return value should be an :ref:`Array` of :ref:`PackedStringArray`\ s, one for each extracted translatable string. Each entry should contain ``[msgid, msgctxt, msgid_plural, comment]``, where all except ``msgid`` are optional. Empty strings will be ignored. The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu. @@ -37,14 +35,17 @@ Below shows an example of a custom parser that extracts strings from a CSV file @tool extends EditorTranslationParserPlugin - func _parse_file(path, msgids, msgids_context_plural): + func _parse_file(path): + var ret: Array[PackedStringArray] = [] var file = FileAccess.open(path, FileAccess.READ) var text = file.get_as_text() var split_strs = text.split(",", false) for s in split_strs: - msgids.append(s) + ret.append(PackedStringArray([s])) #print("Extracted string: " + s) + return ret + func _get_recognized_extensions(): return ["csv"] @@ -55,59 +56,61 @@ Below shows an example of a custom parser that extracts strings from a CSV file [Tool] public partial class CustomParser : EditorTranslationParserPlugin { - public override void _ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural) + public override Godot.Collections.Array _ParseFile(string path) { + Godot.Collections.Array ret; using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); string text = file.GetAsText(); string[] splitStrs = text.Split(",", allowEmpty: false); foreach (string s in splitStrs) { - msgids.Add(s); + ret.Add([s]); //GD.Print($"Extracted string: {s}"); } + return ret; } public override string[] _GetRecognizedExtensions() { - return new string[] { "csv" }; + return ["csv"]; } } -To add a translatable string associated with context or plural, add it to ``msgids_context_plural``: +To add a translatable string associated with a context, plural, or comment: .. tabs:: .. code-tab:: gdscript - # This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals". - msgids_context_plural.append(["Test 1", "context", "test 1 plurals"]) + # This will add a message with msgid "Test 1", msgctxt "context", msgid_plural "test 1 plurals", and comment "test 1 comment". + ret.append(PackedStringArray(["Test 1", "context", "test 1 plurals", "test 1 comment"])) # This will add a message with msgid "A test without context" and msgid_plural "plurals". - msgids_context_plural.append(["A test without context", "", "plurals"]) + ret.append(PackedStringArray(["A test without context", "", "plurals"])) # This will add a message with msgid "Only with context" and msgctxt "a friendly context". - msgids_context_plural.append(["Only with context", "a friendly context", ""]) + ret.append(PackedStringArray(["Only with context", "a friendly context"])) .. code-tab:: csharp - // This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals". - msgidsContextPlural.Add(new Godot.Collections.Array{"Test 1", "context", "test 1 Plurals"}); + // This will add a message with msgid "Test 1", msgctxt "context", msgid_plural "test 1 plurals", and comment "test 1 comment". + ret.Add(["Test 1", "context", "test 1 plurals", "test 1 comment"]); // This will add a message with msgid "A test without context" and msgid_plural "plurals". - msgidsContextPlural.Add(new Godot.Collections.Array{"A test without context", "", "plurals"}); + ret.Add(["A test without context", "", "plurals"]); // This will add a message with msgid "Only with context" and msgctxt "a friendly context". - msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""}); + ret.Add(["Only with context", "a friendly context"]); -\ **Note:** If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the ``path`` argument using :ref:`ResourceLoader.load`. This is because built-in scripts are loaded as :ref:`Resource` type, not :ref:`FileAccess` type. For example: +\ **Note:** If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the ``path`` argument using :ref:`ResourceLoader.load()`. This is because built-in scripts are loaded as :ref:`Resource` type, not :ref:`FileAccess` type. For example: .. tabs:: .. code-tab:: gdscript - func _parse_file(path, msgids, msgids_context_plural): + func _parse_file(path): var res = ResourceLoader.load(path, "Script") var text = res.source_code # Parsing logic. @@ -117,7 +120,7 @@ To add a translatable string associated with context or plural, add it to ``msgi .. code-tab:: csharp - public override void _ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural) + public override Godot.Collections.Array _ParseFile(string path) { var res = ResourceLoader.Load