From bbc324a12542f55b777b38d9574e6d72c314b7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 22 Jun 2020 13:24:53 +0200 Subject: [PATCH] Sync classref with 3.2 branch --- classes/class_@c#.rst | 13 -- classes/class_@globalscope.rst | 10 + classes/class_@nativescript.rst | 13 -- classes/class_@visualscript.rst | 18 -- classes/class_array.rst | 12 +- classes/class_astar.rst | 4 +- classes/class_astar2d.rst | 4 +- classes/class_audioeffectrecord.rst | 5 + classes/class_bool.rst | 14 +- classes/class_color.rst | 4 +- classes/class_csharpscript.rst | 14 ++ classes/class_dictionary.rst | 12 + classes/class_file.rst | 39 +++- classes/class_filedialog.rst | 6 +- classes/class_godotsharp.rst | 27 ++- classes/class_image.rst | 2 +- classes/class_joint2d.rst | 2 +- classes/class_label.rst | 2 +- classes/class_light.rst | 10 +- classes/class_lineedit.rst | 52 +++-- classes/class_material.rst | 2 +- classes/class_node.rst | 10 + classes/class_node2d.rst | 32 --- classes/class_object.rst | 2 + classes/class_omnilight.rst | 2 +- classes/class_os.rst | 62 ++++- classes/class_particles.rst | 2 + classes/class_physicsmaterial.rst | 4 + classes/class_projectsettings.rst | 348 +++++++++++++++------------- classes/class_regex.rst | 3 +- classes/class_regexmatch.rst | 2 +- classes/class_richtextlabel.rst | 24 +- classes/class_rigidbody.rst | 8 +- classes/class_rigidbody2d.rst | 8 +- classes/class_shape2d.rst | 10 + classes/class_spotlight.rst | 2 +- classes/class_string.rst | 16 +- classes/class_tileset.rst | 4 + classes/class_vector2.rst | 2 + classes/class_vector3.rst | 2 + classes/class_viewportcontainer.rst | 2 + classes/class_visualserver.rst | 34 +++ 42 files changed, 545 insertions(+), 299 deletions(-) delete mode 100644 classes/class_@c#.rst delete mode 100644 classes/class_@nativescript.rst delete mode 100644 classes/class_@visualscript.rst diff --git a/classes/class_@c#.rst b/classes/class_@c#.rst deleted file mode 100644 index 99fd1a760..000000000 --- a/classes/class_@c#.rst +++ /dev/null @@ -1,13 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the @C#.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_@C#: - -@C# -=== - - - diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 969d1d569..e408fcf58 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -34,6 +34,8 @@ Properties +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Geometry` | :ref:`Geometry` | +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`GodotSharp` | :ref:`GodotSharp` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`IP` | :ref:`IP` | +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Input` | :ref:`Input` | @@ -2257,6 +2259,14 @@ The :ref:`Geometry` singleton. ---- +.. _class_@GlobalScope_property_GodotSharp: + +- :ref:`GodotSharp` **GodotSharp** + +The :ref:`GodotSharp` singleton. + +---- + .. _class_@GlobalScope_property_IP: - :ref:`IP` **IP** diff --git a/classes/class_@nativescript.rst b/classes/class_@nativescript.rst deleted file mode 100644 index aa731484b..000000000 --- a/classes/class_@nativescript.rst +++ /dev/null @@ -1,13 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the @NativeScript.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_@NativeScript: - -@NativeScript -============= - - - diff --git a/classes/class_@visualscript.rst b/classes/class_@visualscript.rst deleted file mode 100644 index 323db2046..000000000 --- a/classes/class_@visualscript.rst +++ /dev/null @@ -1,18 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the @VisualScript.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_@VisualScript: - -@VisualScript -============= - -Built-in visual script functions. - -Description ------------ - -A list of built-in visual script functions, see :ref:`VisualScriptBuiltinFunc` and :ref:`VisualScript`. - diff --git a/classes/class_array.rst b/classes/class_array.rst index d75617d1a..f0fc62107 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -245,7 +245,7 @@ Removes the first occurrence of a value from the array. - :ref:`int` **find** **(** :ref:`Variant` what, :ref:`int` from=0 **)** -Searches the array for a value and returns its index or -1 if not found. Optionally, the initial search index can be passed. +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. ---- @@ -253,7 +253,7 @@ Searches the array for a value and returns its index or -1 if not found. Optiona - :ref:`int` **find_last** **(** :ref:`Variant` value **)** -Searches the array in reverse order for a value and returns its index or -1 if not found. +Searches the array in reverse order for a value and returns its index or ``-1`` if not found. ---- @@ -278,6 +278,14 @@ Returns ``true`` if the array contains the given value. ["inside", 7].has(7) == true ["inside", 7].has("7") == false +**Note:** This is equivalent to using the ``in`` operator as follows: + +:: + + # Will evaluate to `true`. + if 2 in [2, 4, 6, 8]: + pass + ---- .. _class_Array_method_hash: diff --git a/classes/class_astar.rst b/classes/class_astar.rst index 6c55e5f2d..5da07bde3 100644 --- a/classes/class_astar.rst +++ b/classes/class_astar.rst @@ -179,7 +179,9 @@ Returns the next available point ID with no point associated to it. - :ref:`int` **get_closest_point** **(** :ref:`Vector3` to_position, :ref:`bool` include_disabled=false **)** const -Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns -1 if there are no points in the points pool. +Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool. + +**Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result. ---- diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst index 01f523392..4baa654eb 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -162,7 +162,9 @@ Returns the next available point ID with no point associated to it. - :ref:`int` **get_closest_point** **(** :ref:`Vector2` to_position, :ref:`bool` include_disabled=false **)** const -Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns -1 if there are no points in the points pool. +Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool. + +**Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result. ---- diff --git a/classes/class_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst index 366d6d231..377c4eb9b 100644 --- a/classes/class_audioeffectrecord.rst +++ b/classes/class_audioeffectrecord.rst @@ -13,6 +13,11 @@ AudioEffectRecord Audio effect used for recording sound from a microphone. +Description +----------- + +Allows the user to record sound from a microphone. It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample. + Tutorials --------- diff --git a/classes/class_bool.rst b/classes/class_bool.rst index d4e36ad5d..fb9f52dfc 100644 --- a/classes/class_bool.rst +++ b/classes/class_bool.rst @@ -14,9 +14,9 @@ Boolean built-in type. Description ----------- -Boolean is a built-in type. It can represent any data type that is either a true or false value. You can think of it as an switch with on or off (1 or 0) setting. It's often used as part of programming logic in condition statements like ``if`` statements. +Boolean is a built-in type. There are two boolean values: ``true`` and ``false``. You can think of it as an switch with on or off (1 or 0) setting. Booleans are used in programming for logic in condition statements, like ``if`` statements. -**Note:** In a code below ``if can_shoot`` is equivalent of ``if can_shoot == true``. It is good practice to follow the natural spoken language structure when possible. Use ``if can_shoot`` rather than ``if can_shoot == true`` and use ``if not can_shoot`` rather than ``if can_shoot == false``. +Booleans can be directly used in ``if`` statements. The code below demonstrates this on the ``if can_shoot:`` line. You don't need to use ``== true``, you only need ``if can_shoot:``. Similarly, use ``if not can_shoot:`` rather than ``== false``. :: @@ -24,7 +24,7 @@ Boolean is a built-in type. It can represent any data type that is either a true func shoot(): if can_shoot: - # Perform shooting actions here. + pass # Perform shooting actions here. The following code will only create a bullet if both conditions are met: action "shoot" is pressed and if ``can_shoot`` is ``true``. @@ -72,17 +72,19 @@ Method Descriptions - :ref:`bool` **bool** **(** :ref:`int` from **)** -Cast an :ref:`int` value to a boolean value, this method will return ``true`` if called with an integer value different to 0 and ``false`` in other case. +Cast an :ref:`int` value to a boolean value, this method will return ``false`` if ``0`` is passed in, and ``true`` for all other ints. ---- - :ref:`bool` **bool** **(** :ref:`float` from **)** -Cast a :ref:`float` value to a boolean value, this method will return ``true`` if called with a floating-point value different to 0 and ``false`` in other case. +Cast a :ref:`float` value to a boolean value, this method will return ``false`` if ``0.0`` is passed in, and ``true`` for all other floats. ---- - :ref:`bool` **bool** **(** :ref:`String` from **)** -Cast a :ref:`String` value to a boolean value, this method will return ``true`` if called with a non-empty string and ``false`` in other case. Examples: ``bool("False")`` returns ``true``, ``bool("")`` returns ``false``. +Cast a :ref:`String` value to a boolean value, this method will return ``false`` if ``""`` is passed in, and ``true`` for all non-empty strings. + +Examples: ``bool("False")`` returns ``true``, ``bool("")`` returns ``false``. diff --git a/classes/class_color.rst b/classes/class_color.rst index 9b3d19642..cb196f708 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -16,10 +16,12 @@ Description A color is represented by red, green, and blue ``(r, g, b)`` components. Additionally, ``a`` represents the alpha component, often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as :ref:`CanvasItem.modulate`) may accept values greater than 1. -You can also create a color from standardized color names by using :ref:`@GDScript.ColorN` or directly using the color constants defined here. The standardized color set is based on the `X11 color names `_. +You can also create a color from standardized color names by using :ref:`@GDScript.ColorN` or directly using the color constants defined here. The standardized color set is based on the `X11 color names `_. If you want to supply values in a range of 0 to 255, you should use :ref:`@GDScript.Color8`. +**Note:** In a boolean context, a Color will evaluate to ``false`` if it's equal to ``Color(0, 0, 0, 1)`` (opaque black). Otherwise, a Color will always evaluate to ``true``. + Properties ---------- diff --git a/classes/class_csharpscript.rst b/classes/class_csharpscript.rst index 5f92e9369..d64b6574c 100644 --- a/classes/class_csharpscript.rst +++ b/classes/class_csharpscript.rst @@ -11,7 +11,19 @@ CSharpScript **Inherits:** :ref:`Script` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A script implemented in the C# programming language (Mono-enabled builds only). +Description +----------- + +This class represents a C# script. It is the C# equivalent of the :ref:`GDScript` class and is only available in Mono-enabled Godot builds. + +See also :ref:`GodotSharp`. + +Tutorials +--------- + +- :doc:`../getting_started/scripting/c_sharp/index` Methods ------- @@ -27,3 +39,5 @@ Method Descriptions - :ref:`Object` **new** **(** ... **)** vararg +Returns a new instance of the script. + diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index b2abbdd51..1a740d4b2 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -181,6 +181,16 @@ Returns the current value for the specified key in the ``Dictionary``. If the ke Returns ``true`` if the dictionary has a given key. +**Note:** This is equivalent to using the ``in`` operator as follows: + +:: + + # Will evaluate to `true`. + if "godot" in {"godot": "engine"}: + pass + +This method (like the ``in`` operator) will evaluate to ``true`` as long as the key exists, even if the associated value is ``null``. + ---- .. _class_Dictionary_method_has_all: @@ -204,6 +214,8 @@ Returns a hashed integer value representing the dictionary contents. This can be # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. print(dict1.hash() == dict2.hash()) +**Note:** Dictionaries with the same keys/values but in a different order will have a different hash. + ---- .. _class_Dictionary_method_keys: diff --git a/classes/class_file.rst b/classes/class_file.rst index baf9a364c..11d89dfac 100644 --- a/classes/class_file.rst +++ b/classes/class_file.rst @@ -239,7 +239,7 @@ Returns ``true`` if the file exists in the given path. - :ref:`int` **get_16** **(** **)** const -Returns the next 16 bits from the file as an integer. +Returns the next 16 bits from the file as an integer. See :ref:`store_16` for details on what values can be stored and retrieved this way. ---- @@ -247,7 +247,7 @@ Returns the next 16 bits from the file as an integer. - :ref:`int` **get_32** **(** **)** const -Returns the next 32 bits from the file as an integer. +Returns the next 32 bits from the file as an integer. See :ref:`store_32` for details on what values can be stored and retrieved this way. ---- @@ -255,7 +255,7 @@ Returns the next 32 bits from the file as an integer. - :ref:`int` **get_64** **(** **)** const -Returns the next 64 bits from the file as an integer. +Returns the next 64 bits from the file as an integer. See :ref:`store_64` for details on what values can be stored and retrieved this way. ---- @@ -263,7 +263,7 @@ Returns the next 64 bits from the file as an integer. - :ref:`int` **get_8** **(** **)** const -Returns the next 8 bits from the file as an integer. +Returns the next 8 bits from the file as an integer. See :ref:`store_8` for details on what values can be stored and retrieved this way. ---- @@ -477,7 +477,28 @@ Changes the file reading/writing cursor to the specified position (in bytes from Stores an integer as 16 bits in the file. -**Note:** The ``value`` should lie in the interval ``[0, 2^16 - 1]``. +**Note:** The ``value`` should lie in the interval ``[0, 2^16 - 1]``. Any other value will overflow and wrap around. + +To store a signed integer, use :ref:`store_64` or store a signed integer from the interval ``[-2^15, 2^15 - 1]`` (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: + +:: + + const MAX_15B = 1 << 15 + const MAX_16B = 1 << 16 + + func unsigned16_to_signed(unsigned): + return (unsigned + MAX_15B) % MAX_16B - MAX_15B + + func _ready(): + var f = File.new() + f.open("user://file.dat", File.WRITE_READ) + f.store_16(-42) # This wraps around and stores 65494 (2^16 - 42). + f.store_16(121) # In bounds, will store 121. + f.seek(0) # Go back to start to read the stored value. + var read1 = f.get_16() # 65494 + var read2 = f.get_16() # 121 + var converted1 = unsigned16_to_signed(read1) # -42 + var converted2 = unsigned16_to_signed(read2) # 121 ---- @@ -487,7 +508,9 @@ Stores an integer as 16 bits in the file. Stores an integer as 32 bits in the file. -**Note:** The ``value`` should lie in the interval ``[0, 2^32 - 1]``. +**Note:** The ``value`` should lie in the interval ``[0, 2^32 - 1]``. Any other value will overflow and wrap around. + +To store a signed integer, use :ref:`store_64`, or convert it manually (see :ref:`store_16` for an example). ---- @@ -507,7 +530,9 @@ Stores an integer as 64 bits in the file. Stores an integer as 8 bits in the file. -**Note:** The ``value`` should lie in the interval ``[0, 255]``. +**Note:** The ``value`` should lie in the interval ``[0, 255]``. Any other value will overflow and wrap around. + +To store a signed integer, use :ref:`store_64`, or convert it manually (see :ref:`store_16` for an example). ---- diff --git a/classes/class_filedialog.rst b/classes/class_filedialog.rst index 225681ba8..91028179c 100644 --- a/classes/class_filedialog.rst +++ b/classes/class_filedialog.rst @@ -16,7 +16,7 @@ Dialog for selecting files or directories in the filesystem. Description ----------- -FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. +FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the :ref:`mode`. If you want to use a custom title, disable this by setting :ref:`mode_overrides_title` to ``false``. Properties ---------- @@ -63,6 +63,10 @@ Methods Theme Properties ---------------- ++-------------------------------+----------------------+-----------------------+ +| :ref:`Texture` | file | | ++-------------------------------+----------------------+-----------------------+ +| :ref:`Color` | file_icon_modulate | Color( 1, 1, 1, 1 ) | +-------------------------------+----------------------+-----------------------+ | :ref:`Color` | files_disabled | Color( 0, 0, 0, 0.7 ) | +-------------------------------+----------------------+-----------------------+ diff --git a/classes/class_godotsharp.rst b/classes/class_godotsharp.rst index 370e41cae..60acd1496 100644 --- a/classes/class_godotsharp.rst +++ b/classes/class_godotsharp.rst @@ -11,7 +11,14 @@ GodotSharp **Inherits:** :ref:`Object` +Bridge between Godot and the Mono runtime (Mono-enabled builds only). +Description +----------- + +This class is a bridge between Godot and the Mono runtime. It exposes several low-level operations and is only available in Mono-enabled Godot builds. + +See also :ref:`CSharpScript`. Methods ------- @@ -41,7 +48,7 @@ Method Descriptions - void **attach_thread** **(** **)** -Attaches the current thread to the mono runtime. +Attaches the current thread to the Mono runtime. ---- @@ -49,7 +56,7 @@ Attaches the current thread to the mono runtime. - void **detach_thread** **(** **)** -Detaches the current thread from the mono runtime. +Detaches the current thread from the Mono runtime. ---- @@ -57,19 +64,27 @@ Detaches the current thread from the mono runtime. - :ref:`int` **get_domain_id** **(** **)** +Returns the current MonoDomain ID. + +**Note:** The Mono runtime must be initialized for this method to work (use :ref:`is_runtime_initialized` to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. + ---- .. _class_GodotSharp_method_get_scripts_domain_id: - :ref:`int` **get_scripts_domain_id** **(** **)** +Returns the scripts MonoDomain's ID. This will be the same MonoDomain ID as :ref:`get_domain_id`, unless the scripts domain isn't loaded. + +**Note:** The Mono runtime must be initialized for this method to work (use :ref:`is_runtime_initialized` to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. + ---- .. _class_GodotSharp_method_is_domain_finalizing_for_unload: - :ref:`bool` **is_domain_finalizing_for_unload** **(** :ref:`int` domain_id **)** -Returns whether the domain is being finalized. +Returns ``true`` if the domain is being finalized, ``false`` otherwise. ---- @@ -77,17 +92,21 @@ Returns whether the domain is being finalized. - :ref:`bool` **is_runtime_initialized** **(** **)** +Returns ``true`` if the Mono runtime is initialized, ``false`` otherwise. + ---- .. _class_GodotSharp_method_is_runtime_shutting_down: - :ref:`bool` **is_runtime_shutting_down** **(** **)** +Returns ``true`` if the Mono runtime is shutting down, ``false`` otherwise. + ---- .. _class_GodotSharp_method_is_scripts_domain_loaded: - :ref:`bool` **is_scripts_domain_loaded** **(** **)** -Returns whether the scripts domain is loaded. +Returns ``true`` if the scripts domain is loaded, ``false`` otherwise. diff --git a/classes/class_image.rst b/classes/class_image.rst index a18278dd3..a9ad3e528 100644 --- a/classes/class_image.rst +++ b/classes/class_image.rst @@ -522,7 +522,7 @@ Creates an empty image of given size and format. See :ref:`Format` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PoolByteArray` data **)** -Creates a new image of given size and format. See :ref:`Format` constants. Fills the image with the given raw data. If ``use_mipmaps`` is ``true`` then generate mipmaps for this image. See the :ref:`generate_mipmaps`. +Creates a new image of given size and format. See :ref:`Format` constants. Fills the image with the given raw data. If ``use_mipmaps`` is ``true`` then loads mipmaps for this image from ``data``. See :ref:`generate_mipmaps`. ---- diff --git a/classes/class_joint2d.rst b/classes/class_joint2d.rst index 6348f023f..813971c0a 100644 --- a/classes/class_joint2d.rst +++ b/classes/class_joint2d.rst @@ -64,7 +64,7 @@ When :ref:`node_a` and :ref:`node_b` and :ref:`node_b` can collide. +If ``true``, :ref:`node_a` and :ref:`node_b` can not collide. ---- diff --git a/classes/class_label.rst b/classes/class_label.rst index 28d0d7d64..b03009b1e 100644 --- a/classes/class_label.rst +++ b/classes/class_label.rst @@ -225,7 +225,7 @@ Limits the lines of text the node shows on screen. | *Getter* | get_percent_visible() | +-----------+----------------------------+ -Limits the count of visible characters. If you set ``percent_visible`` to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. +Limits the amount of visible characters. If you set ``percent_visible`` to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. ---- diff --git a/classes/class_light.rst b/classes/class_light.rst index e6894e61d..303e9c523 100644 --- a/classes/class_light.rst +++ b/classes/class_light.rst @@ -18,7 +18,7 @@ Provides a base class for different kinds of light nodes. Description ----------- -Light is the abstract base class for light nodes, so it shouldn't be used directly (it can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. +Light is the *abstract* base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. Tutorials --------- @@ -205,7 +205,7 @@ The light's bake mode. See :ref:`BakeMode`. | *Getter* | get_color() | +-----------+-------------------------+ -The light's color. +The light's color. An *overbright* color can be used to achieve a result equivalent to increasing the light's :ref:`light_energy`. ---- @@ -237,7 +237,7 @@ The light will affect objects in the selected layers. | *Getter* | get_param() | +-----------+------------------+ -The light's strength multiplier. +The light's strength multiplier (this is not a physical unit). For :ref:`OmniLight` and :ref:`SpotLight`, changing this value will only change the light color's intensity, not the light's radius. ---- @@ -285,7 +285,7 @@ If ``true``, the light's effect is reversed, darkening areas and casting bright | *Getter* | get_param() | +-----------+------------------+ -The intensity of the specular blob in objects affected by the light. At ``0`` the light becomes a pure diffuse light. +The intensity of the specular blob in objects affected by the light. At ``0``, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. ---- @@ -301,7 +301,7 @@ The intensity of the specular blob in objects affected by the light. At ``0`` th | *Getter* | get_param() | +-----------+------------------+ -Used to adjust shadow appearance. Too small a value results in self-shadowing, while too large a value causes shadows to separate from casters. Adjust as needed. +Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. ---- diff --git a/classes/class_lineedit.rst b/classes/class_lineedit.rst index 33a4e13e3..83e0c9e04 100644 --- a/classes/class_lineedit.rst +++ b/classes/class_lineedit.rst @@ -102,21 +102,25 @@ Properties Methods ------- -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`append_at_cursor` **(** :ref:`String` text **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`deselect` **(** **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| :ref:`PopupMenu` | :ref:`get_menu` **(** **)** const | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`menu_option` **(** :ref:`int` option **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`select` **(** :ref:`int` from=0, :ref:`int` to=-1 **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`select_all` **(** **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_at_cursor` **(** :ref:`String` text **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`delete_char_at_cursor` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`delete_text` **(** :ref:`int` from_column, :ref:`int` to_column **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`deselect` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PopupMenu` | :ref:`get_menu` **(** **)** const | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`menu_option` **(** :ref:`int` option **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select` **(** :ref:`int` from=0, :ref:`int` to=-1 **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select_all` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ Theme Properties ---------------- @@ -525,7 +529,23 @@ Adds ``text`` after the cursor. If the resulting value is longer than :ref:`max_ - void **clear** **(** **)** -Erases the ``LineEdit`` text. +Erases the ``LineEdit``'s :ref:`text`. + +---- + +.. _class_LineEdit_method_delete_char_at_cursor: + +- void **delete_char_at_cursor** **(** **)** + +Deletes one character at the cursor's current position (equivalent to pressing the ``Delete`` key). + +---- + +.. _class_LineEdit_method_delete_text: + +- void **delete_text** **(** :ref:`int` from_column, :ref:`int` to_column **)** + +Deletes a section of the :ref:`text` going from position ``from_column`` to ``to_column``. Both parameters should be within the text's length. ---- diff --git a/classes/class_material.rst b/classes/class_material.rst index 7812b37c1..58017c01e 100644 --- a/classes/class_material.rst +++ b/classes/class_material.rst @@ -73,5 +73,5 @@ Sets the ``Material`` to be used for the next pass. This renders the object agai Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. -**Note:** this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are sorted based on depth, while transparent objects are sorted from back to front (subject to priority). +**Note:** this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). diff --git a/classes/class_node.rst b/classes/class_node.rst index eb9b51201..971cb75f6 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -618,6 +618,8 @@ To consume the input event and stop it propagating further to other nodes, :ref: For gameplay input, :ref:`_unhandled_input` and :ref:`_unhandled_key_input` are usually a better fit as they allow the GUI to intercept the events first. +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + ---- .. _class_Node_method__physics_process: @@ -630,6 +632,8 @@ It is only called if physics processing is enabled, which is done automatically Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS` notification in :ref:`Object._notification`. +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + ---- .. _class_Node_method__process: @@ -642,6 +646,8 @@ It is only called if processing is enabled, which is done automatically if this Corresponds to the :ref:`NOTIFICATION_PROCESS` notification in :ref:`Object._notification`. +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + ---- .. _class_Node_method__ready: @@ -670,6 +676,8 @@ To consume the input event and stop it propagating further to other nodes, :ref: For gameplay input, this and :ref:`_unhandled_key_input` are usually a better fit than :ref:`_input` as they allow the GUI to intercept the events first. +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + ---- .. _class_Node_method__unhandled_key_input: @@ -684,6 +692,8 @@ To consume the input event and stop it propagating further to other nodes, :ref: For gameplay input, this and :ref:`_unhandled_input` are usually a better fit than :ref:`_input` as they allow the GUI to intercept the events first. +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + ---- .. _class_Node_method_add_child: diff --git a/classes/class_node2d.rst b/classes/class_node2d.rst index 96f68d820..779853b20 100644 --- a/classes/class_node2d.rst +++ b/classes/class_node2d.rst @@ -47,10 +47,6 @@ Properties +---------------------------------------+-------------------------------------------------------------------------------+---------------------+ | :ref:`Vector2` | :ref:`scale` | ``Vector2( 1, 1 )`` | +---------------------------------------+-------------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`skew` | ``0.0`` | -+---------------------------------------+-------------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`skew_degrees` | ``0.0`` | -+---------------------------------------+-------------------------------------------------------------------------------+---------------------+ | :ref:`Transform2D` | :ref:`transform` | | +---------------------------------------+-------------------------------------------------------------------------------+---------------------+ | :ref:`bool` | :ref:`z_as_relative` | ``true`` | @@ -222,34 +218,6 @@ The node's scale. Unscaled value: ``(1, 1)``. ---- -.. _class_Node2D_property_skew: - -- :ref:`float` **skew** - -+-----------+-----------------+ -| *Default* | ``0.0`` | -+-----------+-----------------+ -| *Setter* | set_skew(value) | -+-----------+-----------------+ -| *Getter* | get_skew() | -+-----------+-----------------+ - ----- - -.. _class_Node2D_property_skew_degrees: - -- :ref:`float` **skew_degrees** - -+-----------+-------------------------+ -| *Default* | ``0.0`` | -+-----------+-------------------------+ -| *Setter* | set_skew_degrees(value) | -+-----------+-------------------------+ -| *Getter* | get_skew_degrees() | -+-----------+-------------------------+ - ----- - .. _class_Node2D_property_transform: - :ref:`Transform2D` **transform** diff --git a/classes/class_object.rst b/classes/class_object.rst index e56530ee5..297fca3d0 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -34,6 +34,8 @@ Property membership can be tested directly in GDScript using ``in``: print("position" in n) # Prints "True". print("other_property" in n) # Prints "False". +The ``in`` operator will evaluate to ``true`` as long as the key exists, even if the value is ``null``. + Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See :ref:`_notification`. Methods diff --git a/classes/class_omnilight.rst b/classes/class_omnilight.rst index cd9e43833..dfecab69c 100644 --- a/classes/class_omnilight.rst +++ b/classes/class_omnilight.rst @@ -96,7 +96,7 @@ The light's attenuation (drop-off) curve. A number of presets are available in t | *Getter* | get_param() | +-----------+------------------+ -The light's radius. +The light's radius. Note that the effectively lit area may appear to be smaller depending on the :ref:`omni_attenuation` in use. No matter the :ref:`omni_attenuation` in use, the light will never reach anything outside this radius. ---- diff --git a/classes/class_os.rst b/classes/class_os.rst index 4580bd6b7..c9344c67e 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -219,6 +219,16 @@ Methods +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_window_focused` **(** **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`keyboard_get_current_layout` **(** **)** const | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`keyboard_get_layout_count` **(** **)** const | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`keyboard_get_layout_language` **(** :ref:`int` index **)** const | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`keyboard_get_layout_name` **(** :ref:`int` index **)** const | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`keyboard_set_current_layout` **(** :ref:`int` index **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`kill` **(** :ref:`int` pid **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_window_to_foreground` **(** **)** | @@ -1098,7 +1108,7 @@ Returns the model name of the current device. - :ref:`String` **get_name** **(** **)** const -Returns the name of the host OS. Possible values are: ``"Android"``, ``"Haiku"``, ``"iOS"``, ``"HTML5"``, ``"OSX"``, ``"Server"``, ``"Windows"``, ``"UWP"``, ``"X11"``. +Returns the name of the host OS. Possible values are: ``"Android"``, ``"iOS"``, ``"HTML5"``, ``"OSX"``, ``"Server"``, ``"Windows"``, ``"UWP"``, ``"X11"``. ---- @@ -1537,6 +1547,56 @@ Returns ``true`` if the window is currently focused. ---- +.. _class_OS_method_keyboard_get_current_layout: + +- :ref:`int` **keyboard_get_current_layout** **(** **)** const + +Returns active keyboard layout index. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_get_layout_count: + +- :ref:`int` **keyboard_get_layout_count** **(** **)** const + +Returns the number of keyboard layouts. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_get_layout_language: + +- :ref:`String` **keyboard_get_layout_language** **(** :ref:`int` index **)** const + +Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_get_layout_name: + +- :ref:`String` **keyboard_get_layout_name** **(** :ref:`int` index **)** const + +Returns the localized name of the keyboard layout at position ``index``. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_set_current_layout: + +- void **keyboard_set_current_layout** **(** :ref:`int` index **)** + +Sets active keyboard layout. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + .. _class_OS_method_kill: - :ref:`Error` **kill** **(** :ref:`int` pid **)** diff --git a/classes/class_particles.rst b/classes/class_particles.rst index ea92e9b71..72d553dab 100644 --- a/classes/class_particles.rst +++ b/classes/class_particles.rst @@ -402,6 +402,8 @@ Speed scaling ratio. A value of ``0`` can be used to pause the particles. The :ref:`AABB` that determines the area of the world part of which needs to be visible on screen for the particle system to be active. +**Note:** If the :ref:`ParticlesMaterial` in use is configured to cast shadows, you may want to enlarge this AABB to ensure the shadow is updated when particles are off-screen. + Method Descriptions ------------------- diff --git a/classes/class_physicsmaterial.rst b/classes/class_physicsmaterial.rst index 58008184a..8c5962cd7 100644 --- a/classes/class_physicsmaterial.rst +++ b/classes/class_physicsmaterial.rst @@ -46,6 +46,8 @@ Property Descriptions | *Getter* | is_absorbent() | +-----------+----------------------+ +If ``true``, subtracts the bounciness from the colliding object's bounciness instead of adding it. + ---- .. _class_PhysicsMaterial_property_bounce: @@ -92,3 +94,5 @@ The body's friction. Values range from ``0`` (frictionless) to ``1`` (maximum fr | *Getter* | is_rough() | +-----------+------------------+ +If ``true``, the physics engine will use the friction of the object marked as "rough" when two objects collide. If ``false``, the physics engine will use the lowest friction of all colliding objects instead. If ``true`` for both colliding objects, the physics engine will use the highest friction. + diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 24812d263..75f4f5d95 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -524,33 +524,37 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`physics/common/physics_jitter_fix` | ``0.5`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/debug/diagnose_frame` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/debug/flash_batching` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/lights/max_join_items` | ``32`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/batching/lights/scissor_area_threshold` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/options/single_rect_fallback` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/options/use_batching` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/options/use_batching_in_editor` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/parameters/batch_buffer_size` | ``16384`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/batching/parameters/colored_vertex_format_threshold` | ``0.25`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/parameters/item_reordering_lookahead` | ``4`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/parameters/max_join_item_commands` | ``16`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/precision/uv_contract` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/precision/uv_contract_amount` | ``100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`rendering/environment/default_clear_color` | ``Color( 0.3, 0.3, 0.3, 1 )`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/environment/default_environment` | ``""`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rendering/gles2/batching/batch_buffer_size` | ``16384`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`rendering/gles2/batching/colored_vertex_format_threshold` | ``0.25`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rendering/gles2/batching/item_reordering_lookahead` | ``4`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rendering/gles2/batching/light_max_join_items` | ``32`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`rendering/gles2/batching/light_scissor_area_threshold` | ``1.0`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rendering/gles2/batching/max_join_item_commands` | ``16`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/gles2/batching/single_rect_fallback` | ``false`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/gles2/batching/use_batching` | ``true`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/gles2/debug/diagnose_frame` | ``false`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/gles2/debug/disable_half_float` | ``false`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/gles2/debug/flash_batching` | ``false`` | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/gles2/debug/use_batching_in_editor` | ``true`` | +| :ref:`bool` | :ref:`rendering/gles2/compatibility/disable_half_float` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/limits/buffers/blend_shape_max_buffer_size_kb` | ``4096`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ @@ -3715,6 +3719,166 @@ Fix to improve physics jitter, specially on monitors where refresh rate is diffe ---- +.. _class_ProjectSettings_property_rendering/batching/debug/diagnose_frame: + +- :ref:`bool` **rendering/batching/debug/diagnose_frame** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +When batching is on, this regularly prints a frame diagnosis log. Note that this will degrade performance. + +---- + +.. _class_ProjectSettings_property_rendering/batching/debug/flash_batching: + +- :ref:`bool` **rendering/batching/debug/flash_batching** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +**Experimental** For regression testing against the old renderer. If this is switched on, and ``use_batching`` is set, the renderer will swap alternately between using the old renderer, and the batched renderer, on each frame. This makes it easy to identify visual differences. Performance will be degraded. + +---- + +.. _class_ProjectSettings_property_rendering/batching/lights/max_join_items: + +- :ref:`int` **rendering/batching/lights/max_join_items** + ++-----------+--------+ +| *Default* | ``32`` | ++-----------+--------+ + +Lights have the potential to prevent joining items, and break many of the performance benefits of batching. This setting enables some complex logic to allow joining items if their lighting is similar, and overlap tests pass. This can significantly improve performance in some games. Set to 0 to switch off. With large values the cost of overlap tests may lead to diminishing returns. + +---- + +.. _class_ProjectSettings_property_rendering/batching/lights/scissor_area_threshold: + +- :ref:`float` **rendering/batching/lights/scissor_area_threshold** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +Sets the proportion of the total screen area (in pixels) that must be saved by a scissor operation in order to activate light scissoring. This can prevent parts of items being rendered outside the light area. Lower values scissor more aggressively. A value of 1 scissors none of the items, a value of 0 scissors every item. The power of 4 of the value is used, in order to emphasize the lower range, and multiplied by the total screen area in pixels to give the threshold. This can reduce fill rate requirements in scenes with a lot of lighting. + +---- + +.. _class_ProjectSettings_property_rendering/batching/options/single_rect_fallback: + +- :ref:`bool` **rendering/batching/options/single_rect_fallback** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Enabling this setting uses the legacy method to draw batches containing only one rect. The legacy method is faster (approx twice as fast), but can cause flicker on some systems. In order to directly compare performance with the non-batching renderer you can set this to true, but it is recommended to turn this off unless you can guarantee your target hardware will work with this method. + +---- + +.. _class_ProjectSettings_property_rendering/batching/options/use_batching: + +- :ref:`bool` **rendering/batching/options/use_batching** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Turns batching on and off. Batching increases performance by reducing the amount of graphics API drawcalls. + +---- + +.. _class_ProjectSettings_property_rendering/batching/options/use_batching_in_editor: + +- :ref:`bool` **rendering/batching/options/use_batching_in_editor** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Switches on batching within the editor. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/batch_buffer_size: + +- :ref:`int` **rendering/batching/parameters/batch_buffer_size** + ++-----------+-----------+ +| *Default* | ``16384`` | ++-----------+-----------+ + +Size of buffer reserved for batched vertices. Larger size enables larger batches, but there are diminishing returns for the memory used. This should only have a minor effect on performance. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/colored_vertex_format_threshold: + +- :ref:`float` **rendering/batching/parameters/colored_vertex_format_threshold** + ++-----------+----------+ +| *Default* | ``0.25`` | ++-----------+----------+ + +Including color in the vertex format has a cost, however, not including color prevents batching across color changes. This threshold determines the ratio of ``number of vertex color changes / total number of vertices`` above which vertices will be translated to colored format. A value of 0 will always use colored vertices, 1 will never use colored vertices. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/item_reordering_lookahead: + +- :ref:`int` **rendering/batching/parameters/item_reordering_lookahead** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +In certain circumstances, the batcher can reorder items in order to better join them. This may result in better performance. An overlap test is needed however for each item lookahead, so there is a trade off, with diminishing returns. If you are getting no benefit, setting this to 0 will switch it off. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/max_join_item_commands: + +- :ref:`int` **rendering/batching/parameters/max_join_item_commands** + ++-----------+--------+ +| *Default* | ``16`` | ++-----------+--------+ + +Sets the number of commands to lookahead to determine whether to batch render items. A value of 1 can join items consisting of single commands, 0 turns off joining. Higher values are in theory more likely to join, however this has diminishing returns and has a runtime cost so a small value is recommended. + +---- + +.. _class_ProjectSettings_property_rendering/batching/precision/uv_contract: + +- :ref:`bool` **rendering/batching/precision/uv_contract** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +On some platforms (especially mobile), precision issues in shaders can lead to reading 1 texel outside of bounds, particularly where rects are scaled. This can particularly lead to border artifacts around tiles in tilemaps. + +This adjustment corrects for this by making a small contraction to the UV coordinates used. Note that this can result in a slight squashing of border texels. + +---- + +.. _class_ProjectSettings_property_rendering/batching/precision/uv_contract_amount: + +- :ref:`int` **rendering/batching/precision/uv_contract_amount** + ++-----------+---------+ +| *Default* | ``100`` | ++-----------+---------+ + +The amount of UV contraction. This figure is divided by 1000000, and is a proportion of the total texture dimensions, where the width and height are both ranged from 0.0 to 1.0. + +Use the default unless correcting for a problem on particular hardware. + +---- + .. _class_ProjectSettings_property_rendering/environment/default_clear_color: - :ref:`Color` **rendering/environment/default_clear_color** @@ -3739,117 +3903,9 @@ Default background clear color. Overridable per :ref:`Viewport` ---- -.. _class_ProjectSettings_property_rendering/gles2/batching/batch_buffer_size: +.. _class_ProjectSettings_property_rendering/gles2/compatibility/disable_half_float: -- :ref:`int` **rendering/gles2/batching/batch_buffer_size** - -+-----------+-----------+ -| *Default* | ``16384`` | -+-----------+-----------+ - -Size of buffer reserved for batched vertices. Larger size enables larger batches, but there are diminishing returns for the memory used. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/colored_vertex_format_threshold: - -- :ref:`float` **rendering/gles2/batching/colored_vertex_format_threshold** - -+-----------+----------+ -| *Default* | ``0.25`` | -+-----------+----------+ - -Including color in the vertex format has a cost, however, not including color prevents batching across color changes. This threshold determines the ratio of ``number of vertex color changes / total number of vertices`` above which vertices will be translated to colored format. A value of 0 will always use colored vertices, 1 will never use colored vertices. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/item_reordering_lookahead: - -- :ref:`int` **rendering/gles2/batching/item_reordering_lookahead** - -+-----------+-------+ -| *Default* | ``4`` | -+-----------+-------+ - -In certain circumstances, the batcher can reorder items in order to better join them. This may result in better performance. An overlap test is needed however for each item lookahead, so there is a trade off, with diminishing returns. If you are getting no benefit, setting this to 0 will switch it off. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/light_max_join_items: - -- :ref:`int` **rendering/gles2/batching/light_max_join_items** - -+-----------+--------+ -| *Default* | ``32`` | -+-----------+--------+ - -Lights have the potential to prevent joining items, and break many of the performance benefits of batching. This setting enables some complex logic to allow joining items if their lighting is similar, and overlap tests pass. This can significantly improve performance in some games. Set to 0 to switch off. With large values the cost of overlap tests may lead to diminishing returns. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/light_scissor_area_threshold: - -- :ref:`float` **rendering/gles2/batching/light_scissor_area_threshold** - -+-----------+---------+ -| *Default* | ``1.0`` | -+-----------+---------+ - -Sets the proportion of the screen area that must be saved by a scissor operation in order to activate light scissoring. This can prevent parts of items being rendered outside the light area. Lower values scissor more aggressively. A value of 1 scissors none of the items, a value of 0 scissors every item. This can reduce fill rate requirements in scenes with a lot of lighting. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/max_join_item_commands: - -- :ref:`int` **rendering/gles2/batching/max_join_item_commands** - -+-----------+--------+ -| *Default* | ``16`` | -+-----------+--------+ - -Sets the number of commands to lookahead to determine whether to batch render items. A value of 1 can join items consisting of single commands, 0 turns off joining. Higher values are in theory more likely to join, however this has diminishing returns and has a runtime cost so a small value is recommended. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/single_rect_fallback: - -- :ref:`bool` **rendering/gles2/batching/single_rect_fallback** - -+-----------+-----------+ -| *Default* | ``false`` | -+-----------+-----------+ - -Enabling this uses the legacy method to draw single rects, which is faster, but can cause flicker on some systems. This is best disabled unless crucial for performance. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/batching/use_batching: - -- :ref:`bool` **rendering/gles2/batching/use_batching** - -+-----------+----------+ -| *Default* | ``true`` | -+-----------+----------+ - -Turns batching on and off. Batching increases performance by reducing the amount of graphics API drawcalls. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/debug/diagnose_frame: - -- :ref:`bool` **rendering/gles2/debug/diagnose_frame** - -+-----------+-----------+ -| *Default* | ``false`` | -+-----------+-----------+ - -When batching is on, this regularly prints a frame diagnosis log. Note that this will degrade performance. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/debug/disable_half_float: - -- :ref:`bool` **rendering/gles2/debug/disable_half_float** +- :ref:`bool` **rendering/gles2/compatibility/disable_half_float** +-----------+-----------+ | *Default* | ``false`` | @@ -3859,30 +3915,6 @@ The use of half-float vertex compression may be producing rendering errors on so ---- -.. _class_ProjectSettings_property_rendering/gles2/debug/flash_batching: - -- :ref:`bool` **rendering/gles2/debug/flash_batching** - -+-----------+-----------+ -| *Default* | ``false`` | -+-----------+-----------+ - -**Experimental** For regression testing against the old renderer. If this is switched on, and ``use_batching`` is set, the renderer will swap alternately between using the old renderer, and the batched renderer, on each frame. This makes it easy to identify visual differences. Performance will be degraded. - ----- - -.. _class_ProjectSettings_property_rendering/gles2/debug/use_batching_in_editor: - -- :ref:`bool` **rendering/gles2/debug/use_batching_in_editor** - -+-----------+----------+ -| *Default* | ``true`` | -+-----------+----------+ - -**Experimental** Switches on batching within the editor. Use with caution - note that if your editor does not render correctly you may need to edit your ``project.godot`` and remove the use_batching_in_editor setting manually. - ----- - .. _class_ProjectSettings_property_rendering/limits/buffers/blend_shape_max_buffer_size_kb: - :ref:`int` **rendering/limits/buffers/blend_shape_max_buffer_size_kb** @@ -4003,6 +4035,8 @@ If ``true``, this option enables a "safe" code path for such NVIDIA GPUs at the If ``true``, forces snapping of polygons to pixels in 2D rendering. May help in some pixel art styles. +Consider using the project setting :ref:`rendering/batching/precision/uv_contract` to prevent artifacts. + ---- .. _class_ProjectSettings_property_rendering/quality/depth/hdr: diff --git a/classes/class_regex.rst b/classes/class_regex.rst index 1aa64faf3..28aab0980 100644 --- a/classes/class_regex.rst +++ b/classes/class_regex.rst @@ -55,8 +55,7 @@ If you need to process multiple results, :ref:`search_all`_ library. You can view the full pattern reference `here `_. diff --git a/classes/class_regexmatch.rst b/classes/class_regexmatch.rst index cf48b745a..e80782372 100644 --- a/classes/class_regexmatch.rst +++ b/classes/class_regexmatch.rst @@ -55,7 +55,7 @@ Property Descriptions | *Getter* | get_names() | +-----------+-------------+ -A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. +A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. ---- diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst index 96a643675..beb283a8a 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -35,6 +35,8 @@ Properties +-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ | :ref:`Array` | :ref:`custom_effects` | ``[ ]`` | +-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`fit_content_height` | ``false`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`meta_underlined` | ``true`` | +-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`override_selected_font_color` | ``false`` | @@ -68,7 +70,7 @@ Methods +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_content_height` **(** **)** | +| :ref:`int` | :ref:`get_content_height` **(** **)** const | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_count` **(** **)** const | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -367,6 +369,24 @@ To add a custom effect, it's more convenient to use :ref:`install_effect` **fit_content_height** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_fit_content_height(value) | ++-----------+---------------------------------+ +| *Getter* | is_fit_content_height_enabled() | ++-----------+---------------------------------+ + +If ``true``, the label's height will be automatically updated to fit its content. + +**Note:** This property is used as a workaround to fix issues with ``RichTextLabel`` in :ref:`Container`\ s, but it's unreliable in some cases and will be removed in future versions. + +---- + .. _class_RichTextLabel_property_meta_underlined: - :ref:`bool` **meta_underlined** @@ -552,7 +572,7 @@ Clears the tag stack and sets :ref:`bbcode_text` **get_content_height** **(** **)** +- :ref:`int` **get_content_height** **(** **)** const Returns the height of the content. diff --git a/classes/class_rigidbody.rst b/classes/class_rigidbody.rst index 561e6c30c..c75f55f1f 100644 --- a/classes/class_rigidbody.rst +++ b/classes/class_rigidbody.rst @@ -152,7 +152,9 @@ This signal not only receives the body that stopped colliding with this one, but - **sleeping_state_changed** **(** **)** -Emitted when the body changes its sleeping state. Either by sleeping or waking up. +Emitted when the physics engine changes the body's sleeping state. + +**Note:** Changing the value :ref:`sleeping` will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or ``emit_signal("sleeping_state_changed")`` is used. Enumerations ------------ @@ -336,7 +338,7 @@ Deprecated, use :ref:`PhysicsMaterial.bounce`. ---- @@ -530,7 +532,7 @@ If a material is assigned to this property, it will be used instead of any other | *Getter* | is_sleeping() | +-----------+---------------------+ -If ``true``, the body is sleeping and will not calculate forces until woken up by a collision or the ``apply_impulse`` method. +If ``true``, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the :ref:`apply_impulse` or :ref:`add_force` methods. ---- diff --git a/classes/class_rigidbody2d.rst b/classes/class_rigidbody2d.rst index 6b72904ca..07f23cc01 100644 --- a/classes/class_rigidbody2d.rst +++ b/classes/class_rigidbody2d.rst @@ -135,7 +135,9 @@ Emitted when a body shape exits contact with this one. Reports colliding shape i - **sleeping_state_changed** **(** **)** -Emitted when :ref:`sleeping` changes. +Emitted when the physics engine changes the body's sleeping state. + +**Note:** Changing the value :ref:`sleeping` will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or ``emit_signal("sleeping_state_changed")`` is used. Enumerations ------------ @@ -273,7 +275,7 @@ Deprecated, use :ref:`PhysicsMaterial.bounce` or :ref:`add_force`. +If ``true``, the body can enter sleep mode when there is no movement. See :ref:`sleeping`. ---- @@ -481,7 +483,7 @@ If a material is assigned to this property, it will be used instead of any other | *Getter* | is_sleeping() | +-----------+---------------------+ -If ``true``, the body is sleeping and will not calculate forces until woken up by a collision or by using :ref:`apply_impulse` or :ref:`add_force`. +If ``true``, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the :ref:`apply_impulse` or :ref:`add_force` methods. ---- diff --git a/classes/class_shape2d.rst b/classes/class_shape2d.rst index f7e20ff71..d6e0003be 100644 --- a/classes/class_shape2d.rst +++ b/classes/class_shape2d.rst @@ -44,6 +44,8 @@ Methods +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`collide_with_motion_and_get_contacts` **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Color` color **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -103,3 +105,11 @@ Returns a list of the points where this shape would touch another, if a given mo This method needs the transformation matrix for this shape (``local_xform``), the movement to test on this shape (``local_motion``), the shape to check collisions with (``with_shape``), the transformation matrix of that shape (``shape_xform``), and the movement to test onto the other object (``shape_motion``). +---- + +.. _class_Shape2D_method_draw: + +- void **draw** **(** :ref:`RID` canvas_item, :ref:`Color` color **)** + +Draws a solid shape onto a :ref:`CanvasItem` with the :ref:`VisualServer` API filled with the specified ``color``. The exact drawing method is specific for each shape and cannot be configured. + diff --git a/classes/class_spotlight.rst b/classes/class_spotlight.rst index d38b07fbc..7a719b5ff 100644 --- a/classes/class_spotlight.rst +++ b/classes/class_spotlight.rst @@ -99,5 +99,5 @@ The spotlight's light energy attenuation curve. | *Getter* | get_param() | +-----------+------------------+ -The maximal range that can be reached by the spotlight. +The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the :ref:`spot_attenuation` in use. No matter the :ref:`spot_attenuation` in use, the light will never reach anything outside this range. diff --git a/classes/class_string.rst b/classes/class_string.rst index e99582fc3..0e4ce37b3 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -483,7 +483,15 @@ Erases ``chars`` characters from the string starting from ``position``. - :ref:`int` **find** **(** :ref:`String` what, :ref:`int` from=0 **)** -Finds the first occurrence of a substring. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. +Finds the first occurrence of a substring. Returns the starting position of the substring or ``-1`` if not found. Optionally, the initial search index can be passed. + +**Note:** If you just want to know whether a string contains a substring, use the ``in`` operator as follows: + +:: + + # Will evaluate to `false`. + if "i" in "team": + pass ---- @@ -491,7 +499,7 @@ Finds the first occurrence of a substring. Returns the starting position of the - :ref:`int` **find_last** **(** :ref:`String` what **)** -Finds the last occurrence of a substring. Returns the starting position of the substring or -1 if not found. +Finds the last occurrence of a substring. Returns the starting position of the substring or ``-1`` if not found. ---- @@ -499,7 +507,7 @@ Finds the last occurrence of a substring. Returns the starting position of the s - :ref:`int` **findn** **(** :ref:`String` what, :ref:`int` from=0 **)** -Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. +Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or ``-1`` if not found. Optionally, the initial search index can be passed. ---- @@ -987,7 +995,7 @@ Returns a copy of the string stripped of any escape character. These include all - :ref:`String` **substr** **(** :ref:`int` from, :ref:`int` len=-1 **)** -Returns part of the string from the position ``from`` with length ``len``. Argument ``len`` is optional and using -1 will return remaining characters from given position. +Returns part of the string from the position ``from`` with length ``len``. Argument ``len`` is optional and using ``-1`` will return remaining characters from given position. ---- diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst index dfb0b54a9..5e9a0a309 100644 --- a/classes/class_tileset.rst +++ b/classes/class_tileset.rst @@ -259,6 +259,10 @@ Method Descriptions - :ref:`bool` **_is_tile_bound** **(** :ref:`int` drawn_id, :ref:`int` neighbor_id **)** virtual +Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. + +**Note:** ``neighbor_id`` will be ``-1`` (:ref:`TileMap.INVALID_CELL`) when checking a tile against an empty neighbor tile. + ---- .. _class_TileSet_method_autotile_clear_bitmask_map: diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index b244b3409..5bed55cd7 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -16,6 +16,8 @@ Description 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. +**Note:** In a boolean context, a Vector2 will evaluate to ``false`` if it's equal to ``Vector2(0, 0)``. Otherwise, a Vector2 will always evaluate to ``true``. + Tutorials --------- diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 79a702c83..0e6223931 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -16,6 +16,8 @@ Description 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. +**Note:** In a boolean context, a Vector3 will evaluate to ``false`` if it's equal to ``Vector3(0, 0, 0)``. Otherwise, a Vector3 will always evaluate to ``true``. + Tutorials --------- diff --git a/classes/class_viewportcontainer.rst b/classes/class_viewportcontainer.rst index 4f90a246d..60731b821 100644 --- a/classes/class_viewportcontainer.rst +++ b/classes/class_viewportcontainer.rst @@ -18,6 +18,8 @@ Description A :ref:`Container` node that holds a :ref:`Viewport`, automatically setting its size. +**Note:** Changing a ViewportContainer's :ref:`Control.rect_scale` will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). + Properties ---------- diff --git a/classes/class_visualserver.rst b/classes/class_visualserver.rst index 5f38c1306..b9775650d 100644 --- a/classes/class_visualserver.rst +++ b/classes/class_visualserver.rst @@ -39,6 +39,13 @@ Tutorials - :doc:`../tutorials/optimization/using_servers` +Properties +---------- + ++-------------------------+-----------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`render_loop_enabled` | ++-------------------------+-----------------------------------------------------------------------------+ + Methods ------- @@ -635,6 +642,8 @@ Methods +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_default_clear_color` **(** :ref:`Color` color **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_shader_time_scale` **(** :ref:`float` scale **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`shader_create` **(** **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`shader_get_code` **(** :ref:`RID` shader **)** const | @@ -1919,6 +1928,21 @@ Constants - **MATERIAL_RENDER_PRIORITY_MAX** = **127** --- The maximum renderpriority of all materials. +Property Descriptions +--------------------- + +.. _class_VisualServer_property_render_loop_enabled: + +- :ref:`bool` **render_loop_enabled** + ++----------+--------------------------------+ +| *Setter* | set_render_loop_enabled(value) | ++----------+--------------------------------+ +| *Getter* | is_render_loop_enabled() | ++----------+--------------------------------+ + +If ``false``, disables rendering completely, but the engine logic is still being processed. You can call :ref:`force_draw` to draw a frame even with rendering disabled. + Method Descriptions ------------------- @@ -4376,6 +4400,16 @@ Sets the default clear color which is used when a specific clear color has not b ---- +.. _class_VisualServer_method_set_shader_time_scale: + +- void **set_shader_time_scale** **(** :ref:`float` scale **)** + +Sets the scale to apply to the passage of time for the shaders' ``TIME`` builtin. + +The default value is ``1.0``, which means ``TIME`` will count the real time as it goes by, without narrowing or stretching it. + +---- + .. _class_VisualServer_method_shader_create: - :ref:`RID` **shader_create** **(** **)**