From 0bfc00a71fc5ebe52517168f6dce8883eb27731e Mon Sep 17 00:00:00 2001 From: Redot Organization Date: Sat, 15 Feb 2025 03:32:45 +0000 Subject: [PATCH] classref: Sync with current master branch (68412af) --- classes/class_@gdscript.rst | 12 +- classes/class_@globalscope.rst | 182 ++- classes/class_array.rst | 30 +- classes/class_arraymesh.rst | 10 +- classes/class_astargrid2d.rst | 4 +- classes/class_audiostreamgenerator.rst | 84 +- classes/class_audiostreammp3.rst | 45 + classes/class_audiostreamoggvorbis.rst | 16 +- classes/class_audiostreamsynchronized.rst | 2 +- classes/class_audiostreamwav.rst | 24 +- classes/class_basis.rst | 6 +- classes/class_callable.rst | 6 +- classes/class_canvasitem.rst | 8 +- classes/class_charfxtransform.rst | 26 +- classes/class_collisionpolygon2d.rst | 2 +- classes/class_collisionpolygon3d.rst | 58 +- classes/class_color.rst | 22 + classes/class_colorpicker.rst | 28 +- classes/class_control.rst | 10 +- classes/class_cpuparticles2d.rst | 328 +++-- classes/class_cpuparticles3d.rst | 64 +- classes/class_csgpolygon3d.rst | 85 +- classes/class_cubemap.rst | 8 +- classes/class_displayserver.rst | 160 +- classes/class_dtlsserver.rst | 8 +- classes/class_editorcontextmenuplugin.rst | 46 +- classes/class_editordebuggerplugin.rst | 2 +- classes/class_editorexportplatform.rst | 4 +- classes/class_editorexportplatformandroid.rst | 34 +- classes/class_editorexportplatformios.rst | 14 - .../class_editorexportplatformlinuxbsd.rst | 2 +- classes/class_editorexportplatformweb.rst | 4 +- classes/class_editorexportplatformwindows.rst | 2 - classes/class_editorfiledialog.rst | 2 + classes/class_editorimportplugin.rst | 10 +- classes/class_editorinspector.rst | 2 - classes/class_editorinterface.rst | 246 ++-- classes/class_editorproperty.rst | 38 + classes/class_editorsceneformatimporter.rst | 72 +- classes/class_editorscenepostimportplugin.rst | 2 + classes/class_editorsettings.rst | 151 +- classes/class_editorspinslider.rst | 53 +- .../class_editortranslationparserplugin.rst | 10 +- classes/class_environment.rst | 12 +- classes/class_fileaccess.rst | 2 +- classes/class_filedialog.rst | 6 +- classes/class_float.rst | 4 +- classes/class_geometry2d.rst | 2 +- classes/class_gltfstate.rst | 2 +- classes/class_gpuparticles2d.rst | 60 +- classes/class_gpuparticles3d.rst | 60 +- ...ass_gpuparticlescollisionheightfield3d.rst | 66 + classes/class_httpclient.rst | 2 +- classes/class_importermesh.rst | 2 +- classes/class_input.rst | 12 +- classes/class_inputeventwithmodifiers.rst | 2 + classes/class_itemlist.rst | 37 + classes/class_javascriptbridge.rst | 2 + classes/class_javascriptobject.rst | 8 +- classes/class_json.rst | 2 +- classes/class_lightmapgi.rst | 134 +- classes/class_lineedit.rst | 52 +- classes/class_lookatmodifier3d.rst | 66 +- classes/class_nativemenu.rst | 4 +- classes/class_navigationpolygon.rst | 6 +- classes/class_navigationregion2d.rst | 48 +- classes/class_navigationregion3d.rst | 14 + classes/class_navigationserver2d.rst | 42 + classes/class_navigationserver3d.rst | 42 + classes/class_node3d.rst | 10 +- classes/class_nodepath.rst | 26 +- classes/class_object.rst | 40 +- classes/class_openxrapiextension.rst | 58 + classes/class_os.rst | 30 +- classes/class_packedbytearray.rst | 6 +- classes/class_packeddatacontainer.rst | 13 +- classes/class_packeddatacontainerref.rst | 25 +- classes/class_packedstringarray.rst | 2 +- classes/class_particleprocessmaterial.rst | 54 +- classes/class_physicsdirectspacestate2d.rst | 2 +- classes/class_physicsdirectspacestate3d.rst | 2 +- classes/class_polygonpathfinder.rst | 16 +- classes/class_popupmenu.rst | 38 +- classes/class_popuppanel.rst | 14 + classes/class_projection.rst | 2 + classes/class_projectsettings.rst | 108 +- classes/class_randomnumbergenerator.rst | 2 +- classes/class_raycast3d.rst | 6 +- classes/class_renderingdevice.rst | 94 +- classes/class_renderingserver.rst | 167 ++- .../class_resourceimporterlayeredtexture.rst | 2 +- classes/class_resourceimporteroggvorbis.rst | 20 +- classes/class_resourceloader.rst | 6 +- classes/class_retargetmodifier3d.rst | 186 ++- classes/class_richtextlabel.rst | 20 +- classes/class_skeletonmodifier3d.rst | 67 +- classes/class_skeletonprofilehumanoid.rst | 2 + classes/class_springbonecollision3d.rst | 159 ++ .../class_springbonecollisioncapsule3d.rst | 103 ++ classes/class_springbonecollisionplane3d.rst | 31 + classes/class_springbonecollisionsphere3d.rst | 84 ++ classes/class_springbonesimulator3d.rst | 1299 +++++++++++++++++ classes/class_string.rst | 10 +- classes/class_stringname.rst | 10 +- classes/class_subtweentweener.rst | 62 + classes/class_subviewport.rst | 2 + classes/class_surfacetool.rst | 2 +- classes/class_textedit.rst | 53 +- classes/class_textserver.rst | 23 +- classes/class_textserverextension.rst | 16 + classes/class_textserverfallback.rst | 2 +- classes/class_textureprogressbar.rst | 2 +- classes/class_tiledata.rst | 16 +- classes/class_tilemap.rst | 2 + classes/class_tilemaplayer.rst | 21 + classes/class_tileset.rst | 14 + classes/class_timer.rst | 2 +- classes/class_tween.rst | 45 + classes/class_tweener.rst | 2 +- classes/class_vector2.rst | 4 +- classes/class_vector4.rst | 2 +- classes/class_vector4i.rst | 6 +- classes/class_viewport.rst | 66 +- classes/class_window.rst | 34 +- classes/class_worldboundaryshape3d.rst | 2 + classes/class_xrvrs.rst | 29 +- classes/index.rst | 6 + 127 files changed, 4741 insertions(+), 997 deletions(-) create mode 100644 classes/class_springbonecollision3d.rst create mode 100644 classes/class_springbonecollisioncapsule3d.rst create mode 100644 classes/class_springbonecollisionplane3d.rst create mode 100644 classes/class_springbonecollisionsphere3d.rst create mode 100644 classes/class_springbonesimulator3d.rst create mode 100644 classes/class_subtweentweener.rst diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index bf1f9bfb704..85870389d41 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -950,6 +950,8 @@ Method Descriptions :ref:`Color` **Color8**\ (\ r8\: :ref:`int`, g8\: :ref:`int`, b8\: :ref:`int`, a8\: :ref:`int` = 255\ ) :ref:`🔗` +**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`. :: @@ -1038,6 +1040,8 @@ Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :r :ref:`Object` **dict_to_inst**\ (\ dictionary\: :ref:`Dictionary`\ ) :ref:`🔗` +**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 @@ -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 ---- diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index ab1ee76ea6b..b0004f956e4 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`\ ) | @@ -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. @@ -5767,9 +5775,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 @@ -5934,24 +5942,24 @@ Returns the :ref:`Object` that corresponds to ``instance_id``. All .. 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" } } @@ -6448,12 +6456,12 @@ 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]" @@ -6482,11 +6490,11 @@ 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. @@ -6552,17 +6560,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 +6591,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 +6616,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 +6641,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 +6668,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. @@ -6990,6 +6998,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 ---- @@ -7337,9 +7457,9 @@ 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`. @@ -7360,10 +7480,10 @@ 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`. diff --git a/classes/class_array.rst b/classes/class_array.rst index 1dd896a3070..c8be36f909f 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -35,14 +35,14 @@ 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" @@ -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] @@ -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 @@ -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 @@ -1068,7 +1068,7 @@ 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". @@ -1172,10 +1172,10 @@ If :ref:`max` is not desirable, this method may also be :: 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() @@ -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 @@ -1355,7 +1355,7 @@ 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] @@ -1448,8 +1448,8 @@ 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"] diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index a536b5e3b51..b5689c03d6e 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; @@ -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. diff --git a/classes/class_astargrid2d.rst b/classes/class_astargrid2d.rst index c7e8641207e..f7d15223135 100644 --- a/classes/class_astargrid2d.rst +++ b/classes/class_astargrid2d.rst @@ -41,8 +41,8 @@ To use **AStarGrid2D**, you only need to set the :ref:`region` | :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_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_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..c522568f60e 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_basis.rst b/classes/class_basis.rst index 2b9fe5d168e..3390226e281 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -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 @@ -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 diff --git a/classes/class_callable.rst b/classes/class_callable.rst index 7a027e9b2fc..2da3ab8b836 100644 --- a/classes/class_callable.rst +++ b/classes/class_callable.rst @@ -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,7 +46,7 @@ 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. } @@ -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. diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index 54e0b6f33e8..904a080477b 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -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``. @@ -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``. @@ -1494,7 +1496,7 @@ Returns ``true`` if the node is present in the :ref:`SceneTree` 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 diff --git a/classes/class_charfxtransform.rst b/classes/class_charfxtransform.rst index 9f5e4d814eb..2301b1a6a0d 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_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_color.rst b/classes/class_color.rst index 09fbc3e1caf..aeb4963c023 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -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| | @@ -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 ---- 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_control.rst b/classes/class_control.rst index 3f4f20b3ba4..b22b633cbfd 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -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. 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_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: @@ -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 @@ -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 @@ -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 diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst index 1a772e52267..0c3d175b536 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`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -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..9665e92adaf 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`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -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_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_cubemap.rst b/classes/class_cubemap.rst index 4232255e3af..5038c32d5bc 100644 --- a/classes/class_cubemap.rst +++ b/classes/class_cubemap.rst @@ -25,13 +25,13 @@ This resource is typically used as a uniform in custom shaders. Few core Redot m 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: -- `2×3 cubemap template (default layout option) `__\ +- `2×3 cubemap template (default layout option) `__\ -- `3×2 cubemap template `__\ +- `3×2 cubemap template `__\ -- `1×6 cubemap template `__\ +- `1×6 cubemap template `__\ -- `6×1 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_displayserver.rst b/classes/class_displayserver.rst index 6611e3d47f9..81ff35073ac 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 @@ -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 @@ -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 @@ -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,7 +1928,7 @@ 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. @@ -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,6 +1964,8 @@ 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. @@ -1926,6 +2040,8 @@ Returns an :ref:`Array` of :ref:`Rect2`, each of which 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 ---- @@ -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 @@ -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([]); @@ -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..a3774dad1bb 100644 --- a/classes/class_dtlsserver.rst +++ b/classes/class_dtlsserver.rst @@ -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); diff --git a/classes/class_editorcontextmenuplugin.rst b/classes/class_editorcontextmenuplugin.rst index f5156d6e190..bbfca558cee 100644 --- a/classes/class_editorcontextmenuplugin.rst +++ b/classes/class_editorcontextmenuplugin.rst @@ -74,6 +74,14 @@ Context menu of Scene 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: .. rst-class:: classref-enumeration-constant @@ -82,13 +90,43 @@ 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: +.. _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 @@ -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 diff --git a/classes/class_editordebuggerplugin.rst b/classes/class_editordebuggerplugin.rst index 61fae088b64..14ce833cec1 100644 --- a/classes/class_editordebuggerplugin.rst +++ b/classes/class_editordebuggerplugin.rst @@ -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 diff --git a/classes/class_editorexportplatform.rst b/classes/class_editorexportplatform.rst index 39f545d3e02..e8901d15e46 100644 --- a/classes/class_editorexportplatform.rst +++ b/classes/class_editorexportplatform.rst @@ -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| | +-----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -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..d30e2e2941a 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 @@ -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_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_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_editorimportplugin.rst b/classes/class_editorimportplugin.rst index 7ccb2b25985..b6dec80e5d0 100644 --- a/classes/class_editorimportplugin.rst +++ b/classes/class_editorimportplugin.rst @@ -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) diff --git a/classes/class_editorinspector.rst b/classes/class_editorinspector.rst index 0ae74125c56..a1ba5c5c440 100644 --- a/classes/class_editorinspector.rst +++ b/classes/class_editorinspector.rst @@ -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_editorinterface.rst b/classes/class_editorinterface.rst index 5f227c64846..f129496478d 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 @@ -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 diff --git a/classes/class_editorproperty.rst b/classes/class_editorproperty.rst index ace6bcf63c7..5c28e88104e 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`` | @@ -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 diff --git a/classes/class_editorsceneformatimporter.rst b/classes/class_editorsceneformatimporter.rst index 155cc953e82..4f25f38ac2b 100644 --- a/classes/class_editorsceneformatimporter.rst +++ b/classes/class_editorsceneformatimporter.rst @@ -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_editorscenepostimportplugin.rst b/classes/class_editorscenepostimportplugin.rst index cd8b733f50b..327453d161a 100644 --- a/classes/class_editorscenepostimportplugin.rst +++ b/classes/class_editorscenepostimportplugin.rst @@ -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 ---- diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index e64289296f5..fe1f369bfdc 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -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` | @@ -617,7 +625,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 +673,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 +1185,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 +1927,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 +2107,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 +2345,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 +3027,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 ---- @@ -3603,6 +3688,8 @@ This is equivalent to :ref:`ProjectSettings.display/window/subwindows/embed_subw \ **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,7 +4004,7 @@ 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. @@ -4511,29 +4598,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. - -- **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. +:ref:`int` **run/window_placement/game_embed_mode** :ref:`🔗` -\ **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 +4624,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 +4894,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 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_editortranslationparserplugin.rst b/classes/class_editortranslationparserplugin.rst index 0a6e48b6ff4..a3db3a133ae 100644 --- a/classes/class_editortranslationparserplugin.rst +++ b/classes/class_editortranslationparserplugin.rst @@ -69,7 +69,7 @@ Below shows an example of a custom parser that extracts strings from a CSV file public override string[] _GetRecognizedExtensions() { - return new string[] { "csv" }; + return ["csv"]; } } @@ -92,11 +92,11 @@ To add a translatable string associated with context or plural, add it to ``msgi .. 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"}); + msgidsContextPlural.Add(["Test 1", "context", "test 1 Plurals"]); // 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"}); + msgidsContextPlural.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", ""}); + msgidsContextPlural.Add(["Only with context", "a friendly context", ""]); @@ -126,7 +126,7 @@ To add a translatable string associated with context or plural, add it to ``msgi public override string[] _GetRecognizedExtensions() { - return new string[] { "gd" }; + return ["gd"]; } diff --git a/classes/class_environment.rst b/classes/class_environment.rst index 68f2bedceba..565734f7de3 100644 --- a/classes/class_environment.rst +++ b/classes/class_environment.rst @@ -453,6 +453,14 @@ Use the Academy Color Encoding System tonemapper. ACES is slightly more expensiv \ **Note:** This tonemapping operator is called "ACES Fitted" in Godot 3.x. +.. _class_Environment_constant_TONE_MAPPER_AGX: + +.. rst-class:: classref-enumeration-constant + +:ref:`ToneMapper` **TONE_MAPPER_AGX** = ``4`` + +Use the AgX tonemapper. AgX is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. AgX is less likely to darken parts of the scene compared to :ref:`TONE_MAPPER_ACES` and can match the overall scene brightness of :ref:`TONE_MAPPER_FILMIC` more closely. + .. rst-class:: classref-item-separator ---- @@ -2077,7 +2085,9 @@ The tonemapping mode to use. Tonemapping is the process that "converts" HDR valu - |void| **set_tonemap_white**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_tonemap_white**\ (\ ) -The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. Only effective if the :ref:`tonemap_mode` isn't set to :ref:`TONE_MAPPER_LINEAR`. See also :ref:`tonemap_exposure`. +The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. See also :ref:`tonemap_exposure`. + +\ **Note:** :ref:`tonemap_white` is ignored when using :ref:`TONE_MAPPER_LINEAR` or :ref:`TONE_MAPPER_AGX`. .. rst-class:: classref-item-separator diff --git a/classes/class_fileaccess.rst b/classes/class_fileaccess.rst index 3935083d922..340fd5e232f 100644 --- a/classes/class_fileaccess.rst +++ b/classes/class_fileaccess.rst @@ -742,7 +742,7 @@ Returns ``true``, if file ``hidden`` attribute is set. :ref:`int` **get_length**\ (\ ) |const| :ref:`🔗` -Returns the size of the file in bytes. +Returns the size of the file in bytes. For a pipe, returns the number of bytes available for reading from the pipe. .. rst-class:: classref-item-separator diff --git a/classes/class_filedialog.rst b/classes/class_filedialog.rst index e4d720ece58..b5f72303350 100644 --- a/classes/class_filedialog.rst +++ b/classes/class_filedialog.rst @@ -48,6 +48,8 @@ Properties +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`mode_overrides_title` | ``true`` | +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ + | :ref:`String` | ok_button_text | ``"Save"`` (overrides :ref:`AcceptDialog`) | + +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`option_count` | ``0`` | +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`root_subfolder` | ``""`` | @@ -405,9 +407,9 @@ See also :ref:`filters`, which should be used - |void| **set_filters**\ (\ value\: :ref:`PackedStringArray`\ ) - :ref:`PackedStringArray` **get_filters**\ (\ ) -The available file type filters. Each filter string in the array should be formatted like this: ``*.txt,*.doc;Text Files``. The description text of the filter is optional and can be omitted. +The available file type filters. Each filter string in the 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. Both file extensions and MIME type should be always set. -\ **Note:** For android native dialog, MIME types are used like this: ``image/*, application/pdf``. +\ **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray` for more details. diff --git a/classes/class_float.rst b/classes/class_float.rst index 34a5fbf478a..0316c0d657c 100644 --- a/classes/class_float.rst +++ b/classes/class_float.rst @@ -228,7 +228,7 @@ Multiplies each component of the :ref:`Color`, including the alpha, :: - print(1.5 * Color(0.5, 0.5, 0.5)) # Prints "(0.75, 0.75, 0.75, 1.5)" + print(1.5 * Color(0.5, 0.5, 0.5)) # Prints (0.75, 0.75, 0.75, 1.5) .. rst-class:: classref-item-separator @@ -256,7 +256,7 @@ Multiplies each component of the :ref:`Vector2` by the given **fl :: - print(2.5 * Vector2(1, 3)) # Prints "(2.5, 7.5)" + print(2.5 * Vector2(1, 3)) # Prints (2.5, 7.5) .. rst-class:: classref-item-separator diff --git a/classes/class_geometry2d.rst b/classes/class_geometry2d.rst index 46b315af6f1..3455119502e 100644 --- a/classes/class_geometry2d.rst +++ b/classes/class_geometry2d.rst @@ -500,7 +500,7 @@ The operation may result in an outer polygon (boundary) and inner polygon (hole) .. code-tab:: csharp - var polygon = new Vector2[] { new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100) }; + Vector2[] polygon = [new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100)]; var offset = new Vector2(50, 50); polygon = new Transform2D(0, offset) * polygon; GD.Print((Variant)polygon); // Prints [(50, 50), (150, 50), (150, 150), (50, 150)] diff --git a/classes/class_gltfstate.rst b/classes/class_gltfstate.rst index cfcf00690bf..cd715bf42e6 100644 --- a/classes/class_gltfstate.rst +++ b/classes/class_gltfstate.rst @@ -32,7 +32,7 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `glTF asset header schema `__ +- `glTF asset header schema `__ .. rst-class:: classref-reftable-group diff --git a/classes/class_gpuparticles2d.rst b/classes/class_gpuparticles2d.rst index 91e1df4afa8..8741fcea14d 100644 --- a/classes/class_gpuparticles2d.rst +++ b/classes/class_gpuparticles2d.rst @@ -77,6 +77,8 @@ Properties +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ | :ref:`float` | :ref:`randomness` | ``0.0`` | +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ + | :ref:`int` | :ref:`seed` | ``0`` | + +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ | :ref:`float` | :ref:`speed_scale` | ``1.0`` | +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ | :ref:`NodePath` | :ref:`sub_emitter` | ``NodePath("")`` | @@ -91,6 +93,8 @@ Properties +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ | :ref:`int` | :ref:`trail_sections` | ``8`` | +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ + | :ref:`bool` | :ref:`use_fixed_seed` | ``false`` | + +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ | :ref:`Rect2` | :ref:`visibility_rect` | ``Rect2(-100, -100, 200, 200)`` | +-------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------+ @@ -109,7 +113,9 @@ Methods +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`emit_particle`\ (\ xform\: :ref:`Transform2D`, velocity\: :ref:`Vector2`, color\: :ref:`Color`, custom\: :ref:`Color`, flags\: :ref:`int`\ ) | +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`restart`\ (\ ) | + | |void| | :ref:`request_particles_process`\ (\ process_time\: :ref:`float`\ ) | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`restart`\ (\ keep_seed\: :ref:`bool` = false\ ) | +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -517,6 +523,23 @@ Emission lifetime randomness ratio. ---- +.. _class_GPUParticles2D_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_GPUParticles2D_property_speed_scale: .. rst-class:: classref-property @@ -642,6 +665,23 @@ The number of sections to use for the particle trail rendering. Higher values ca ---- +.. _class_GPUParticles2D_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_GPUParticles2D_property_visibility_rect: .. rst-class:: classref-property @@ -708,16 +748,32 @@ The default ParticleProcessMaterial will overwrite ``color`` and use the content ---- +.. _class_GPUParticles2D_method_request_particles_process: + +.. rst-class:: classref-method + +|void| **request_particles_process**\ (\ process_time\: :ref:`float`\ ) :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_GPUParticles2D_method_restart: .. rst-class:: classref-method -|void| **restart**\ (\ ) :ref:`🔗` +|void| **restart**\ (\ keep_seed\: :ref:`bool` = false\ ) :ref:`🔗` Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the :ref:`finished` signal before calling. \ **Note:** The :ref:`finished` signal is only emitted by :ref:`one_shot` emitters. +If ``keep_seed`` is ``true``, the current random seed will be preserved. Useful for seeking and playback. + .. |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_gpuparticles3d.rst b/classes/class_gpuparticles3d.rst index 73c963a0162..80396c94ec6 100644 --- a/classes/class_gpuparticles3d.rst +++ b/classes/class_gpuparticles3d.rst @@ -87,6 +87,8 @@ Properties +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ | :ref:`float` | :ref:`randomness` | ``0.0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ + | :ref:`int` | :ref:`seed` | ``0`` | + +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ | :ref:`float` | :ref:`speed_scale` | ``1.0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ | :ref:`NodePath` | :ref:`sub_emitter` | ``NodePath("")`` | @@ -97,6 +99,8 @@ Properties +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ | :ref:`TransformAlign` | :ref:`transform_align` | ``0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ + | :ref:`bool` | :ref:`use_fixed_seed` | ``false`` | + +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ | :ref:`AABB` | :ref:`visibility_aabb` | ``AABB(-4, -4, -4, 8, 8, 8)`` | +-----------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------+ @@ -117,7 +121,9 @@ Methods +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Mesh` | :ref:`get_draw_pass_mesh`\ (\ pass\: :ref:`int`\ ) |const| | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`restart`\ (\ ) | + | |void| | :ref:`request_particles_process`\ (\ process_time\: :ref:`float`\ ) | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`restart`\ (\ keep_seed\: :ref:`bool` = false\ ) | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_draw_pass_mesh`\ (\ pass\: :ref:`int`, mesh\: :ref:`Mesh`\ ) | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -716,6 +722,23 @@ Emission randomness ratio. ---- +.. _class_GPUParticles3D_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_GPUParticles3D_property_speed_scale: .. rst-class:: classref-property @@ -809,6 +832,23 @@ The amount of time the particle's trail should represent (in seconds). Only effe ---- +.. _class_GPUParticles3D_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_GPUParticles3D_property_visibility_aabb: .. rst-class:: classref-property @@ -887,16 +927,32 @@ Returns the :ref:`Mesh` that is drawn at index ``pass``. ---- +.. _class_GPUParticles3D_method_request_particles_process: + +.. rst-class:: classref-method + +|void| **request_particles_process**\ (\ process_time\: :ref:`float`\ ) :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_GPUParticles3D_method_restart: .. rst-class:: classref-method -|void| **restart**\ (\ ) :ref:`🔗` +|void| **restart**\ (\ keep_seed\: :ref:`bool` = false\ ) :ref:`🔗` Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the :ref:`finished` signal before calling. \ **Note:** The :ref:`finished` signal is only emitted by :ref:`one_shot` emitters. +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_gpuparticlescollisionheightfield3d.rst b/classes/class_gpuparticlescollisionheightfield3d.rst index c79195f6be2..b457b02c8e2 100644 --- a/classes/class_gpuparticlescollisionheightfield3d.rst +++ b/classes/class_gpuparticlescollisionheightfield3d.rst @@ -40,6 +40,8 @@ Properties +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`bool` | :ref:`follow_camera_enabled` | ``false`` | +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+ + | :ref:`int` | :ref:`heightfield_mask` | ``1048575`` | + +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`Resolution` | :ref:`resolution` | ``2`` | +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`size` | ``Vector3(2, 2, 2)`` | @@ -47,6 +49,20 @@ Properties | :ref:`UpdateMode` | :ref:`update_mode` | ``0`` | +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+ +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`get_heightfield_mask_value`\ (\ layer_number\: :ref:`int`\ ) |const| | + +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_heightfield_mask_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | + +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + .. rst-class:: classref-section-separator ---- @@ -172,6 +188,27 @@ Following the camera has a performance cost, as it will force the heightmap to u ---- +.. _class_GPUParticlesCollisionHeightField3D_property_heightfield_mask: + +.. rst-class:: classref-property + +:ref:`int` **heightfield_mask** = ``1048575`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_heightfield_mask**\ (\ value\: :ref:`int`\ ) +- :ref:`int` **get_heightfield_mask**\ (\ ) + +The visual layers to account for when updating the heightmap. Only :ref:`MeshInstance3D`\ s whose :ref:`VisualInstance3D.layers` match with this :ref:`heightfield_mask` will be included in the heightmap collision update. By default, all 20 user-visible layers are taken into account for updating the heightmap collision. + +\ **Note:** Since the :ref:`heightfield_mask` 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:`heightfield_mask` using a script allows you to toggle those reserved layers, which can be useful for editor plugins. + +To adjust :ref:`heightfield_mask` more easily using a script, use :ref:`get_heightfield_mask_value` and :ref:`set_heightfield_mask_value`. + +.. rst-class:: classref-item-separator + +---- + .. _class_GPUParticlesCollisionHeightField3D_property_resolution: .. rst-class:: classref-property @@ -219,6 +256,35 @@ The collision heightmap's size in 3D units. To improve heightmap quality, :ref:` The update policy to use for the generated heightmap. +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_GPUParticlesCollisionHeightField3D_method_get_heightfield_mask_value: + +.. rst-class:: classref-method + +:ref:`bool` **get_heightfield_mask_value**\ (\ layer_number\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns ``true`` if the specified layer of the :ref:`heightfield_mask` is enabled, given a ``layer_number`` between ``1`` and ``20``, inclusive. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GPUParticlesCollisionHeightField3D_method_set_heightfield_mask_value: + +.. rst-class:: classref-method + +|void| **set_heightfield_mask_value**\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) :ref:`🔗` + +Based on ``value``, enables or disables the specified layer in the :ref:`heightfield_mask`, given a ``layer_number`` between ``1`` and ``20``, inclusive. + .. |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_httpclient.rst b/classes/class_httpclient.rst index 580bfcb2f8d..1ed556d1cb8 100644 --- a/classes/class_httpclient.rst +++ b/classes/class_httpclient.rst @@ -1092,7 +1092,7 @@ To create a POST request with query strings to push to the server, do: var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } }; string queryString = new HttpClient().QueryStringFromDict(fields); - string[] headers = { "Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}" }; + string[] headers = ["Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}"]; var result = new HttpClient().Request(HttpClient.Method.Post, "index.php", headers, queryString); diff --git a/classes/class_importermesh.rst b/classes/class_importermesh.rst index 21b6869a4d0..2c9f7e6dd3c 100644 --- a/classes/class_importermesh.rst +++ b/classes/class_importermesh.rst @@ -116,7 +116,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. diff --git a/classes/class_input.rst b/classes/class_input.rst index 53e880cf3e4..43cd148cbba 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -228,6 +228,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_Input_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 ---- @@ -973,7 +981,9 @@ Feeds an :ref:`InputEvent` to the game. Can be used to artific |void| **remove_joy_mapping**\ (\ guid\: :ref:`String`\ ) :ref:`🔗` -Removes all mappings from the internal database that match the given GUID. +Removes all mappings from the internal database that match the given GUID. All currently connected joypads that use this GUID will become unmapped. + +On Android, Redot will map to an internal fallback mapping. .. rst-class:: classref-item-separator diff --git a/classes/class_inputeventwithmodifiers.rst b/classes/class_inputeventwithmodifiers.rst index 6321452f72a..c9f423e6dda 100644 --- a/classes/class_inputeventwithmodifiers.rst +++ b/classes/class_inputeventwithmodifiers.rst @@ -23,6 +23,8 @@ Description Stores information about mouse, keyboard, and touch gesture input events. This includes information about which modifier keys are pressed, such as :kbd:`Shift` or :kbd:`Alt`. See :ref:`Node._input`. +\ **Note:** Modifier keys are considered modifiers only when used in combination with another key. As a result, their corresponding member variables, such as :ref:`ctrl_pressed`, will return ``false`` if the key is pressed on its own. + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_itemlist.rst b/classes/class_itemlist.rst index e657437484f..0ea9ac6ef4a 100644 --- a/classes/class_itemlist.rst +++ b/classes/class_itemlist.rst @@ -72,6 +72,8 @@ Properties +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`OverrunBehavior` | :ref:`text_overrun_behavior` | ``3`` | +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`wraparound_items` | ``true`` | + +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -96,6 +98,8 @@ Methods +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`force_update_list_size`\ (\ ) | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`HScrollBar` | :ref:`get_h_scroll_bar`\ (\ ) | + +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_at_position`\ (\ position\: :ref:`Vector2`, exact\: :ref:`bool` = false\ ) |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AutoTranslateMode` | :ref:`get_item_auto_translate_mode`\ (\ idx\: :ref:`int`\ ) |const| | @@ -639,6 +643,25 @@ Allows single or multiple item selection. See the :ref:`SelectMode` for a description of all modes. +.. rst-class:: classref-item-separator + +---- + +.. _class_ItemList_property_wraparound_items: + +.. rst-class:: classref-property + +:ref:`bool` **wraparound_items** = ``true`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_wraparound_items**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **has_wraparound_items**\ (\ ) + +If ``true``, the control will automatically move items into a new row to fit its content. See also :ref:`HFlowContainer` for this behavior. + +If ``false``, the control will add a horizontal scrollbar to make all items visible. + .. rst-class:: classref-section-separator ---- @@ -736,6 +759,20 @@ Forces an update to the list size based on its items. This happens automatically ---- +.. _class_ItemList_method_get_h_scroll_bar: + +.. rst-class:: classref-method + +:ref:`HScrollBar` **get_h_scroll_bar**\ (\ ) :ref:`🔗` + +Returns the horizontal scrollbar. + +\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible` property. + +.. rst-class:: classref-item-separator + +---- + .. _class_ItemList_method_get_item_at_position: .. rst-class:: classref-method diff --git a/classes/class_javascriptbridge.rst b/classes/class_javascriptbridge.rst index accfb8e8972..a4875ae944a 100644 --- a/classes/class_javascriptbridge.rst +++ b/classes/class_javascriptbridge.rst @@ -94,6 +94,8 @@ Method Descriptions Creates a reference to a :ref:`Callable` that can be used as a callback by JavaScript. The reference must be kept until the callback happens, or it won't be called at all. See :ref:`JavaScriptObject` for usage. +\ **Note:** The callback function must take exactly one :ref:`Array` argument, which is going to be the JavaScript `arguments object `__ converted to an array. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_javascriptobject.rst b/classes/class_javascriptobject.rst index 9a15906b414..3aa4c287f7f 100644 --- a/classes/class_javascriptobject.rst +++ b/classes/class_javascriptobject.rst @@ -30,11 +30,13 @@ JavaScriptObject is used to interact with JavaScript objects retrieved or create func _init(): var buf = JavaScriptBridge.create_object("ArrayBuffer", 10) # new ArrayBuffer(10) - print(buf) # prints [JavaScriptObject:OBJECT_ID] + print(buf) # Prints [JavaScriptObject:OBJECT_ID] var uint8arr = JavaScriptBridge.create_object("Uint8Array", buf) # new Uint8Array(buf) uint8arr[1] = 255 - prints(uint8arr[1], uint8arr.byteLength) # prints 255 10 - console.log(uint8arr) # prints in browser console "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]" + prints(uint8arr[1], uint8arr.byteLength) # Prints "255 10" + + # Prints "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]" in the browser's console. + console.log(uint8arr) # Equivalent of JavaScriptBridge: Array.from(uint8arr).forEach(myCallback) JavaScriptBridge.get_interface("Array").from(uint8arr).forEach(_my_js_callback) diff --git a/classes/class_json.rst b/classes/class_json.rst index 23c9203764d..3f25bc8855e 100644 --- a/classes/class_json.rst +++ b/classes/class_json.rst @@ -37,7 +37,7 @@ The **JSON** class enables all data types to be converted to and from a JSON str if error == OK: var data_received = json.data if typeof(data_received) == TYPE_ARRAY: - print(data_received) # Prints array + print(data_received) # Prints the array. else: print("Unexpected data") else: diff --git a/classes/class_lightmapgi.rst b/classes/class_lightmapgi.rst index 9089967d527..30cb52166c8 100644 --- a/classes/class_lightmapgi.rst +++ b/classes/class_lightmapgi.rst @@ -48,47 +48,51 @@ Properties .. table:: :widths: auto - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`float` | :ref:`bias` | ``0.0005`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`float` | :ref:`bounce_indirect_energy` | ``1.0`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`int` | :ref:`bounces` | ``3`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`CameraAttributes` | :ref:`camera_attributes` | | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`int` | :ref:`denoiser_range` | ``10`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`float` | :ref:`denoiser_strength` | ``0.1`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`bool` | :ref:`directional` | ``false`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`Color` | :ref:`environment_custom_color` | | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`float` | :ref:`environment_custom_energy` | | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`Sky` | :ref:`environment_custom_sky` | | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`EnvironmentMode` | :ref:`environment_mode` | ``1`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`GenerateProbes` | :ref:`generate_probes_subdiv` | ``2`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`bool` | :ref:`interior` | ``false`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`LightmapGIData` | :ref:`light_data` | | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`int` | :ref:`max_texture_size` | ``16384`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`BakeQuality` | :ref:`quality` | ``1`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`ShadowmaskMode` | :ref:`shadowmask_mode` | ``0`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`float` | :ref:`texel_scale` | ``1.0`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`bool` | :ref:`use_denoiser` | ``true`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ - | :ref:`bool` | :ref:`use_texture_for_bounces` | ``true`` | - +-----------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`float` | :ref:`bias` | ``0.0005`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`float` | :ref:`bounce_indirect_energy` | ``1.0`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`int` | :ref:`bounces` | ``3`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`CameraAttributes` | :ref:`camera_attributes` | | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`int` | :ref:`denoiser_range` | ``10`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`float` | :ref:`denoiser_strength` | ``0.1`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`bool` | :ref:`directional` | ``false`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`Color` | :ref:`environment_custom_color` | ``Color(1, 1, 1, 1)`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`float` | :ref:`environment_custom_energy` | ``1.0`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`Sky` | :ref:`environment_custom_sky` | | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`EnvironmentMode` | :ref:`environment_mode` | ``1`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`GenerateProbes` | :ref:`generate_probes_subdiv` | ``2`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`bool` | :ref:`interior` | ``false`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`LightmapGIData` | :ref:`light_data` | | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`int` | :ref:`max_texture_size` | ``16384`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`BakeQuality` | :ref:`quality` | ``1`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`ShadowmaskMode` | :ref:`shadowmask_mode` | ``0`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`bool` | :ref:`supersampling` | ``false`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`float` | :ref:`supersampling_factor` | ``2.0`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`float` | :ref:`texel_scale` | ``1.0`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`bool` | :ref:`use_denoiser` | ``true`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ + | :ref:`bool` | :ref:`use_texture_for_bounces` | ``true`` | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+ .. rst-class:: classref-section-separator @@ -473,7 +477,7 @@ If ``true``, bakes lightmaps to contain directional information as spherical har .. rst-class:: classref-property -:ref:`Color` **environment_custom_color** :ref:`🔗` +:ref:`Color` **environment_custom_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗` .. rst-class:: classref-property-setget @@ -490,7 +494,7 @@ The color to use for environment lighting. Only effective if :ref:`environment_m .. rst-class:: classref-property -:ref:`float` **environment_custom_energy** :ref:`🔗` +:ref:`float` **environment_custom_energy** = ``1.0`` :ref:`🔗` .. rst-class:: classref-property-setget @@ -622,7 +626,9 @@ The maximum texture size for the generated texture atlas. Higher values will res The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels. -To further speed up bake times, decrease :ref:`bounces`, disable :ref:`use_denoiser` and increase the lightmap texel size on 3D scenes in the Import dock. +To further speed up bake times, decrease :ref:`bounces`, disable :ref:`use_denoiser` and/or decrease :ref:`texel_scale`. + +To further increase quality, enable :ref:`supersampling` and/or increase :ref:`texel_scale`. .. rst-class:: classref-item-separator @@ -651,6 +657,46 @@ Shadowmasking allows :ref:`DirectionalLight3D` nodes t ---- +.. _class_LightmapGI_property_supersampling: + +.. rst-class:: classref-property + +:ref:`bool` **supersampling** = ``false`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_supersampling_enabled**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_supersampling_enabled**\ (\ ) + +If ``true``, lightmaps are baked with the texel scale multiplied with :ref:`supersampling_factor` and downsampled before saving the lightmap (so the effective texel density is identical to having supersampling disabled). + +Supersampling provides increased lightmap quality with less noise, smoother shadows and better shadowing of small-scale features in objects. However, it may result in significantly increased bake times and memory usage while baking lightmaps. Padding is automatically adjusted to avoid increasing light leaking. + +.. rst-class:: classref-item-separator + +---- + +.. _class_LightmapGI_property_supersampling_factor: + +.. rst-class:: classref-property + +:ref:`float` **supersampling_factor** = ``2.0`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_supersampling_factor**\ (\ value\: :ref:`float`\ ) +- :ref:`float` **get_supersampling_factor**\ (\ ) + +The factor by which the texel density is multiplied for supersampling. For best results, use an integer value. While fractional values are allowed, they can result in increased light leaking and a blurry lightmap. + +Higher values may result in better quality, but also increase bake times and memory usage while baking. + +See :ref:`supersampling` for more information. + +.. rst-class:: classref-item-separator + +---- + .. _class_LightmapGI_property_texel_scale: .. rst-class:: classref-property diff --git a/classes/class_lineedit.rst b/classes/class_lineedit.rst index dc8732731b6..18f2b31dd44 100644 --- a/classes/class_lineedit.rst +++ b/classes/class_lineedit.rst @@ -26,7 +26,7 @@ Description - When the **LineEdit** control is focused using the keyboard arrow keys, it will only gain focus and not enter edit mode. -- To enter edit mode, click on the control with the mouse or press the ``ui_text_submit`` action (by default :kbd:`Enter` or :kbd:`Kp Enter`). +- To enter edit mode, click on the control with the mouse, see also :ref:`keep_editing_on_text_submit`. - To exit edit mode, press ``ui_text_submit`` or ``ui_cancel`` (by default :kbd:`Escape`) actions. @@ -115,12 +115,16 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`editable` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`emoji_menu_enabled` | ``true`` | + +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`expand_to_text_length` | ``false`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`flat` | ``false`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`keep_editing_on_text_submit` | ``false`` | + +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`language` | ``""`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`max_length` | ``0`` | @@ -568,11 +572,19 @@ Inserts word joiner (WJ) character. Inserts soft hyphen (SHY) character. +.. _class_LineEdit_constant_MENU_EMOJI_AND_SYMBOL: + +.. rst-class:: classref-enumeration-constant + +:ref:`MenuItems` **MENU_EMOJI_AND_SYMBOL** = ``30`` + +Opens system emoji and symbol picker. + .. _class_LineEdit_constant_MENU_MAX: .. rst-class:: classref-enumeration-constant -:ref:`MenuItems` **MENU_MAX** = ``30`` +:ref:`MenuItems` **MENU_MAX** = ``31`` Represents the size of the :ref:`MenuItems` enum. @@ -867,6 +879,23 @@ If ``false``, existing text cannot be modified and new text cannot be added. ---- +.. _class_LineEdit_property_emoji_menu_enabled: + +.. rst-class:: classref-property + +:ref:`bool` **emoji_menu_enabled** = ``true`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_emoji_menu_enabled**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_emoji_menu_enabled**\ (\ ) + +If ``true``, "Emoji and Symbols" menu is enabled. + +.. rst-class:: classref-item-separator + +---- + .. _class_LineEdit_property_expand_to_text_length: .. rst-class:: classref-property @@ -901,6 +930,23 @@ If ``true``, the **LineEdit** doesn't display decoration. ---- +.. _class_LineEdit_property_keep_editing_on_text_submit: + +.. rst-class:: classref-property + +:ref:`bool` **keep_editing_on_text_submit** = ``false`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_keep_editing_on_text_submit**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_editing_kept_on_text_submit**\ (\ ) + +If ``true``, the **LineEdit** will not exit edit mode when text is submitted by pressing ``ui_text_submit`` action (by default: :kbd:`Enter` or :kbd:`Kp Enter`). + +.. rst-class:: classref-item-separator + +---- + .. _class_LineEdit_property_language: .. rst-class:: classref-property @@ -1291,7 +1337,7 @@ Clears the current selection. Allows entering edit mode whether the **LineEdit** is focused or not. -Use :ref:`Callable.call_deferred` if you want to enter edit mode on :ref:`text_submitted`. +See also :ref:`keep_editing_on_text_submit`. .. rst-class:: classref-item-separator diff --git a/classes/class_lookatmodifier3d.rst b/classes/class_lookatmodifier3d.rst index 6e67af65bac..8928766b7f2 100644 --- a/classes/class_lookatmodifier3d.rst +++ b/classes/class_lookatmodifier3d.rst @@ -40,7 +40,7 @@ Properties +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`EaseType` | :ref:`ease_type` | ``0`` | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+ - | :ref:`BoneAxis` | :ref:`forward_axis` | ``4`` | + | :ref:`BoneAxis` | :ref:`forward_axis` | ``4`` | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`int` | :ref:`origin_bone` | | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+ @@ -116,64 +116,6 @@ Methods Enumerations ------------ -.. _enum_LookAtModifier3D_BoneAxis: - -.. rst-class:: classref-enumeration - -enum **BoneAxis**: :ref:`🔗` - -.. _class_LookAtModifier3D_constant_BONE_AXIS_PLUS_X: - -.. rst-class:: classref-enumeration-constant - -:ref:`BoneAxis` **BONE_AXIS_PLUS_X** = ``0`` - -Enumerated value for the +X axis. - -.. _class_LookAtModifier3D_constant_BONE_AXIS_MINUS_X: - -.. rst-class:: classref-enumeration-constant - -:ref:`BoneAxis` **BONE_AXIS_MINUS_X** = ``1`` - -Enumerated value for the -X axis. - -.. _class_LookAtModifier3D_constant_BONE_AXIS_PLUS_Y: - -.. rst-class:: classref-enumeration-constant - -:ref:`BoneAxis` **BONE_AXIS_PLUS_Y** = ``2`` - -Enumerated value for the +Y axis. - -.. _class_LookAtModifier3D_constant_BONE_AXIS_MINUS_Y: - -.. rst-class:: classref-enumeration-constant - -:ref:`BoneAxis` **BONE_AXIS_MINUS_Y** = ``3`` - -Enumerated value for the -Y axis. - -.. _class_LookAtModifier3D_constant_BONE_AXIS_PLUS_Z: - -.. rst-class:: classref-enumeration-constant - -:ref:`BoneAxis` **BONE_AXIS_PLUS_Z** = ``4`` - -Enumerated value for the +Z axis. - -.. _class_LookAtModifier3D_constant_BONE_AXIS_MINUS_Z: - -.. rst-class:: classref-enumeration-constant - -:ref:`BoneAxis` **BONE_AXIS_MINUS_Z** = ``5`` - -Enumerated value for the -Z axis. - -.. rst-class:: classref-item-separator - ----- - .. _enum_LookAtModifier3D_OriginFrom: .. rst-class:: classref-enumeration @@ -295,12 +237,12 @@ The ease type of the time-based interpolation. See also :ref:`EaseType` **forward_axis** = ``4`` :ref:`🔗` +:ref:`BoneAxis` **forward_axis** = ``4`` :ref:`🔗` .. rst-class:: classref-property-setget -- |void| **set_forward_axis**\ (\ value\: :ref:`BoneAxis`\ ) -- :ref:`BoneAxis` **get_forward_axis**\ (\ ) +- |void| **set_forward_axis**\ (\ value\: :ref:`BoneAxis`\ ) +- :ref:`BoneAxis` **get_forward_axis**\ (\ ) The forward axis of the bone. This :ref:`SkeletonModifier3D` modifies the bone so that this axis points toward the :ref:`target_node`. diff --git a/classes/class_nativemenu.rst b/classes/class_nativemenu.rst index 541f0159c5b..6d352398f4a 100644 --- a/classes/class_nativemenu.rst +++ b/classes/class_nativemenu.rst @@ -785,7 +785,7 @@ Returns global menu minimum width. Returns global menu close callback. -b]Note:** This method is implemented only on macOS. +\ **Note:** This method is implemented on macOS and Windows. .. rst-class:: classref-item-separator @@ -1309,7 +1309,7 @@ Registers callable to emit when the menu is about to show. \ **Note:** The OS can simulate menu opening to track menu item changes and global shortcuts, in which case the corresponding close callback is not triggered. Use :ref:`is_opened` to check if the menu is currently opened. -\ **Note:** This method is implemented only on macOS. +\ **Note:** This method is implemented on macOS and Windows. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst index 95b90653720..b7c7809a57e 100644 --- a/classes/class_navigationpolygon.rst +++ b/classes/class_navigationpolygon.rst @@ -39,7 +39,7 @@ To bake a navigation mesh at least one outline needs to be added that defines th .. code-tab:: csharp var newNavigationMesh = new NavigationPolygon(); - var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; + Vector2[] boundingOutline = [new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0)]; newNavigationMesh.AddOutline(boundingOutline); NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new NavigationMeshSourceGeometryData2D()); GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; @@ -63,9 +63,9 @@ Adding vertices and polygon indices manually. .. code-tab:: csharp var newNavigationMesh = new NavigationPolygon(); - var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; + Vector2[] newVertices = [new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0)]; newNavigationMesh.Vertices = newVertices; - var newPolygonIndices = new int[] { 0, 1, 2, 3 }; + int[] newPolygonIndices = [0, 1, 2, 3]; newNavigationMesh.AddPolygon(newPolygonIndices); GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; diff --git a/classes/class_navigationregion2d.rst b/classes/class_navigationregion2d.rst index ef6bb0811cd..96e012465a0 100644 --- a/classes/class_navigationregion2d.rst +++ b/classes/class_navigationregion2d.rst @@ -72,23 +72,25 @@ Methods .. table:: :widths: auto - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`bake_navigation_polygon`\ (\ on_thread\: :ref:`bool` = true\ ) | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`get_navigation_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`get_navigation_map`\ (\ ) |const| | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`get_region_rid`\ (\ ) |const| | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`get_rid`\ (\ ) |const| | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_baking`\ (\ ) |const| | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_navigation_layer_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_navigation_map`\ (\ navigation_map\: :ref:`RID`\ ) | - +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`bake_navigation_polygon`\ (\ on_thread\: :ref:`bool` = true\ ) | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2` | :ref:`get_bounds`\ (\ ) |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`get_navigation_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_navigation_map`\ (\ ) |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_region_rid`\ (\ ) |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_rid`\ (\ ) |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_baking`\ (\ ) |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_navigation_layer_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_navigation_map`\ (\ navigation_map\: :ref:`RID`\ ) | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -247,6 +249,18 @@ Bakes the :ref:`NavigationPolygon`. If ``on_thread`` is ---- +.. _class_NavigationRegion2D_method_get_bounds: + +.. rst-class:: classref-method + +:ref:`Rect2` **get_bounds**\ (\ ) |const| :ref:`🔗` + +Returns the axis-aligned rectangle for the region's transformed navigation mesh. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationRegion2D_method_get_navigation_layer_value: .. rst-class:: classref-method diff --git a/classes/class_navigationregion3d.rst b/classes/class_navigationregion3d.rst index 8d31142993f..349555f88b9 100644 --- a/classes/class_navigationregion3d.rst +++ b/classes/class_navigationregion3d.rst @@ -75,6 +75,8 @@ Methods +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`bake_navigation_mesh`\ (\ on_thread\: :ref:`bool` = true\ ) | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AABB` | :ref:`get_bounds`\ (\ ) |const| | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_navigation_map`\ (\ ) |const| | @@ -247,6 +249,18 @@ Bakes the :ref:`NavigationMesh`. If ``on_thread`` is set t ---- +.. _class_NavigationRegion3D_method_get_bounds: + +.. rst-class:: classref-method + +:ref:`AABB` **get_bounds**\ (\ ) |const| :ref:`🔗` + +Returns the axis-aligned bounding box for the region's transformed navigation mesh. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationRegion3D_method_get_navigation_layer_value: .. rst-class:: classref-method diff --git a/classes/class_navigationserver2d.rst b/classes/class_navigationserver2d.rst index 088416cf317..95a03d36af9 100644 --- a/classes/class_navigationserver2d.rst +++ b/classes/class_navigationserver2d.rst @@ -199,6 +199,8 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`map_get_regions`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`map_get_use_async_iterations`\ (\ map\: :ref:`RID`\ ) |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_edge_connections`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active`\ (\ map\: :ref:`RID`\ ) |const| | @@ -211,6 +213,8 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_link_connection_radius`\ (\ map\: :ref:`RID`, radius\: :ref:`float`\ ) | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`map_set_use_async_iterations`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_use_edge_connections`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_create`\ (\ ) | @@ -253,6 +257,8 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_create`\ (\ ) | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2` | :ref:`region_get_bounds`\ (\ region\: :ref:`RID`\ ) |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`region_get_closest_point`\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector2`\ ) |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`region_get_connection_pathway_end`\ (\ region\: :ref:`RID`, connection\: :ref:`int`\ ) |const| | @@ -1226,6 +1232,18 @@ Returns all navigation regions :ref:`RID`\ s that are currently assig ---- +.. _class_NavigationServer2D_method_map_get_use_async_iterations: + +.. rst-class:: classref-method + +:ref:`bool` **map_get_use_async_iterations**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_map_get_use_edge_connections: .. rst-class:: classref-method @@ -1298,6 +1316,18 @@ Set the map's link connection radius used to connect links to navigation polygon ---- +.. _class_NavigationServer2D_method_map_set_use_async_iterations: + +.. rst-class:: classref-method + +|void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_map_set_use_edge_connections: .. rst-class:: classref-method @@ -1554,6 +1584,18 @@ Creates a new region. ---- +.. _class_NavigationServer2D_method_region_get_bounds: + +.. rst-class:: classref-method + +:ref:`Rect2` **region_get_bounds**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns the axis-aligned rectangle for the ``region``'s transformed navigation mesh. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_region_get_closest_point: .. rst-class:: classref-method diff --git a/classes/class_navigationserver3d.rst b/classes/class_navigationserver3d.rst index c719cc9c143..8fa10e2aa34 100644 --- a/classes/class_navigationserver3d.rst +++ b/classes/class_navigationserver3d.rst @@ -219,6 +219,8 @@ Methods +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_up`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`map_get_use_async_iterations`\ (\ map\: :ref:`RID`\ ) |const| | + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_edge_connections`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active`\ (\ map\: :ref:`RID`\ ) |const| | @@ -237,6 +239,8 @@ Methods +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_up`\ (\ map\: :ref:`RID`, up\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`map_set_use_async_iterations`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_use_edge_connections`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_create`\ (\ ) | @@ -289,6 +293,8 @@ Methods +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AABB` | :ref:`region_get_bounds`\ (\ region\: :ref:`RID`\ ) |const| | + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_closest_point`\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_closest_point_normal`\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | @@ -1501,6 +1507,18 @@ Returns the map's up direction. ---- +.. _class_NavigationServer3D_method_map_get_use_async_iterations: + +.. rst-class:: classref-method + +:ref:`bool` **map_get_use_async_iterations**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_map_get_use_edge_connections: .. rst-class:: classref-method @@ -1609,6 +1627,18 @@ Sets the map up direction. ---- +.. _class_NavigationServer3D_method_map_set_use_async_iterations: + +.. rst-class:: classref-method + +|void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_map_set_use_edge_connections: .. rst-class:: classref-method @@ -1927,6 +1957,18 @@ Creates a new region. ---- +.. _class_NavigationServer3D_method_region_get_bounds: + +.. rst-class:: classref-method + +:ref:`AABB` **region_get_bounds**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns the axis-aligned bounding box for the ``region``'s transformed navigation mesh. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_region_get_closest_point: .. rst-class:: classref-method diff --git a/classes/class_node3d.rst b/classes/class_node3d.rst index 3074a2b496d..102a144ec00 100644 --- a/classes/class_node3d.rst +++ b/classes/class_node3d.rst @@ -12,7 +12,7 @@ Node3D **Inherits:** :ref:`Node` **<** :ref:`Object` -**Inherited By:** :ref:`AudioListener3D`, :ref:`AudioStreamPlayer3D`, :ref:`BoneAttachment3D`, :ref:`Camera3D`, :ref:`CollisionObject3D`, :ref:`CollisionPolygon3D`, :ref:`CollisionShape3D`, :ref:`GridMap`, :ref:`ImporterMeshInstance3D`, :ref:`Joint3D`, :ref:`LightmapProbe`, :ref:`Marker3D`, :ref:`NavigationLink3D`, :ref:`NavigationObstacle3D`, :ref:`NavigationRegion3D`, :ref:`OpenXRCompositionLayer`, :ref:`OpenXRHand`, :ref:`Path3D`, :ref:`PathFollow3D`, :ref:`RayCast3D`, :ref:`RemoteTransform3D`, :ref:`ShapeCast3D`, :ref:`Skeleton3D`, :ref:`SkeletonModifier3D`, :ref:`SpringArm3D`, :ref:`VehicleWheel3D`, :ref:`VisualInstance3D`, :ref:`XRFaceModifier3D`, :ref:`XRNode3D`, :ref:`XROrigin3D` +**Inherited By:** :ref:`AudioListener3D`, :ref:`AudioStreamPlayer3D`, :ref:`BoneAttachment3D`, :ref:`Camera3D`, :ref:`CollisionObject3D`, :ref:`CollisionPolygon3D`, :ref:`CollisionShape3D`, :ref:`GridMap`, :ref:`ImporterMeshInstance3D`, :ref:`Joint3D`, :ref:`LightmapProbe`, :ref:`Marker3D`, :ref:`NavigationLink3D`, :ref:`NavigationObstacle3D`, :ref:`NavigationRegion3D`, :ref:`OpenXRCompositionLayer`, :ref:`OpenXRHand`, :ref:`Path3D`, :ref:`PathFollow3D`, :ref:`RayCast3D`, :ref:`RemoteTransform3D`, :ref:`ShapeCast3D`, :ref:`Skeleton3D`, :ref:`SkeletonModifier3D`, :ref:`SpringArm3D`, :ref:`SpringBoneCollision3D`, :ref:`VehicleWheel3D`, :ref:`VisualInstance3D`, :ref:`XRFaceModifier3D`, :ref:`XRNode3D`, :ref:`XROrigin3D` Most basic 3D game object, parent of all 3D-related nodes. @@ -784,6 +784,10 @@ Returns whether the node notifies about its global and local transformation chan 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. +Visibility is checked only in parent nodes that inherit from **Node3D**. If the parent is of any other type (such as :ref:`Node`, :ref:`AnimationPlayer`, or :ref:`Node2D`), it is assumed to be visible. + +\ **Note:** This method does not take :ref:`VisualInstance3D.layers` into account, so even if this method returns ``true``, the node might end up not being rendered. + .. rst-class:: classref-item-separator ---- @@ -798,7 +802,9 @@ Rotates the node so that the local forward axis (-Z, :ref:`Vector3.FORWARD`, and shouldn't be colinear to avoid unintended rotation around local Z axis. Operations take place in global space, which means that the node must be in the scene tree. diff --git a/classes/class_nodepath.rst b/classes/class_nodepath.rst index 50c74fcbf98..5b447bae0bf 100644 --- a/classes/class_nodepath.rst +++ b/classes/class_nodepath.rst @@ -230,7 +230,7 @@ Returns a copy of this node path with a colon character (``:``) prefixed, transf // propertyPath points to the "position" in the "x" axis of this node. NodePath propertyPath = nodePath.GetAsPropertyPath(); - GD.Print(propertyPath); // Prints ":position:x". + GD.Print(propertyPath); // Prints ":position:x" @@ -264,12 +264,12 @@ Returns all property subnames concatenated with a colon character (``:``) as a s .. code-tab:: gdscript var node_path = ^"Sprite2D:texture:resource_name" - print(node_path.get_concatenated_subnames()) # Prints "texture:resource_name". + print(node_path.get_concatenated_subnames()) # Prints "texture:resource_name" .. code-tab:: csharp var nodePath = new NodePath("Sprite2D:texture:resource_name"); - GD.Print(nodePath.GetConcatenatedSubnames()); // Prints "texture:resource_name". + GD.Print(nodePath.GetConcatenatedSubnames()); // Prints "texture:resource_name" @@ -291,16 +291,16 @@ Returns the node name indicated by ``idx``, starting from 0. If ``idx`` is out o .. code-tab:: gdscript var sprite_path = NodePath("../RigidBody2D/Sprite2D") - print(sprite_path.get_name(0)) # Prints "..". - print(sprite_path.get_name(1)) # Prints "RigidBody2D". - print(sprite_path.get_name(2)) # Prints "Sprite". + print(sprite_path.get_name(0)) # Prints ".." + print(sprite_path.get_name(1)) # Prints "RigidBody2D" + print(sprite_path.get_name(2)) # Prints "Sprite" .. code-tab:: csharp var spritePath = new NodePath("../RigidBody2D/Sprite2D"); - GD.Print(spritePath.GetName(0)); // Prints "..". - GD.Print(spritePath.GetName(1)); // Prints "PathFollow2D". - GD.Print(spritePath.GetName(2)); // Prints "Sprite". + GD.Print(spritePath.GetName(0)); // Prints ".." + GD.Print(spritePath.GetName(1)); // Prints "PathFollow2D" + GD.Print(spritePath.GetName(2)); // Prints "Sprite" @@ -336,14 +336,14 @@ Returns the property name indicated by ``idx``, starting from 0. If ``idx`` is o .. code-tab:: gdscript var path_to_name = NodePath("Sprite2D:texture:resource_name") - print(path_to_name.get_subname(0)) # Prints "texture". - print(path_to_name.get_subname(1)) # Prints "resource_name". + print(path_to_name.get_subname(0)) # Prints "texture" + print(path_to_name.get_subname(1)) # Prints "resource_name" .. code-tab:: csharp var pathToName = new NodePath("Sprite2D:texture:resource_name"); - GD.Print(pathToName.GetSubname(0)); // Prints "texture". - GD.Print(pathToName.GetSubname(1)); // Prints "resource_name". + GD.Print(pathToName.GetSubname(0)); // Prints "texture" + GD.Print(pathToName.GetSubname(1)); // Prints "resource_name" diff --git a/classes/class_object.rst b/classes/class_object.rst index 06b961a7a61..db4db10c08f 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -355,14 +355,14 @@ Combined with :ref:`_set` and :ref:`_get_prope public override Godot.Collections.Array _GetPropertyList() { - return new Godot.Collections.Array() - { + return + [ new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, - { "type", (int)Variant.Type.Int } - } - }; + { "type", (int)Variant.Type.Int }, + }, + ]; } @@ -445,11 +445,11 @@ The example below displays a list of numbers shown as words going from ``ZERO`` } } - private Godot.Collections.Array _numbers = new(); + private Godot.Collections.Array _numbers = []; public override Godot.Collections.Array _GetPropertyList() { - var properties = new Godot.Collections.Array(); + Godot.Collections.Array properties = []; for (int i = 0; i < _numberCount; i++) { @@ -690,14 +690,14 @@ Combined with :ref:`_get` and :ref:`_get_prope public override Godot.Collections.Array _GetPropertyList() { - return new Godot.Collections.Array() - { + return + [ new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, - { "type", (int)Variant.Type.Int } - } - }; + { "type", (int)Variant.Type.Int }, + }, + ]; } @@ -810,19 +810,19 @@ Adds a user-defined signal named ``signal``. Optional arguments for the signal c .. code-tab:: csharp - AddUserSignal("Hurt", new Godot.Collections.Array() - { + AddUserSignal("Hurt", + [ new Godot.Collections.Dictionary() { { "name", "damage" }, - { "type", (int)Variant.Type.Int } + { "type", (int)Variant.Type.Int }, }, new Godot.Collections.Dictionary() { { "name", "source" }, - { "type", (int)Variant.Type.Object } - } - }); + { "type", (int)Variant.Type.Object }, + }, + ]); @@ -924,7 +924,7 @@ Calls the ``method`` on the object and returns the result. Unlike :ref:`call`\[:ref:`StringName`\] **get_meta_list**\ (\ ) |const| :ref:`🔗` -Returns the object's metadata entry names as a :ref:`PackedStringArray`. +Returns the object's metadata entry names as an :ref:`Array` of :ref:`StringName`\ s. .. rst-class:: classref-item-separator diff --git a/classes/class_openxrapiextension.rst b/classes/class_openxrapiextension.rst index 2dd8adb4c24..a6da22b6875 100644 --- a/classes/class_openxrapiextension.rst +++ b/classes/class_openxrapiextension.rst @@ -50,6 +50,8 @@ Methods .. table:: :widths: auto + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`action_get_handle`\ (\ action\: :ref:`RID`\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`begin_debug_label_region`\ (\ label_name\: :ref:`String`\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -57,6 +59,8 @@ Methods +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`end_debug_label_region`\ (\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`find_action`\ (\ name\: :ref:`String`, action_set\: :ref:`RID`\ ) | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_error_string`\ (\ result\: :ref:`int`\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_hand_tracker`\ (\ hand_index\: :ref:`int`\ ) | @@ -71,6 +75,8 @@ Methods +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_predicted_display_time`\ (\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_projection_layer`\ (\ ) | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_render_state_z_far`\ (\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_render_state_z_near`\ (\ ) | @@ -113,6 +119,8 @@ Methods +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_object_name`\ (\ object_type\: :ref:`int`, object_handle\: :ref:`int`, object_name\: :ref:`String`\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_render_region`\ (\ render_region\: :ref:`Rect2i`\ ) | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_velocity_depth_texture`\ (\ render_target\: :ref:`RID`\ ) | +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_velocity_target_size`\ (\ target_size\: :ref:`Vector2i`\ ) | @@ -176,6 +184,18 @@ Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND` **action_get_handle**\ (\ action\: :ref:`RID`\ ) :ref:`🔗` + +Returns the corresponding ``XrAction`` OpenXR handle for the given action RID. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_begin_debug_label_region: .. rst-class:: classref-method @@ -212,6 +232,18 @@ Marks the end of a debug label region. Removes the latest debug label region add ---- +.. _class_OpenXRAPIExtension_method_find_action: + +.. rst-class:: classref-method + +:ref:`RID` **find_action**\ (\ name\: :ref:`String`, action_set\: :ref:`RID`\ ) :ref:`🔗` + +Returns the :ref:`RID` corresponding to an ``Action`` of a matching name, optionally limited to a specified action set. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_get_error_string: .. rst-class:: classref-method @@ -298,6 +330,20 @@ Returns the predicted display timing for the current frame. ---- +.. _class_OpenXRAPIExtension_method_get_projection_layer: + +.. rst-class:: classref-method + +:ref:`int` **get_projection_layer**\ (\ ) :ref:`🔗` + +Returns a pointer to the render state's ``XrCompositionLayerProjection`` struct. + +\ **Note:** This method should only be called from the rendering thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_get_render_state_z_far: .. rst-class:: classref-method @@ -554,6 +600,18 @@ Set the object name of an OpenXR object, used for debug output. ``object_type`` ---- +.. _class_OpenXRAPIExtension_method_set_render_region: + +.. rst-class:: classref-method + +|void| **set_render_region**\ (\ render_region\: :ref:`Rect2i`\ ) :ref:`🔗` + +Sets the render region to ``render_region``, overriding the normal render target's rect. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_set_velocity_depth_texture: .. rst-class:: classref-method diff --git a/classes/class_os.rst b/classes/class_os.rst index beae9441787..60d333b5a81 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -527,7 +527,7 @@ If the process is successfully created, this method returns its process ID, whic .. code-tab:: csharp - var pid = OS.CreateProcess(OS.GetExecutablePath(), new string[] {}); + var pid = OS.CreateProcess(OS.GetExecutablePath(), []); @@ -601,8 +601,8 @@ For example, to retrieve a list of the working directory's contents: .. code-tab:: csharp - var output = new Godot.Collections.Array(); - int exitCode = OS.Execute("ls", new string[] {"-l", "/tmp"}, output); + Godot.Collections.Array output = []; + int exitCode = OS.Execute("ls", ["-l", "/tmp"], output); @@ -618,8 +618,8 @@ If you wish to access a shell built-in or execute a composite command, a platfor .. code-tab:: csharp - var output = new Godot.Collections.Array(); - OS.Execute("CMD.exe", new string[] {"/C", "cd %TEMP% && dir"}, output); + Godot.Collections.Array output = []; + OS.Execute("CMD.exe", ["/C", "cd %TEMP% && dir"], output); @@ -1717,9 +1717,17 @@ Reads a user input as a UTF-8 encoded string from the standard input. This opera :ref:`bool` **request_permission**\ (\ name\: :ref:`String`\ ) :ref:`🔗` -Requests permission from the OS for the given ``name``. Returns ``true`` if the permission has been successfully granted. +Requests permission from the OS for the given ``name``. Returns ``true`` if the permission has already been granted. See also :ref:`MainLoop.on_request_permissions_result`. -\ **Note:** This method is currently only implemented on Android, to specifically request permission for ``"RECORD_AUDIO"`` by ``AudioDriverOpenSL``. +The ``name`` must be the full permission name. For example: + +- ``OS.request_permission("android.permission.READ_EXTERNAL_STORAGE")``\ + +- ``OS.request_permission("android.permission.POST_NOTIFICATIONS")``\ + +\ **Note:** Permission must be checked during export. + +\ **Note:** This method is only implemented on Android. .. rst-class:: classref-item-separator @@ -1731,7 +1739,9 @@ Requests permission from the OS for the given ``name``. Returns ``true`` if the :ref:`bool` **request_permissions**\ (\ ) :ref:`🔗` -Requests *dangerous* permissions from the OS. Returns ``true`` if permissions have been successfully granted. +Requests *dangerous* permissions from the OS. Returns ``true`` if permissions have already been granted. See also :ref:`MainLoop.on_request_permissions_result`. + +\ **Note:** Permissions must be checked during export. \ **Note:** This method is only implemented on Android. Normal permissions are automatically granted at install time in Android applications. @@ -1817,7 +1827,9 @@ This can useful when files may be opened by other applications, such as antiviru Requests the OS to open a resource identified by ``uri`` with the most appropriate program. For example: -- ``OS.shell_open("C:\\Users\name\Downloads")`` on Windows opens the file explorer at the user's Downloads folder. +- ``OS.shell_open("C:\\Users\\name\\Downloads")`` on Windows opens the file explorer at the user's Downloads folder. + +- ``OS.shell_open("C:/Users/name/Downloads")`` also works on Windows and opens the file explorer at the user's Downloads folder. - ``OS.shell_open("https://www.redotengine.org")`` opens the default web browser on the official Redot website. diff --git a/classes/class_packedbytearray.rst b/classes/class_packedbytearray.rst index 6b00f0ddd7d..ede4b7b6b26 100644 --- a/classes/class_packedbytearray.rst +++ b/classes/class_packedbytearray.rst @@ -789,12 +789,12 @@ Returns a hexadecimal representation of this array as a :ref:`String`. diff --git a/classes/class_packeddatacontainerref.rst b/classes/class_packeddatacontainerref.rst index 6ab49d84ad5..a867e7a5b5a 100644 --- a/classes/class_packeddatacontainerref.rst +++ b/classes/class_packeddatacontainerref.rst @@ -24,7 +24,7 @@ When packing nested containers using :ref:`PackedDataContainer` **to_byte_array**\ (\ ) |const| :ref:`🔗` -Returns a :ref:`PackedByteArray` with each string encoded as bytes. +Returns a :ref:`PackedByteArray` with each string encoded as UTF-8. Strings are ``null`` terminated. .. rst-class:: classref-section-separator diff --git a/classes/class_particleprocessmaterial.rst b/classes/class_particleprocessmaterial.rst index 7a23ef9653e..925b8b889b3 100644 --- a/classes/class_particleprocessmaterial.rst +++ b/classes/class_particleprocessmaterial.rst @@ -184,6 +184,8 @@ Properties +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`int` | :ref:`sub_emitter_amount_at_end` | | +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`int` | :ref:`sub_emitter_amount_at_start` | | + +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`sub_emitter_frequency` | | +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`bool` | :ref:`sub_emitter_keep_velocity` | ``false`` | @@ -257,6 +259,25 @@ Methods .. rst-class:: classref-descriptions-group +Signals +------- + +.. _class_ParticleProcessMaterial_signal_emission_shape_changed: + +.. rst-class:: classref-signal + +**emission_shape_changed**\ (\ ) :ref:`🔗` + +Emitted when this material's emission shape is changed in any way. This includes changes to :ref:`emission_shape`, :ref:`emission_shape_scale`, or :ref:`emission_sphere_radius`, and any other property that affects the emission shape's offset, size, scale, or orientation. + +\ **Note:** This signal is only emitted inside the editor for performance reasons. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + Enumerations ------------ @@ -604,11 +625,23 @@ enum **SubEmitterMode**: :ref:`🔗 +.. _class_ParticleProcessMaterial_constant_SUB_EMITTER_AT_START: + +.. rst-class:: classref-enumeration-constant + +:ref:`SubEmitterMode` **SUB_EMITTER_AT_START** = ``4`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + .. _class_ParticleProcessMaterial_constant_SUB_EMITTER_MAX: .. rst-class:: classref-enumeration-constant -:ref:`SubEmitterMode` **SUB_EMITTER_MAX** = ``4`` +:ref:`SubEmitterMode` **SUB_EMITTER_MAX** = ``5`` Represents the size of the :ref:`SubEmitterMode` enum. @@ -2026,6 +2059,25 @@ The amount of particles to spawn from the subemitter node when the particle expi ---- +.. _class_ParticleProcessMaterial_property_sub_emitter_amount_at_start: + +.. rst-class:: classref-property + +:ref:`int` **sub_emitter_amount_at_start** :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_sub_emitter_amount_at_start**\ (\ value\: :ref:`int`\ ) +- :ref:`int` **get_sub_emitter_amount_at_start**\ (\ ) + +The amount of particles to spawn from the subemitter node when the particle spawns. + +\ **Note:** This value shouldn't exceed :ref:`GPUParticles2D.amount` or :ref:`GPUParticles3D.amount` defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. + +.. rst-class:: classref-item-separator + +---- + .. _class_ParticleProcessMaterial_property_sub_emitter_frequency: .. rst-class:: classref-property diff --git a/classes/class_physicsdirectspacestate2d.rst b/classes/class_physicsdirectspacestate2d.rst index cdda19ce69c..d0312b4de9c 100644 --- a/classes/class_physicsdirectspacestate2d.rst +++ b/classes/class_physicsdirectspacestate2d.rst @@ -107,7 +107,7 @@ Checks the intersections of a shape, given through a :ref:`PhysicsShapeQueryPara \ ``linear_velocity``: The colliding object's velocity :ref:`Vector2`. If the object is an :ref:`Area2D`, the result is ``(0, 0)``. -\ ``normal``: The object's surface normal at the intersection point. +\ ``normal``: The collision normal of the query shape at the intersection point, pointing away from the intersecting object. \ ``point``: The intersection point. diff --git a/classes/class_physicsdirectspacestate3d.rst b/classes/class_physicsdirectspacestate3d.rst index b27b8e9d6b7..765c9bd1488 100644 --- a/classes/class_physicsdirectspacestate3d.rst +++ b/classes/class_physicsdirectspacestate3d.rst @@ -107,7 +107,7 @@ Checks the intersections of a shape, given through a :ref:`PhysicsShapeQueryPara \ ``linear_velocity``: The colliding object's velocity :ref:`Vector3`. If the object is an :ref:`Area3D`, the result is ``(0, 0, 0)``. -\ ``normal``: The object's surface normal at the intersection point. +\ ``normal``: The collision normal of the query shape at the intersection point, pointing away from the intersecting object. \ ``point``: The intersection point. diff --git a/classes/class_polygonpathfinder.rst b/classes/class_polygonpathfinder.rst index 3c775831fcb..3a6520fa34d 100644 --- a/classes/class_polygonpathfinder.rst +++ b/classes/class_polygonpathfinder.rst @@ -144,13 +144,13 @@ Returns ``true`` if ``point`` falls inside the polygon area. .. code-tab:: csharp var polygonPathFinder = new PolygonPathFinder(); - var points = new Vector2[] - { + Vector2[] points = + [ new Vector2(0.0f, 0.0f), new Vector2(1.0f, 0.0f), new Vector2(0.0f, 1.0f) - }; - var connections = new int[] { 0, 1, 1, 2, 2, 0 }; + ]; + int[] connections = [0, 1, 1, 2, 2, 0]; polygonPathFinder.Setup(points, connections); GD.Print(polygonPathFinder.IsPointInside(new Vector2(0.2f, 0.2f))); // Prints True GD.Print(polygonPathFinder.IsPointInside(new Vector2(1.0f, 1.0f))); // Prints False @@ -198,13 +198,13 @@ The length of ``connections`` must be even, returns an error if odd. .. code-tab:: csharp var polygonPathFinder = new PolygonPathFinder(); - var points = new Vector2[] - { + Vector2[] points = + [ new Vector2(0.0f, 0.0f), new Vector2(1.0f, 0.0f), new Vector2(0.0f, 1.0f) - }; - var connections = new int[] { 0, 1, 1, 2, 2, 0 }; + ]; + int[] connections = [0, 1, 1, 2, 2, 0]; polygonPathFinder.Setup(points, connections); diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index d532ad6e8a2..8d524f457af 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -37,23 +37,27 @@ Properties .. table:: :widths: auto - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`allow_search` | ``true`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`hide_on_checkable_item_selection` | ``true`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`hide_on_item_selection` | ``true`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`hide_on_state_item_selection` | ``false`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`item_count` | ``0`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`prefer_native_menu` | ``false`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`submenu_popup_delay` | ``0.3`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`SystemMenus` | :ref:`system_menu_id` | ``0`` | - +-------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------+ + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`allow_search` | ``true`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`hide_on_checkable_item_selection` | ``true`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`hide_on_item_selection` | ``true`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`hide_on_state_item_selection` | ``false`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`item_count` | ``0`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`prefer_native_menu` | ``false`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`submenu_popup_delay` | ``0.3`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`SystemMenus` | :ref:`system_menu_id` | ``0`` | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | transparent | ``true`` (overrides :ref:`Window`) | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`bool` | transparent_bg | ``true`` (overrides :ref:`Viewport`) | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group diff --git a/classes/class_popuppanel.rst b/classes/class_popuppanel.rst index 21235dae8c8..2ac325e7d52 100644 --- a/classes/class_popuppanel.rst +++ b/classes/class_popuppanel.rst @@ -23,6 +23,20 @@ A popup with a configurable panel background. Any child controls added to this n .. rst-class:: classref-reftable-group +Properties +---------- + +.. table:: + :widths: auto + + +-------------------------+----------------+------------------------------------------------------------------------------+ + | :ref:`bool` | transparent | ``true`` (overrides :ref:`Window`) | + +-------------------------+----------------+------------------------------------------------------------------------------+ + | :ref:`bool` | transparent_bg | ``true`` (overrides :ref:`Viewport`) | + +-------------------------+----------------+------------------------------------------------------------------------------+ + +.. rst-class:: classref-reftable-group + Theme Properties ---------------- diff --git a/classes/class_projection.rst b/classes/class_projection.rst index 6ef13a0bbc3..ff6f30c80f6 100644 --- a/classes/class_projection.rst +++ b/classes/class_projection.rst @@ -546,6 +546,8 @@ Returns the horizontal field of view of the projection (in degrees). Returns the vertical field of view of the projection (in degrees) associated with the given horizontal field of view (in degrees) and aspect ratio. +\ **Note:** Unlike most methods of **Projection**, ``aspect`` is expected to be 1 divided by the X:Y aspect ratio. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 3956dcd92d6..1bf14c6db19 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -229,7 +229,7 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/redundant_static_unload` | ``1`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`debug/gdscript/warnings/renamed_in_godot_4_hint` | ``1`` | + | :ref:`bool` | :ref:`debug/gdscript/warnings/renamed_in_godot_4_hint` | ``true`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/return_value_discarded` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ @@ -1211,6 +1211,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`navigation/pathfinding/max_threads` | ``4`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`navigation/world/map_use_async_iterations` | ``true`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`network/limits/debugger/max_chars_per_second` | ``32768`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`network/limits/debugger/max_errors_per_second` | ``400`` | @@ -1485,7 +1487,7 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/global_illumination/voxel_gi/quality` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`rendering/lightmapping/bake_performance/max_rays_per_pass` | ``32`` | + | :ref:`int` | :ref:`rendering/lightmapping/bake_performance/max_rays_per_pass` | ``4`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/lightmapping/bake_performance/max_rays_per_probe_pass` | ``64`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ @@ -1647,6 +1649,10 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/scaling_3d/mode` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rendering/scaling_3d/mode.ios` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rendering/scaling_3d/mode.macos` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/scaling_3d/scale` | ``1.0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/shader_compiler/shader_cache/compress` | ``true`` | @@ -2358,7 +2364,11 @@ If ``true``, microphone input will be allowed. This requires appropriate permiss :ref:`int` **audio/driver/mix_rate** = ``44100`` :ref:`🔗` -The mixing rate used for audio (in Hz). In general, it's better to not touch this and leave it to the host operating system. +Target mixing rate used for audio (in Hz). In general, it's better to not touch this and leave it to the host operating system. + +\ **Note:** On iOS and macOS, mixing rate is determined by audio driver, this value is ignored. + +\ **Note:** Input and output mixing rates might be different. Use :ref:`AudioServer.get_mix_rate` and :ref:`AudioServer.get_input_mix_rate` to get actual values. .. rst-class:: classref-item-separator @@ -3006,7 +3016,7 @@ When set to ``warn`` or ``error``, produces a warning or an error respectively w .. rst-class:: classref-property -:ref:`bool` **debug/gdscript/warnings/renamed_in_godot_4_hint** = ``1`` :ref:`🔗` +:ref:`bool` **debug/gdscript/warnings/renamed_in_godot_4_hint** = ``true`` :ref:`🔗` When enabled, using a property, enum, or function that was renamed since Godot 3 will produce a hint if an error occurs. @@ -4272,6 +4282,8 @@ Main window initial screen, this setting is used only if :ref:`display/window/si Main window mode. See :ref:`WindowMode` for possible values and how each mode behaves. +\ **Note:** Game embedding is available only in the "Windowed" mode. + .. rst-class:: classref-item-separator ---- @@ -6382,6 +6394,8 @@ If ``true``, the magnetometer sensor is enabled and :ref:`Input.get_magnetometer The locale to fall back to if a translation isn't available in a given language. If left empty, ``en`` (English) will be used. +\ **Note:** Not to be confused with :ref:`TextServerFallback`. + .. rst-class:: classref-item-separator ---- @@ -6396,7 +6410,7 @@ If ``true``, text server break iteration rule sets, dictionaries and other optio \ **Note:** "ICU / HarfBuzz / Graphite" text server data includes dictionaries for Burmese, Chinese, Japanese, Khmer, Lao and Thai as well as Unicode Standard Annex #29 and Unicode Standard Annex #14 word and line breaking rules. Data is about 4 MB large. -\ **Note:** "Fallback" text server does not use additional data. +\ **Note:** :ref:`TextServerFallback` does not use additional data. .. rst-class:: classref-item-separator @@ -6408,7 +6422,9 @@ If ``true``, text server break iteration rule sets, dictionaries and other optio :ref:`String` **internationalization/locale/test** = ``""`` :ref:`🔗` -If non-empty, this locale will be used when running the project from the editor. +If non-empty, this locale will be used instead of the automatically detected system locale. + +\ **Note:** This setting also applies to the exported project. To only affect testing within the editor, override this setting with an ``editor`` :doc:`feature tag <../tutorials/export/feature_tags>` for localization testing purposes. .. rst-class:: classref-item-separator @@ -6570,7 +6586,7 @@ Root node default layout direction. Specifies the :ref:`TextServer` to use. If left empty, the default will be used. -"ICU / HarfBuzz / Graphite" is the most advanced text driver, supporting right-to-left typesetting and complex scripts (for languages like Arabic, Hebrew, etc.). The "Fallback" text driver does not support right-to-left typesetting and complex scripts. +"ICU / HarfBuzz / Graphite" (:ref:`TextServerAdvanced`) is the most advanced text driver, supporting right-to-left typesetting and complex scripts (for languages like Arabic, Hebrew, etc.). The "Fallback" text driver (:ref:`TextServerFallback`) does not support right-to-left typesetting and complex scripts. \ **Note:** The driver in use can be overridden at runtime via the ``--text-driver`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. @@ -9196,6 +9212,18 @@ Maximum number of threads that can run pathfinding queries simultaneously on the ---- +.. _class_ProjectSettings_property_navigation/world/map_use_async_iterations: + +.. rst-class:: classref-property + +:ref:`bool` **navigation/world/map_use_async_iterations** = ``true`` :ref:`🔗` + +If enabled, navigation map synchronization uses an async process that runs on a background thread. This avoids stalling the main thread but adds an additional delay to any navigation map change. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_network/limits/debugger/max_chars_per_second: .. rst-class:: classref-property @@ -9400,9 +9428,13 @@ During each physics tick, Redot will multiply the linear velocity of RigidBodies Sets which physics engine to use for 2D physics. -"DEFAULT" and "GodotPhysics2D" are the same, as there is currently no alternative 2D physics server implemented. +\ **DEFAULT** is currently equivalent to **GodotPhysics2D**, but may change in future releases. Select an explicit implementation if you want to ensure that your project stays on the same engine. + +\ **GodotPhysics2D** is Redot's internal 2D physics engine. + +\ **Dummy** is a 2D physics server that does nothing and returns only dummy values, effectively disabling all 2D physics functionality. -"Dummy" is a 2D physics server that does nothing and returns only dummy values, effectively disabling all 2D physics functionality. +Third-party extensions and modules can add other physics engines to select with this setting. .. rst-class:: classref-item-separator @@ -9638,9 +9670,15 @@ During each physics tick, Redot will multiply the linear velocity of RigidBodies Sets which physics engine to use for 3D physics. -"DEFAULT" and "GodotPhysics3D" are the same, as there is currently no alternative 3D physics server implemented. +\ **DEFAULT** is currently equivalent to **GodotPhysics3D**, but may change in future releases. Select an explicit implementation if you want to ensure that your project stays on the same engine. -"Dummy" is a 3D physics server that does nothing and returns only dummy values, effectively disabling all 3D physics functionality. +\ **GodotPhysics3D** is Redot's internal 3D physics engine. + +\ **Jolt Physics** is an alternative physics engine that is generally faster and more reliable than **GodotPhysics3D**. As it was recently implemented, it is currently considered experimental and its behavior may change in future releases. + +\ **Dummy** is a 3D physics server that does nothing and returns only dummy values, effectively disabling all 3D physics functionality. + +Third-party extensions and modules can add other physics engines to select with this setting. .. rst-class:: classref-item-separator @@ -9654,6 +9692,8 @@ Sets which physics engine to use for 3D physics. If ``true``, the 3D physics server runs on a separate thread, making better use of multi-core CPUs. If ``false``, the 3D physics server runs on the main thread. Running the physics server on a separate thread can increase performance, but restricts API access to only physics process. +\ **Note:** When :ref:`physics/3d/physics_engine` is set to ``Jolt Physics``, enabling this setting will prevent the 3D physics server from being able to provide any context when reporting errors and warnings, and will instead always refer to nodes as ````. + .. rst-class:: classref-item-separator ---- @@ -10150,6 +10190,8 @@ If ``true``, enables the body pair contact cache, which removes the need for pot The minimum velocity needed before a collision can be bouncy, in meters per second. +\ **Note:** This setting will only be read once during the lifetime of the application. + .. rst-class:: classref-item-separator ---- @@ -11122,10 +11164,12 @@ The VoxelGI quality to use. High quality leads to more precise lighting and bett .. rst-class:: classref-property -:ref:`int` **rendering/lightmapping/bake_performance/max_rays_per_pass** = ``32`` :ref:`🔗` +:ref:`int` **rendering/lightmapping/bake_performance/max_rays_per_pass** = ``4`` :ref:`🔗` The maximum number of rays that can be thrown per pass when baking lightmaps with :ref:`LightmapGI`. Depending on the scene, adjusting this value may result in higher GPU utilization when baking lightmaps, leading to faster bake times. +\ **Note:** Using a value that is too high for your system can cause crashes due to the GPU being unresponsive for long periods of time, and the graphics driver being reset by the OS. + .. rst-class:: classref-item-separator ---- @@ -11138,6 +11182,8 @@ The maximum number of rays that can be thrown per pass when baking lightmaps wit The maximum number of rays that can be thrown per pass when baking dynamic object lighting in :ref:`LightmapProbe`\ s with :ref:`LightmapGI`. Depending on the scene, adjusting this value may result in higher GPU utilization when baking lightmaps, leading to faster bake times. +\ **Note:** Using a value that is too high for your system can cause crashes due to the GPU being unresponsive for long periods of time, and the graphics driver being reset by the OS. + .. rst-class:: classref-item-separator ---- @@ -11150,6 +11196,8 @@ The maximum number of rays that can be thrown per pass when baking dynamic objec The maximum number of retry rays that can be thrown per pass when hitting a transparent surface when baking lightmaps with :ref:`LightmapGI`. Depending on the scene, reducing this value may lead to faster bake times. +\ **Note:** Using a value that is too high for your system can cause crashes due to the GPU being unresponsive for long periods of time, and the graphics driver being reset by the OS. + .. rst-class:: classref-item-separator ---- @@ -11160,7 +11208,9 @@ The maximum number of retry rays that can be thrown per pass when hitting a tran :ref:`int` **rendering/lightmapping/bake_performance/region_size** = ``512`` :ref:`🔗` -The region size to use when baking lightmaps with :ref:`LightmapGI`. +The region size to use when baking lightmaps with :ref:`LightmapGI`. The specified value is rounded up to the nearest power of 2. + +\ **Note:** Using a value that is too high for your system can cause crashes due to the GPU being unresponsive for long periods of time, and the graphics driver being reset by the OS. .. rst-class:: classref-item-separator @@ -12012,7 +12062,7 @@ If ``true``, the forward renderer will fall back to Direct3D 12 if Vulkan is not :ref:`bool` **rendering/rendering_device/fallback_to_opengl3** = ``true`` :ref:`🔗` -If ``true``, the forward renderer will fall back to OpenGL 3 if both Direct3D 12, Metal and Vulkan are not supported. +If ``true``, the forward renderer will fall back to OpenGL 3 if Direct3D 12, Metal, and Vulkan are not supported. \ **Note:** This setting is implemented only on Windows, Android, macOS, iOS, and Linux/X11. @@ -12026,9 +12076,9 @@ If ``true``, the forward renderer will fall back to OpenGL 3 if both Direct3D 12 :ref:`bool` **rendering/rendering_device/fallback_to_vulkan** = ``true`` :ref:`🔗` -If ``true``, the forward renderer will fall back to Vulkan if Direct3D 12 is not supported. +If ``true``, the forward renderer will fall back to Vulkan if Direct3D 12 (on Windows) or Metal (on macOS x86_64) are not supported. -\ **Note:** This setting is implemented only on Windows. +\ **Note:** This setting is implemented only on Windows and macOS. .. rst-class:: classref-item-separator @@ -12202,6 +12252,30 @@ Sets the scaling 3D mode. Bilinear scaling renders at different resolution to ei ---- +.. _class_ProjectSettings_property_rendering/scaling_3d/mode.ios: + +.. rst-class:: classref-property + +:ref:`int` **rendering/scaling_3d/mode.ios** :ref:`🔗` + +iOS override for :ref:`rendering/scaling_3d/mode`. This allows selecting the MetalFX spatial and MetalFX temporal scaling modes, which are exclusive to platforms where the Metal rendering driver is used. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_rendering/scaling_3d/mode.macos: + +.. rst-class:: classref-property + +:ref:`int` **rendering/scaling_3d/mode.macos** :ref:`🔗` + +macOS override for :ref:`rendering/scaling_3d/mode`. This allows selecting the MetalFX spatial and MetalFX temporal scaling modes, which are exclusive to platforms where the Metal rendering driver is used. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_rendering/scaling_3d/scale: .. rst-class:: classref-property @@ -13066,6 +13140,8 @@ Loads the contents of the .pck or .zip file specified by ``pack`` into the resou \ **Note:** The optional ``offset`` parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. +\ **Note:** :ref:`DirAccess` will not show changes made to the contents of ``res://`` after calling this function. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_randomnumbergenerator.rst b/classes/class_randomnumbergenerator.rst index 40216203fbf..d0ab4012b47 100644 --- a/classes/class_randomnumbergenerator.rst +++ b/classes/class_randomnumbergenerator.rst @@ -134,7 +134,7 @@ The current state of the random number generator. Save and restore this property var saved_state = rng.state # Store current state. print(rng.randf()) # Advance internal state. rng.state = saved_state # Restore the state. - print(rng.randf()) # Prints the same value as in previous. + print(rng.randf()) # Prints the same value as previously. \ **Note:** Do not set state to arbitrary values, since the random number generator requires the state to have certain qualities to behave properly. It should only be set to values that came from the state property itself. To initialize the random number generator with arbitrary input, use :ref:`seed` instead. diff --git a/classes/class_raycast3d.rst b/classes/class_raycast3d.rst index d45593adc2b..385f4352d7a 100644 --- a/classes/class_raycast3d.rst +++ b/classes/class_raycast3d.rst @@ -12,14 +12,14 @@ RayCast3D **Inherits:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` -A ray in 3D space, used to find the first :ref:`CollisionObject3D` it intersects. +A ray in 3D space, used to find the first object it intersects. .. rst-class:: classref-introduction-group Description ----------- -A raycast represents a ray from its origin to its :ref:`target_position` that finds the closest :ref:`CollisionObject3D` along its path, if it intersects any. +A raycast represents a ray from its origin to its :ref:`target_position` that finds the closest object along its path, if it intersects any. \ **RayCast3D** can ignore some objects by adding them to an exception list, by making its detection reporting ignore :ref:`Area3D`\ s (:ref:`collide_with_areas`) or :ref:`PhysicsBody3D`\ s (:ref:`collide_with_bodies`), or by configuring physics layers. @@ -350,6 +350,8 @@ Updates the collision information for the ray immediately, without waiting for t Returns the first object that the ray intersects, or ``null`` if no object is intersecting the ray (i.e. :ref:`is_colliding` returns ``false``). +\ **Note:** This object is not guaranteed to be a :ref:`CollisionObject3D`. For example, if the ray intersects a :ref:`CSGShape3D` or a :ref:`GridMap`, the method will return a :ref:`CSGShape3D` or :ref:`GridMap` instance. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_renderingdevice.rst b/classes/class_renderingdevice.rst index aff80c7a38e..919dcfd95ac 100644 --- a/classes/class_renderingdevice.rst +++ b/classes/class_renderingdevice.rst @@ -55,6 +55,8 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`buffer_get_data_async`\ (\ buffer\: :ref:`RID`, callback\: :ref:`Callable`, offset_bytes\: :ref:`int` = 0, size_bytes\: :ref:`int` = 0\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`buffer_get_device_address`\ (\ buffer\: :ref:`RID`\ ) | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`buffer_update`\ (\ buffer\: :ref:`RID`, offset\: :ref:`int`, size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`capture_timestamp`\ (\ name\: :ref:`String`\ ) | @@ -187,9 +189,11 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_tracked_object_type_count`\ (\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_feature`\ (\ feature\: :ref:`Features`\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`index_array_create`\ (\ index_buffer\: :ref:`RID`, index_offset\: :ref:`int`, index_count\: :ref:`int`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`index_buffer_create`\ (\ size_indices\: :ref:`int`, format\: :ref:`IndexBufferFormat`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_restart_indices\: :ref:`bool` = false\ ) | + | :ref:`RID` | :ref:`index_buffer_create`\ (\ size_indices\: :ref:`int`, format\: :ref:`IndexBufferFormat`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_restart_indices\: :ref:`bool` = false, enable_device_address\: :ref:`bool` = false\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`limit_get`\ (\ limit\: :ref:`Limit`\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -263,7 +267,7 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`texture_update`\ (\ texture\: :ref:`RID`, layer\: :ref:`int`, data\: :ref:`PackedByteArray`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`uniform_buffer_create`\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray()\ ) | + | :ref:`RID` | :ref:`uniform_buffer_create`\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray(), enable_device_address\: :ref:`bool` = false\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`uniform_set_create`\ (\ uniforms\: :ref:`Array`\[:ref:`RDUniform`\], shader\: :ref:`RID`, shader_set\: :ref:`int`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -271,7 +275,7 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`vertex_array_create`\ (\ vertex_count\: :ref:`int`, vertex_format\: :ref:`int`, src_buffers\: :ref:`Array`\[:ref:`RID`\], offsets\: :ref:`PackedInt64Array` = PackedInt64Array()\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`vertex_buffer_create`\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_as_storage\: :ref:`bool` = false\ ) | + | :ref:`RID` | :ref:`vertex_buffer_create`\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_as_storage\: :ref:`bool` = false, enable_device_address\: :ref:`bool` = false\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`vertex_format_create`\ (\ vertex_descriptions\: :ref:`Array`\[:ref:`RDVertexAttribute`\]\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2999,6 +3003,14 @@ flags **StorageBufferUsage**: :ref:`🔗` **STORAGE_BUFFER_USAGE_DEVICE_ADDRESS** = ``2`` + +Allows usage of :ref:`buffer_get_device_address` on supported GPUs. + .. rst-class:: classref-item-separator ---- @@ -4219,6 +4231,24 @@ Floating-point specialization constant. ---- +.. _enum_RenderingDevice_Features: + +.. rst-class:: classref-enumeration + +enum **Features**: :ref:`🔗` + +.. _class_RenderingDevice_constant_SUPPORTS_BUFFER_DEVICE_ADDRESS: + +.. rst-class:: classref-enumeration-constant + +:ref:`Features` **SUPPORTS_BUFFER_DEVICE_ADDRESS** = ``6`` + +Features support for buffer device address extension. + +.. rst-class:: classref-item-separator + +---- + .. _enum_RenderingDevice_Limit: .. rst-class:: classref-enumeration @@ -4521,6 +4551,26 @@ Maximum viewport width (in pixels). Maximum viewport height (in pixels). +.. _class_RenderingDevice_constant_LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE: + +.. rst-class:: classref-enumeration-constant + +:ref:`Limit` **LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE** = ``46`` + +Returns the smallest value for :ref:`ProjectSettings.rendering/scaling_3d/scale` when using the MetalFX temporal upscaler. + +\ **Note:** The returned value is multiplied by a factor of ``1000000`` to preserve 6 digits of precision. It must be divided by ``1000000.0`` to convert the value to a floating point number. + +.. _class_RenderingDevice_constant_LIMIT_METALFX_TEMPORAL_SCALER_MAX_SCALE: + +.. rst-class:: classref-enumeration-constant + +:ref:`Limit` **LIMIT_METALFX_TEMPORAL_SCALER_MAX_SCALE** = ``47`` + +Returns the largest value for :ref:`ProjectSettings.rendering/scaling_3d/scale` when using the MetalFX temporal upscaler. + +\ **Note:** The returned value is multiplied by a factor of ``1000000`` to preserve 6 digits of precision. It must be divided by ``1000000.0`` to convert the value to a floating point number. + .. rst-class:: classref-item-separator ---- @@ -5076,6 +5126,20 @@ Asynchronous version of :ref:`buffer_get_data` **buffer_get_device_address**\ (\ buffer\: :ref:`RID`\ ) :ref:`🔗` + +Returns the address of the given ``buffer`` which can be passed to shaders in any way to access underlying data. Buffer must have been created with this feature enabled. + +\ **Note:** You must check that the GPU supports this functionality by calling :ref:`has_feature` with :ref:`SUPPORTS_BUFFER_DEVICE_ADDRESS` as a parameter. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_buffer_update: .. rst-class:: classref-method @@ -6015,6 +6079,18 @@ This is only used by Vulkan in debug builds. Redot must also be started with the ---- +.. _class_RenderingDevice_method_has_feature: + +.. rst-class:: classref-method + +:ref:`bool` **has_feature**\ (\ feature\: :ref:`Features`\ ) |const| :ref:`🔗` + +Returns ``true`` if the ``feature`` is supported by the GPU. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_index_array_create: .. rst-class:: classref-method @@ -6033,12 +6109,14 @@ Once finished with your RID, you will want to free the RID using the RenderingDe .. rst-class:: classref-method -:ref:`RID` **index_buffer_create**\ (\ size_indices\: :ref:`int`, format\: :ref:`IndexBufferFormat`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_restart_indices\: :ref:`bool` = false\ ) :ref:`🔗` +:ref:`RID` **index_buffer_create**\ (\ size_indices\: :ref:`int`, format\: :ref:`IndexBufferFormat`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_restart_indices\: :ref:`bool` = false, enable_device_address\: :ref:`bool` = false\ ) :ref:`🔗` Creates a new index buffer. It can be accessed with the RID that is returned. Once finished with your RID, you will want to free the RID using the RenderingDevice's :ref:`free_rid` method. +Optionally, set ``enable_device_address`` if you wish to use :ref:`buffer_get_device_address` functionality and the GPU supports it. + .. rst-class:: classref-item-separator ---- @@ -6580,12 +6658,14 @@ Updates texture data with new data, replacing the previous data in place. The up .. rst-class:: classref-method -:ref:`RID` **uniform_buffer_create**\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray()\ ) :ref:`🔗` +:ref:`RID` **uniform_buffer_create**\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray(), enable_device_address\: :ref:`bool` = false\ ) :ref:`🔗` Creates a new uniform buffer. It can be accessed with the RID that is returned. Once finished with your RID, you will want to free the RID using the RenderingDevice's :ref:`free_rid` method. +Optionally, set ``enable_device_address`` if you wish to use :ref:`buffer_get_device_address` functionality and the GPU supports it. + .. rst-class:: classref-item-separator ---- @@ -6632,12 +6712,14 @@ Creates a vertex array based on the specified buffers. Optionally, ``offsets`` ( .. rst-class:: classref-method -:ref:`RID` **vertex_buffer_create**\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_as_storage\: :ref:`bool` = false\ ) :ref:`🔗` +:ref:`RID` **vertex_buffer_create**\ (\ size_bytes\: :ref:`int`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_as_storage\: :ref:`bool` = false, enable_device_address\: :ref:`bool` = false\ ) :ref:`🔗` It can be accessed with the RID that is returned. Once finished with your RID, you will want to free the RID using the RenderingDevice's :ref:`free_rid` method. +Optionally, set ``enable_device_address`` if you wish to use :ref:`buffer_get_device_address` functionality and the GPU supports it. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_renderingserver.rst b/classes/class_renderingserver.rst index ab797535bd2..55a7512ebab 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -349,7 +349,7 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`environment_set_adjustment`\ (\ env\: :ref:`RID`, enable\: :ref:`bool`, brightness\: :ref:`float`, contrast\: :ref:`float`, saturation\: :ref:`float`, use_1d_color_correction\: :ref:`bool`, color_correction\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`environment_set_ambient_light`\ (\ env\: :ref:`RID`, color\: :ref:`Color`, ambient\: :ref:`EnvironmentAmbientSource` = 0, energy\: :ref:`float` = 1.0, sky_contibution\: :ref:`float` = 0.0, reflection_source\: :ref:`EnvironmentReflectionSource` = 0\ ) | + | |void| | :ref:`environment_set_ambient_light`\ (\ env\: :ref:`RID`, color\: :ref:`Color`, ambient\: :ref:`EnvironmentAmbientSource` = 0, energy\: :ref:`float` = 1.0, sky_contribution\: :ref:`float` = 0.0, reflection_source\: :ref:`EnvironmentReflectionSource` = 0\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`environment_set_background`\ (\ env\: :ref:`RID`, bg\: :ref:`EnvironmentBG`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -651,7 +651,7 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`mesh_surface_update_vertex_region`\ (\ mesh\: :ref:`RID`, surface\: :ref:`int`, offset\: :ref:`int`, data\: :ref:`PackedByteArray`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`multimesh_allocate_data`\ (\ multimesh\: :ref:`RID`, instances\: :ref:`int`, transform_format\: :ref:`MultimeshTransformFormat`, color_format\: :ref:`bool` = false, custom_data_format\: :ref:`bool` = false\ ) | + | |void| | :ref:`multimesh_allocate_data`\ (\ multimesh\: :ref:`RID`, instances\: :ref:`int`, transform_format\: :ref:`MultimeshTransformFormat`, color_format\: :ref:`bool` = false, custom_data_format\: :ref:`bool` = false, use_indirect\: :ref:`bool` = false\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`multimesh_create`\ (\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -661,6 +661,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`multimesh_get_buffer_rd_rid`\ (\ multimesh\: :ref:`RID`\ ) |const| | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`multimesh_get_command_buffer_rd_rid`\ (\ multimesh\: :ref:`RID`\ ) |const| | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`multimesh_get_custom_aabb`\ (\ multimesh\: :ref:`RID`\ ) |const| | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`multimesh_get_instance_count`\ (\ multimesh\: :ref:`RID`\ ) |const| | @@ -725,6 +727,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`particles_collision_set_field_texture`\ (\ particles_collision\: :ref:`RID`, texture\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`particles_collision_set_height_field_mask`\ (\ particles_collision\: :ref:`RID`, mask\: :ref:`int`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`particles_collision_set_height_field_resolution`\ (\ particles_collision\: :ref:`RID`, resolution\: :ref:`ParticlesCollisionHeightfieldResolution`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`particles_collision_set_sphere_radius`\ (\ particles_collision\: :ref:`RID`, radius\: :ref:`float`\ ) | @@ -741,6 +745,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`particles_request_process`\ (\ particles\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`particles_request_process_time`\ (\ particles\: :ref:`RID`, time\: :ref:`float`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`particles_restart`\ (\ particles\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`particles_set_amount`\ (\ particles\: :ref:`RID`, amount\: :ref:`int`\ ) | @@ -1634,11 +1640,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_BLEND_SHAPE_MASK** = ``7`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Mask of mesh channels permitted in blend shapes. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM_BASE: @@ -1646,11 +1648,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM_BASE** = ``13`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Shift of first custom channel. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM_BITS: @@ -1658,11 +1656,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM_BITS** = ``3`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Number of format bits per custom channel. See :ref:`ArrayCustomFormat`. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM0_SHIFT: @@ -1670,11 +1664,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM0_SHIFT** = ``13`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Amount to shift :ref:`ArrayCustomFormat` for custom channel index 0. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM1_SHIFT: @@ -1682,11 +1672,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM1_SHIFT** = ``16`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Amount to shift :ref:`ArrayCustomFormat` for custom channel index 1. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM2_SHIFT: @@ -1694,11 +1680,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM2_SHIFT** = ``19`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Amount to shift :ref:`ArrayCustomFormat` for custom channel index 2. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM3_SHIFT: @@ -1706,11 +1688,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM3_SHIFT** = ``22`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Amount to shift :ref:`ArrayCustomFormat` for custom channel index 3. .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM_MASK: @@ -1718,11 +1696,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM_MASK** = ``7`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See :ref:`ArrayCustomFormat`. .. _class_RenderingServer_constant_ARRAY_COMPRESS_FLAGS_BASE: @@ -1730,11 +1704,7 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_COMPRESS_FLAGS_BASE** = ``25`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Shift of first compress flag. Compress flags should be passed to :ref:`ArrayMesh.add_surface_from_arrays` and :ref:`SurfaceTool.commit`. .. _class_RenderingServer_constant_ARRAY_FLAG_USE_2D_VERTICES: @@ -1750,11 +1720,7 @@ Flag used to mark that the array contains 2D vertices. :ref:`ArrayFormat` **ARRAY_FLAG_USE_DYNAMIC_UPDATE** = ``67108864`` -.. container:: contribute - - There is currently no description for this enum. Please help us by :ref:`contributing one `! - - +Flag indices that the mesh data will use ``GL_DYNAMIC_DRAW`` on GLES. Unused on Vulkan. .. _class_RenderingServer_constant_ARRAY_FLAG_USE_8_BONE_WEIGHTS: @@ -3038,11 +3004,31 @@ Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`Viewport.scaling_3d_scale`. Values less than ``1.0`` will be result in the viewport being upscaled using FSR2. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` will use FSR2 at native resolution as a TAA solution. +.. _class_RenderingServer_constant_VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`ViewportScaling3DMode` **VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL** = ``3`` + +Use MetalFX spatial upscaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`Viewport.scaling_3d_scale`. Values less than ``1.0`` will be result in the viewport being upscaled using MetalFX. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` disables scaling. + +\ **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS. + +.. _class_RenderingServer_constant_VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`ViewportScaling3DMode` **VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL** = ``4`` + +Use MetalFX temporal upscaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`Viewport.scaling_3d_scale`. Values less than ``1.0`` will be result in the viewport being upscaled using MetalFX. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` will use MetalFX at native resolution as a TAA solution. + +\ **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS. + .. _class_RenderingServer_constant_VIEWPORT_SCALING_3D_MODE_MAX: .. rst-class:: classref-enumeration-constant -:ref:`ViewportScaling3DMode` **VIEWPORT_SCALING_3D_MODE_MAX** = ``3`` +:ref:`ViewportScaling3DMode` **VIEWPORT_SCALING_3D_MODE_MAX** = ``5`` Represents the size of the :ref:`ViewportScaling3DMode` enum. @@ -4260,6 +4246,14 @@ Use the Academy Color Encoding System tonemapper. ACES is slightly more expensiv \ **Note:** This tonemapping operator is called "ACES Fitted" in Redot 3.x. +.. _class_RenderingServer_constant_ENV_TONE_MAPPER_AGX: + +.. rst-class:: classref-enumeration-constant + +:ref:`EnvironmentToneMapper` **ENV_TONE_MAPPER_AGX** = ``4`` + +Use the AgX tonemapper. AgX is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. AgX is less likely to darken parts of the scene compared to :ref:`ENV_TONE_MAPPER_ACES`, and can match :ref:`ENV_TONE_MAPPER_FILMIC` more closely. + .. rst-class:: classref-item-separator ---- @@ -7870,7 +7864,7 @@ Sets the values to be used with the "adjustments" post-process effect. See :ref: .. rst-class:: classref-method -|void| **environment_set_ambient_light**\ (\ env\: :ref:`RID`, color\: :ref:`Color`, ambient\: :ref:`EnvironmentAmbientSource` = 0, energy\: :ref:`float` = 1.0, sky_contibution\: :ref:`float` = 0.0, reflection_source\: :ref:`EnvironmentReflectionSource` = 0\ ) :ref:`🔗` +|void| **environment_set_ambient_light**\ (\ env\: :ref:`RID`, color\: :ref:`Color`, ambient\: :ref:`EnvironmentAmbientSource` = 0, energy\: :ref:`float` = 1.0, sky_contribution\: :ref:`float` = 0.0, reflection_source\: :ref:`EnvironmentReflectionSource` = 0\ ) :ref:`🔗` Sets the values to be used for ambient light rendering. See :ref:`Environment` for more details. @@ -9812,7 +9806,7 @@ Sets a mesh's surface's material. .. rst-class:: classref-method -|void| **multimesh_allocate_data**\ (\ multimesh\: :ref:`RID`, instances\: :ref:`int`, transform_format\: :ref:`MultimeshTransformFormat`, color_format\: :ref:`bool` = false, custom_data_format\: :ref:`bool` = false\ ) :ref:`🔗` +|void| **multimesh_allocate_data**\ (\ multimesh\: :ref:`RID`, instances\: :ref:`int`, transform_format\: :ref:`MultimeshTransformFormat`, color_format\: :ref:`bool` = false, custom_data_format\: :ref:`bool` = false, use_indirect\: :ref:`bool` = false\ ) :ref:`🔗` .. container:: contribute @@ -9878,6 +9872,37 @@ Returns the :ref:`RenderingDevice` :ref:`RID` ---- +.. _class_RenderingServer_method_multimesh_get_command_buffer_rd_rid: + +.. rst-class:: classref-method + +:ref:`RID` **multimesh_get_command_buffer_rd_rid**\ (\ multimesh\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns the :ref:`RenderingDevice` :ref:`RID` handle of the :ref:`MultiMesh` command buffer. This :ref:`RID` is only valid if ``use_indirect`` is set to ``true`` when allocating data through :ref:`multimesh_allocate_data`. It can be used to directly modify the instance count via buffer. + +The data structure is dependent on both how many surfaces the mesh contains and whether it is indexed or not, the buffer has 5 integers in it, with the last unused if the mesh is not indexed. + +Each of the values in the buffer correspond to these options: + +.. code:: text + + Indexed: + 0 - indexCount; + 1 - instanceCount; + 2 - firstIndex; + 3 - vertexOffset; + 4 - firstInstance; + Non Indexed: + 0 - vertexCount; + 1 - instanceCount; + 2 - firstVertex; + 3 - firstInstance; + 4 - unused; + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_multimesh_get_custom_aabb: .. rst-class:: classref-method @@ -10301,6 +10326,18 @@ Sets the signed distance field ``texture`` for the 3D GPU particles collision sp ---- +.. _class_RenderingServer_method_particles_collision_set_height_field_mask: + +.. rst-class:: classref-method + +|void| **particles_collision_set_height_field_mask**\ (\ particles_collision\: :ref:`RID`, mask\: :ref:`int`\ ) :ref:`🔗` + +Sets the heightfield ``mask`` for the 3D GPU particles heightfield collision specified by the ``particles_collision`` RID. Equivalent to :ref:`GPUParticlesCollisionHeightField3D.heightfield_mask`. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_particles_collision_set_height_field_resolution: .. rst-class:: classref-method @@ -10405,6 +10442,18 @@ Add particle system to list of particle systems that need to be updated. Update ---- +.. _class_RenderingServer_method_particles_request_process_time: + +.. rst-class:: classref-method + +|void| **particles_request_process_time**\ (\ particles\: :ref:`RID`, time\: :ref:`float`\ ) :ref:`🔗` + +Requests particles to process for extra process time during a single frame. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_particles_restart: .. rst-class:: classref-method @@ -11759,16 +11808,14 @@ Copies the viewport to a region of the screen specified by ``rect``. If :ref:`vi For example, you can set the root viewport to not render at all with the following code: -FIXME: The method seems to be non-existent. - .. tabs:: .. code-tab:: gdscript func _ready(): - get_viewport().set_attach_to_screen_rect(Rect2()) - $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) + RenderingServer.viewport_attach_to_screen(get_viewport().get_viewport_rid(), Rect2()) + RenderingServer.viewport_attach_to_screen($Viewport.get_viewport_rid(), Rect2(0, 0, 600, 600)) @@ -12434,7 +12481,7 @@ Creates a new 3D visibility notifier object and adds it to the RenderingServer. Once finished with your RID, you will want to free the RID using the RenderingServer's :ref:`free_rid` method. -To place in a scene, attach this mesh to an instance using :ref:`instance_set_base` using the returned RID. +To place in a scene, attach this notifier to an instance using :ref:`instance_set_base` using the returned RID. \ **Note:** The equivalent node is :ref:`VisibleOnScreenNotifier3D`. diff --git a/classes/class_resourceimporterlayeredtexture.rst b/classes/class_resourceimporterlayeredtexture.rst index d249e751df2..3fad04a2d84 100644 --- a/classes/class_resourceimporterlayeredtexture.rst +++ b/classes/class_resourceimporterlayeredtexture.rst @@ -75,7 +75,7 @@ Controls how color channels should be used in the imported texture. \ **Optimized:**, allows the RG color format to be used if the texture does not use the blue channel. This reduces memory usage if the texture's blue channel can be discarded (all pixels must have a blue value of ``0``). -\ **Normal Map (RG Channels):** This forces all layers from the texture to be imported with the RG color format to reduce memory usage, with only the red and green channels preserved. This only has an effect on textures with the VRAM Compressed or Basis Universal compression modes. This mode is only available in layered textures (:ref:`Cubemap`, :ref:`CubemapArray`, :ref:`Texture2DArray` and :ref:`Texture3D`). +\ **Normal Map (RG Channels):** This forces all layers from the texture to be imported with the RG color format, with only the red and green channels preserved. RGTC (Red-Green Texture Compression) compression is able to preserve its detail much better, while using the same amount of memory as a standard RGBA VRAM-compressed texture. This only has an effect on textures with the VRAM Compressed or Basis Universal compression modes. This mode is only available in layered textures (:ref:`Cubemap`, :ref:`CubemapArray`, :ref:`Texture2DArray` and :ref:`Texture3D`). .. rst-class:: classref-item-separator diff --git a/classes/class_resourceimporteroggvorbis.rst b/classes/class_resourceimporteroggvorbis.rst index 2142542c04f..a86d594f793 100644 --- a/classes/class_resourceimporteroggvorbis.rst +++ b/classes/class_resourceimporteroggvorbis.rst @@ -60,11 +60,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 @@ -156,9 +156,11 @@ 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:`🔗` -This method loads audio data from a PackedByteArray buffer into an AudioStreamOggVorbis object. +**Deprecated:** Use :ref:`AudioStreamOggVorbis.load_from_buffer` instead. + +Creates a new :ref:`AudioStreamOggVorbis` instance from the given buffer. The buffer must contain Ogg Vorbis data. .. rst-class:: classref-item-separator @@ -170,7 +172,9 @@ This method loads audio data from a PackedByteArray buffer into an AudioStreamOg :ref:`AudioStreamOggVorbis` **load_from_file**\ (\ path\: :ref:`String`\ ) |static| :ref:`🔗` -This method loads audio data from a file into an AudioStreamOggVorbis object. The file path is provided as a string. +**Deprecated:** Use :ref:`AudioStreamOggVorbis.load_from_file` instead. + +Creates a new :ref:`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_resourceloader.rst b/classes/class_resourceloader.rst index d7df34c24d3..7f8fcc5956e 100644 --- a/classes/class_resourceloader.rst +++ b/classes/class_resourceloader.rst @@ -234,9 +234,9 @@ Returns the dependencies for the resource at the given ``path``. :: - for dep in ResourceLoader.get_dependencies(path): - print(dep.get_slice("::", 0)) # Prints UID. - print(dep.get_slice("::", 2)) # Prints path. + for dependency in ResourceLoader.get_dependencies(path): + print(dependency.get_slice("::", 0)) # Prints the UID. + print(dependency.get_slice("::", 2)) # Prints the path. .. rst-class:: classref-item-separator diff --git a/classes/class_retargetmodifier3d.rst b/classes/class_retargetmodifier3d.rst index 5895cdf8a30..cef986ff9dd 100644 --- a/classes/class_retargetmodifier3d.rst +++ b/classes/class_retargetmodifier3d.rst @@ -33,17 +33,82 @@ Properties .. table:: :widths: auto - +-----------------------------------------------+-----------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`position_enabled` | ``true`` | - +-----------------------------------------------+-----------------------------------------------------------------------------+-----------+ - | :ref:`SkeletonProfile` | :ref:`profile` | | - +-----------------------------------------------+-----------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`rotation_enabled` | ``true`` | - +-----------------------------------------------+-----------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`scale_enabled` | ``true`` | - +-----------------------------------------------+-----------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`use_global_pose` | ``false`` | - +-----------------------------------------------+-----------------------------------------------------------------------------+-----------+ + +---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+ + | |bitfield|\[:ref:`TransformFlag`\] | :ref:`enable` | ``7`` | + +---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+ + | :ref:`SkeletonProfile` | :ref:`profile` | | + +---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`use_global_pose` | ``false`` | + +---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+ + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_position_enabled`\ (\ ) |const| | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_rotation_enabled`\ (\ ) |const| | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_scale_enabled`\ (\ ) |const| | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_position_enabled`\ (\ enabled\: :ref:`bool`\ ) | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_rotation_enabled`\ (\ enabled\: :ref:`bool`\ ) | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_scale_enabled`\ (\ enabled\: :ref:`bool`\ ) | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Enumerations +------------ + +.. _enum_RetargetModifier3D_TransformFlag: + +.. rst-class:: classref-enumeration + +flags **TransformFlag**: :ref:`🔗` + +.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_POSITION: + +.. rst-class:: classref-enumeration-constant + +:ref:`TransformFlag` **TRANSFORM_FLAG_POSITION** = ``1`` + +If set, allows to retarget the position. + +.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_ROTATION: + +.. rst-class:: classref-enumeration-constant + +:ref:`TransformFlag` **TRANSFORM_FLAG_ROTATION** = ``2`` + +If set, allows to retarget the rotation. + +.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_SCALE: + +.. rst-class:: classref-enumeration-constant + +:ref:`TransformFlag` **TRANSFORM_FLAG_SCALE** = ``4`` + +If set, allows to retarget the scale. + +.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_ALL: + +.. rst-class:: classref-enumeration-constant + +:ref:`TransformFlag` **TRANSFORM_FLAG_ALL** = ``7`` + +If set, allows to retarget the position/rotation/scale. .. rst-class:: classref-section-separator @@ -54,18 +119,18 @@ Properties Property Descriptions --------------------- -.. _class_RetargetModifier3D_property_position_enabled: +.. _class_RetargetModifier3D_property_enable: .. rst-class:: classref-property -:ref:`bool` **position_enabled** = ``true`` :ref:`🔗` +|bitfield|\[:ref:`TransformFlag`\] **enable** = ``7`` :ref:`🔗` .. rst-class:: classref-property-setget -- |void| **set_position_enabled**\ (\ value\: :ref:`bool`\ ) -- :ref:`bool` **is_position_enabled**\ (\ ) +- |void| **set_enable_flags**\ (\ value\: |bitfield|\[:ref:`TransformFlag`\]\ ) +- |bitfield|\[:ref:`TransformFlag`\] **get_enable_flags**\ (\ ) -If ``true``, allows to retarget the position. +Flags to control the process of the transform elements individually when :ref:`use_global_pose` is disabled. .. rst-class:: classref-item-separator @@ -88,60 +153,103 @@ If ``true``, allows to retarget the position. ---- -.. _class_RetargetModifier3D_property_rotation_enabled: +.. _class_RetargetModifier3D_property_use_global_pose: .. rst-class:: classref-property -:ref:`bool` **rotation_enabled** = ``true`` :ref:`🔗` +:ref:`bool` **use_global_pose** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget -- |void| **set_rotation_enabled**\ (\ value\: :ref:`bool`\ ) -- :ref:`bool` **is_rotation_enabled**\ (\ ) +- |void| **set_use_global_pose**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_using_global_pose**\ (\ ) + +If ``false``, in case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform will be ignored. + +Instead, it is possible to retarget between models with different body shapes, and position, rotation, and scale can be retargeted separately. + +If ``true``, retargeting is performed taking into account global pose. + +In case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform is taken into account. However, bone length between skeletons must match exactly, if not, the bones will be forced to expand or shrink. + +This is useful for using dummy bone with length ``0`` to match postures when retargeting between models with different number of bones. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- -If ``true``, allows to retarget the rotation. +.. _class_RetargetModifier3D_method_is_position_enabled: + +.. rst-class:: classref-method + +:ref:`bool` **is_position_enabled**\ (\ ) |const| :ref:`🔗` + +Returns ``true`` if :ref:`enable` has :ref:`TRANSFORM_FLAG_POSITION`. .. rst-class:: classref-item-separator ---- -.. _class_RetargetModifier3D_property_scale_enabled: +.. _class_RetargetModifier3D_method_is_rotation_enabled: -.. rst-class:: classref-property +.. rst-class:: classref-method -:ref:`bool` **scale_enabled** = ``true`` :ref:`🔗` +:ref:`bool` **is_rotation_enabled**\ (\ ) |const| :ref:`🔗` -.. rst-class:: classref-property-setget +Returns ``true`` if :ref:`enable` has :ref:`TRANSFORM_FLAG_ROTATION`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RetargetModifier3D_method_is_scale_enabled: + +.. rst-class:: classref-method -- |void| **set_scale_enabled**\ (\ value\: :ref:`bool`\ ) -- :ref:`bool` **is_scale_enabled**\ (\ ) +:ref:`bool` **is_scale_enabled**\ (\ ) |const| :ref:`🔗` -If ``true``, allows to retarget the scale. +Returns ``true`` if :ref:`enable` has :ref:`TRANSFORM_FLAG_SCALE`. .. rst-class:: classref-item-separator ---- -.. _class_RetargetModifier3D_property_use_global_pose: +.. _class_RetargetModifier3D_method_set_position_enabled: -.. rst-class:: classref-property +.. rst-class:: classref-method -:ref:`bool` **use_global_pose** = ``false`` :ref:`🔗` +|void| **set_position_enabled**\ (\ enabled\: :ref:`bool`\ ) :ref:`🔗` -.. rst-class:: classref-property-setget +Sets :ref:`TRANSFORM_FLAG_POSITION` into :ref:`enable`. -- |void| **set_use_global_pose**\ (\ value\: :ref:`bool`\ ) -- :ref:`bool` **is_using_global_pose**\ (\ ) +.. rst-class:: classref-item-separator -If ``false``, in case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform will be ignored. +---- -Instead, it is possible to retarget between models with different body shapes, and position, rotation, and scale can be retargeted separately. +.. _class_RetargetModifier3D_method_set_rotation_enabled: -If ``true``, retargeting is performed taking into account global pose. +.. rst-class:: classref-method -In case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform is taken into account. However, bone length between skeletons must match exactly, if not, the bones will be forced to expand or shrink. +|void| **set_rotation_enabled**\ (\ enabled\: :ref:`bool`\ ) :ref:`🔗` -This is useful for using dummy bone with length ``0`` to match postures when retargeting between models with different number of bones. +Sets :ref:`TRANSFORM_FLAG_ROTATION` into :ref:`enable`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RetargetModifier3D_method_set_scale_enabled: + +.. rst-class:: classref-method + +|void| **set_scale_enabled**\ (\ enabled\: :ref:`bool`\ ) :ref:`🔗` + +Sets :ref:`TRANSFORM_FLAG_SCALE` into :ref:`enable`. .. |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_richtextlabel.rst b/classes/class_richtextlabel.rst index 9deabc33922..11f4e235454 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -155,6 +155,8 @@ Methods +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_from`\ (\ ) |const| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_selection_line_offset`\ (\ ) |const| | + +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_to`\ (\ ) |const| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_total_character_count`\ (\ ) |const| | @@ -257,7 +259,7 @@ Methods +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_cell_size_override`\ (\ min_size\: :ref:`Vector2`, max_size\: :ref:`Vector2`\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_table_column_expand`\ (\ column\: :ref:`int`, expand\: :ref:`bool`, ratio\: :ref:`int` = 1\ ) | + | |void| | :ref:`set_table_column_expand`\ (\ column\: :ref:`int`, expand\: :ref:`bool`, ratio\: :ref:`int` = 1, shrink\: :ref:`bool` = true\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`update_image`\ (\ key\: :ref:`Variant`, mask\: |bitfield|\[:ref:`ImageUpdateMask`\], image\: :ref:`Texture2D`, width\: :ref:`int` = 0, height\: :ref:`int` = 0, color\: :ref:`Color` = Color(1, 1, 1, 1), inline_align\: :ref:`InlineAlignment` = 5, region\: :ref:`Rect2` = Rect2(0, 0, 0, 0), pad\: :ref:`bool` = false, tooltip\: :ref:`String` = "", size_in_percent\: :ref:`bool` = false\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -347,6 +349,8 @@ Signals Triggered when the document is fully loaded. +\ **Note:** This can happen before the text is processed for drawing. Scrolling values may not be valid until the document is drawn for the first time after this signal. + .. rst-class:: classref-item-separator ---- @@ -1388,6 +1392,18 @@ Returns the current selection first character index if a selection is active, `` ---- +.. _class_RichTextLabel_method_get_selection_line_offset: + +.. rst-class:: classref-method + +:ref:`float` **get_selection_line_offset**\ (\ ) |const| :ref:`🔗` + +Returns the current selection vertical line offset if a selection is active, ``-1.0`` otherwise. + +.. rst-class:: classref-item-separator + +---- + .. _class_RichTextLabel_method_get_selection_to: .. rst-class:: classref-method @@ -2049,7 +2065,7 @@ Sets minimum and maximum size overrides for a table cell. .. rst-class:: classref-method -|void| **set_table_column_expand**\ (\ column\: :ref:`int`, expand\: :ref:`bool`, ratio\: :ref:`int` = 1\ ) :ref:`🔗` +|void| **set_table_column_expand**\ (\ column\: :ref:`int`, expand\: :ref:`bool`, ratio\: :ref:`int` = 1, shrink\: :ref:`bool` = true\ ) :ref:`🔗` Edits the selected column's expansion options. If ``expand`` is ``true``, the column expands in proportion to its expansion ratio versus the other columns' ratios. diff --git a/classes/class_skeletonmodifier3d.rst b/classes/class_skeletonmodifier3d.rst index 0f0d01c9807..89a0c8c9887 100644 --- a/classes/class_skeletonmodifier3d.rst +++ b/classes/class_skeletonmodifier3d.rst @@ -12,9 +12,9 @@ SkeletonModifier3D **Inherits:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` -**Inherited By:** :ref:`LookAtModifier3D`, :ref:`PhysicalBoneSimulator3D`, :ref:`RetargetModifier3D`, :ref:`SkeletonIK3D`, :ref:`XRBodyModifier3D`, :ref:`XRHandModifier3D` +**Inherited By:** :ref:`LookAtModifier3D`, :ref:`PhysicalBoneSimulator3D`, :ref:`RetargetModifier3D`, :ref:`SkeletonIK3D`, :ref:`SpringBoneSimulator3D`, :ref:`XRBodyModifier3D`, :ref:`XRHandModifier3D` -A Node that may modify Skeleton3D's bone. +A node that may modify Skeleton3D's bone. .. rst-class:: classref-introduction-group @@ -87,6 +87,69 @@ Notifies when the modification have been finished. .. rst-class:: classref-descriptions-group +Enumerations +------------ + +.. _enum_SkeletonModifier3D_BoneAxis: + +.. rst-class:: classref-enumeration + +enum **BoneAxis**: :ref:`🔗` + +.. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_X: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneAxis` **BONE_AXIS_PLUS_X** = ``0`` + +Enumerated value for the +X axis. + +.. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_X: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneAxis` **BONE_AXIS_MINUS_X** = ``1`` + +Enumerated value for the -X axis. + +.. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_Y: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneAxis` **BONE_AXIS_PLUS_Y** = ``2`` + +Enumerated value for the +Y axis. + +.. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_Y: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneAxis` **BONE_AXIS_MINUS_Y** = ``3`` + +Enumerated value for the -Y axis. + +.. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_Z: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneAxis` **BONE_AXIS_PLUS_Z** = ``4`` + +Enumerated value for the +Z axis. + +.. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_Z: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneAxis` **BONE_AXIS_MINUS_Z** = ``5`` + +Enumerated value for the -Z axis. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + Property Descriptions --------------------- diff --git a/classes/class_skeletonprofilehumanoid.rst b/classes/class_skeletonprofilehumanoid.rst index 8d211727af2..63d90c1e893 100644 --- a/classes/class_skeletonprofilehumanoid.rst +++ b/classes/class_skeletonprofilehumanoid.rst @@ -49,6 +49,7 @@ A humanoid skeleton profile contains 54 bones divided in 4 groups: ``"Body"``, ` │ └─ LeftHand │ ├─ LeftThumbMetacarpal │ │ └─ LeftThumbProximal + │ │ └─ LeftThumbDistal │ ├─ LeftIndexProximal │ │ └─ LeftIndexIntermediate │ │ └─ LeftIndexDistal @@ -67,6 +68,7 @@ A humanoid skeleton profile contains 54 bones divided in 4 groups: ``"Body"``, ` └─ RightHand ├─ RightThumbMetacarpal │ └─ RightThumbProximal + │ └─ RightThumbDistal ├─ RightIndexProximal │ └─ RightIndexIntermediate │ └─ RightIndexDistal diff --git a/classes/class_springbonecollision3d.rst b/classes/class_springbonecollision3d.rst new file mode 100644 index 00000000000..2e96508ed7b --- /dev/null +++ b/classes/class_springbonecollision3d.rst @@ -0,0 +1,159 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Redot engine sources. +.. Generator: https://github.com/Redot-Engine/redot-engine/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/Redot-Engine/redot-engine/tree/master/doc/classes/SpringBoneCollision3D.xml. + +.. _class_SpringBoneCollision3D: + +SpringBoneCollision3D +===================== + +**Inherits:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`SpringBoneCollisionCapsule3D`, :ref:`SpringBoneCollisionPlane3D`, :ref:`SpringBoneCollisionSphere3D` + +A base class of the collision that interacts with :ref:`SpringBoneSimulator3D`. + +.. rst-class:: classref-introduction-group + +Description +----------- + +A collision can be a child of :ref:`SpringBoneSimulator3D`. If it is not a child of :ref:`SpringBoneSimulator3D`, it has no effect. + +The colliding and sliding are done in the :ref:`SpringBoneSimulator3D`'s modification process in order of its collision list which is set by :ref:`SpringBoneSimulator3D.set_collision_path`. If :ref:`SpringBoneSimulator3D.are_all_child_collisions_enabled` is ``true``, the order matches :ref:`SceneTree`. + +If :ref:`bone` is set, it synchronizes with the bone pose of the ancestor :ref:`Skeleton3D`, which is done in before the :ref:`SpringBoneSimulator3D`'s modification process as the pre-process. + +\ **Warning:** A scaled **SpringBoneCollision3D** will likely not behave as expected. Make sure that the parent :ref:`Skeleton3D` and its bones are not scaled. + +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +-------------------------------------+------------------------------------------------------------------------------+--------+ + | :ref:`int` | :ref:`bone` | ``-1`` | + +-------------------------------------+------------------------------------------------------------------------------+--------+ + | :ref:`String` | :ref:`bone_name` | ``""`` | + +-------------------------------------+------------------------------------------------------------------------------+--------+ + | :ref:`Vector3` | :ref:`position_offset` | | + +-------------------------------------+------------------------------------------------------------------------------+--------+ + | :ref:`Quaternion` | :ref:`rotation_offset` | | + +-------------------------------------+------------------------------------------------------------------------------+--------+ + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-------------------------------------+------------------------------------------------------------------------------------+ + | :ref:`Skeleton3D` | :ref:`get_skeleton`\ (\ ) |const| | + +-------------------------------------+------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Property Descriptions +--------------------- + +.. _class_SpringBoneCollision3D_property_bone: + +.. rst-class:: classref-property + +:ref:`int` **bone** = ``-1`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_bone**\ (\ value\: :ref:`int`\ ) +- :ref:`int` **get_bone**\ (\ ) + +The index of the attached bone. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneCollision3D_property_bone_name: + +.. rst-class:: classref-property + +:ref:`String` **bone_name** = ``""`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_bone_name**\ (\ value\: :ref:`String`\ ) +- :ref:`String` **get_bone_name**\ (\ ) + +The name of the attached bone. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneCollision3D_property_position_offset: + +.. rst-class:: classref-property + +:ref:`Vector3` **position_offset** :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_position_offset**\ (\ value\: :ref:`Vector3`\ ) +- :ref:`Vector3` **get_position_offset**\ (\ ) + +The offset of the position from :ref:`Skeleton3D`'s :ref:`bone` pose position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneCollision3D_property_rotation_offset: + +.. rst-class:: classref-property + +:ref:`Quaternion` **rotation_offset** :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_rotation_offset**\ (\ value\: :ref:`Quaternion`\ ) +- :ref:`Quaternion` **get_rotation_offset**\ (\ ) + +The offset of the rotation from :ref:`Skeleton3D`'s :ref:`bone` pose rotation. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_SpringBoneCollision3D_method_get_skeleton: + +.. rst-class:: classref-method + +:ref:`Skeleton3D` **get_skeleton**\ (\ ) |const| :ref:`🔗` + +Get parent :ref:`Skeleton3D` node of the parent :ref:`SpringBoneSimulator3D` if found. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_springbonecollisioncapsule3d.rst b/classes/class_springbonecollisioncapsule3d.rst new file mode 100644 index 00000000000..88ccdc98b3c --- /dev/null +++ b/classes/class_springbonecollisioncapsule3d.rst @@ -0,0 +1,103 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Redot engine sources. +.. Generator: https://github.com/Redot-Engine/redot-engine/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/Redot-Engine/redot-engine/tree/master/doc/classes/SpringBoneCollisionCapsule3D.xml. + +.. _class_SpringBoneCollisionCapsule3D: + +SpringBoneCollisionCapsule3D +============================ + +**Inherits:** :ref:`SpringBoneCollision3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +A capsule shape collision that interacts with :ref:`SpringBoneSimulator3D`. + +.. rst-class:: classref-introduction-group + +Description +----------- + +A capsule shape collision that interacts with :ref:`SpringBoneSimulator3D`. + +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +---------------------------+-------------------------------------------------------------------+-----------+ + | :ref:`float` | :ref:`height` | ``0.5`` | + +---------------------------+-------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`inside` | ``false`` | + +---------------------------+-------------------------------------------------------------------+-----------+ + | :ref:`float` | :ref:`radius` | ``0.1`` | + +---------------------------+-------------------------------------------------------------------+-----------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Property Descriptions +--------------------- + +.. _class_SpringBoneCollisionCapsule3D_property_height: + +.. rst-class:: classref-property + +:ref:`float` **height** = ``0.5`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_height**\ (\ value\: :ref:`float`\ ) +- :ref:`float` **get_height**\ (\ ) + +The capsule's height. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneCollisionCapsule3D_property_inside: + +.. rst-class:: classref-property + +:ref:`bool` **inside** = ``false`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_inside**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_inside**\ (\ ) + +If ``true``, the collision acts to trap the joint within the collision. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneCollisionCapsule3D_property_radius: + +.. rst-class:: classref-property + +:ref:`float` **radius** = ``0.1`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_radius**\ (\ value\: :ref:`float`\ ) +- :ref:`float` **get_radius**\ (\ ) + +The capsule's radius. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_springbonecollisionplane3d.rst b/classes/class_springbonecollisionplane3d.rst new file mode 100644 index 00000000000..379952221e9 --- /dev/null +++ b/classes/class_springbonecollisionplane3d.rst @@ -0,0 +1,31 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Redot engine sources. +.. Generator: https://github.com/Redot-Engine/redot-engine/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/Redot-Engine/redot-engine/tree/master/doc/classes/SpringBoneCollisionPlane3D.xml. + +.. _class_SpringBoneCollisionPlane3D: + +SpringBoneCollisionPlane3D +========================== + +**Inherits:** :ref:`SpringBoneCollision3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +A infinite plane collision that interacts with :ref:`SpringBoneSimulator3D`. + +.. rst-class:: classref-introduction-group + +Description +----------- + +A infinite plane collision that interacts with :ref:`SpringBoneSimulator3D`. It is an infinite size XZ plane, and the +Y direction is treated as normal. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_springbonecollisionsphere3d.rst b/classes/class_springbonecollisionsphere3d.rst new file mode 100644 index 00000000000..c0eae90e555 --- /dev/null +++ b/classes/class_springbonecollisionsphere3d.rst @@ -0,0 +1,84 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Redot engine sources. +.. Generator: https://github.com/Redot-Engine/redot-engine/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/Redot-Engine/redot-engine/tree/master/doc/classes/SpringBoneCollisionSphere3D.xml. + +.. _class_SpringBoneCollisionSphere3D: + +SpringBoneCollisionSphere3D +=========================== + +**Inherits:** :ref:`SpringBoneCollision3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +A sphere shape collision that interacts with :ref:`SpringBoneSimulator3D`. + +.. rst-class:: classref-introduction-group + +Description +----------- + +A sphere shape collision that interacts with :ref:`SpringBoneSimulator3D`. + +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +---------------------------+------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`inside` | ``false`` | + +---------------------------+------------------------------------------------------------------+-----------+ + | :ref:`float` | :ref:`radius` | ``0.1`` | + +---------------------------+------------------------------------------------------------------+-----------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Property Descriptions +--------------------- + +.. _class_SpringBoneCollisionSphere3D_property_inside: + +.. rst-class:: classref-property + +:ref:`bool` **inside** = ``false`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_inside**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_inside**\ (\ ) + +If ``true``, the collision acts to trap the joint within the collision. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneCollisionSphere3D_property_radius: + +.. rst-class:: classref-property + +:ref:`float` **radius** = ``0.1`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_radius**\ (\ value\: :ref:`float`\ ) +- :ref:`float` **get_radius**\ (\ ) + +The sphere's radius. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_springbonesimulator3d.rst b/classes/class_springbonesimulator3d.rst new file mode 100644 index 00000000000..8f6904d17ad --- /dev/null +++ b/classes/class_springbonesimulator3d.rst @@ -0,0 +1,1299 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Redot engine sources. +.. Generator: https://github.com/Redot-Engine/redot-engine/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/Redot-Engine/redot-engine/tree/master/doc/classes/SpringBoneSimulator3D.xml. + +.. _class_SpringBoneSimulator3D: + +SpringBoneSimulator3D +===================== + +**Inherits:** :ref:`SkeletonModifier3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +A :ref:`SkeletonModifier3D` to apply inertial wavering to bone chains. + +.. rst-class:: classref-introduction-group + +Description +----------- + +This :ref:`SkeletonModifier3D` can be used to wiggle hair, cloth, and tails. This modifier behaves differently from :ref:`PhysicalBoneSimulator3D` as it attempts to return the original pose after modification. + +If you setup :ref:`set_root_bone` and :ref:`set_end_bone`, it is treated as one bone chain. Note that it does not support a branched chain like Y-shaped chains. + +When a bone chain is created, an array is generated from the bones that exist in between and listed in the joint list. + +Several properties can be applied to each joint, such as :ref:`set_joint_stiffness`, :ref:`set_joint_drag`, and :ref:`set_joint_gravity`. + +For simplicity, you can set values to all joints at the same time by using a :ref:`Curve`. If you want to specify detailed values individually, set :ref:`set_individual_config` to ``true``. + +For physical simulation, **SpringBoneSimulator3D** can have children as self-standing collisions that are not related to :ref:`PhysicsServer3D`, see also :ref:`SpringBoneCollision3D`. + +\ **Warning:** A scaled **SpringBoneSimulator3D** will likely not behave as expected. Make sure that the parent :ref:`Skeleton3D` and its bones are not scaled. + +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +-----------------------+--------------------------------------------------------------------------+-------+ + | :ref:`int` | :ref:`setting_count` | ``0`` | + +-----------------------+--------------------------------------------------------------------------+-------+ + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`are_all_child_collisions_enabled`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`clear_collisions`\ (\ index\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`clear_exclude_collisions`\ (\ index\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`clear_settings`\ (\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_center_bone`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_center_bone_name`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`CenterFrom` | :ref:`get_center_from`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NodePath` | :ref:`get_center_node`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_collision_count`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NodePath` | :ref:`get_collision_path`\ (\ index\: :ref:`int`, collision\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_drag`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`get_drag_damping_curve`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_end_bone`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BoneDirection` | :ref:`get_end_bone_direction`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_end_bone_length`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_end_bone_name`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_exclude_collision_count`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NodePath` | :ref:`get_exclude_collision_path`\ (\ index\: :ref:`int`, collision\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_gravity`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`get_gravity_damping_curve`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_gravity_direction`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_joint_bone`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_joint_bone_name`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_joint_count`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_joint_drag`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_joint_gravity`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_joint_gravity_direction`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_joint_radius`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RotationAxis` | :ref:`get_joint_rotation_axis`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_joint_stiffness`\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_radius`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`get_radius_damping_curve`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_root_bone`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_root_bone_name`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RotationAxis` | :ref:`get_rotation_axis`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_stiffness`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Curve` | :ref:`get_stiffness_damping_curve`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_config_individual`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_end_bone_extended`\ (\ index\: :ref:`int`\ ) |const| | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`reset`\ (\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_center_bone`\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_center_bone_name`\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_center_from`\ (\ index\: :ref:`int`, center_from\: :ref:`CenterFrom`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_center_node`\ (\ index\: :ref:`int`, node_path\: :ref:`NodePath`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_count`\ (\ index\: :ref:`int`, count\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_path`\ (\ index\: :ref:`int`, collision\: :ref:`int`, node_path\: :ref:`NodePath`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_drag`\ (\ index\: :ref:`int`, drag\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_drag_damping_curve`\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_enable_all_child_collisions`\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_end_bone`\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_end_bone_direction`\ (\ index\: :ref:`int`, bone_direction\: :ref:`BoneDirection`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_end_bone_length`\ (\ index\: :ref:`int`, length\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_end_bone_name`\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_exclude_collision_count`\ (\ index\: :ref:`int`, count\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_exclude_collision_path`\ (\ index\: :ref:`int`, collision\: :ref:`int`, node_path\: :ref:`NodePath`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_extend_end_bone`\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_gravity`\ (\ index\: :ref:`int`, gravity\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_gravity_damping_curve`\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_gravity_direction`\ (\ index\: :ref:`int`, gravity_direction\: :ref:`Vector3`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_individual_config`\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_joint_drag`\ (\ index\: :ref:`int`, joint\: :ref:`int`, drag\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_joint_gravity`\ (\ index\: :ref:`int`, joint\: :ref:`int`, gravity\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_joint_gravity_direction`\ (\ index\: :ref:`int`, joint\: :ref:`int`, gravity_direction\: :ref:`Vector3`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_joint_radius`\ (\ index\: :ref:`int`, joint\: :ref:`int`, radius\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_joint_rotation_axis`\ (\ index\: :ref:`int`, joint\: :ref:`int`, axis\: :ref:`RotationAxis`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_joint_stiffness`\ (\ index\: :ref:`int`, joint\: :ref:`int`, stiffness\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_radius`\ (\ index\: :ref:`int`, radius\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_radius_damping_curve`\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_root_bone`\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_root_bone_name`\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_rotation_axis`\ (\ index\: :ref:`int`, axis\: :ref:`RotationAxis`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_stiffness`\ (\ index\: :ref:`int`, stiffness\: :ref:`float`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_stiffness_damping_curve`\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) | + +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Enumerations +------------ + +.. _enum_SpringBoneSimulator3D_BoneDirection: + +.. rst-class:: classref-enumeration + +enum **BoneDirection**: :ref:`🔗` + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_PLUS_X: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_PLUS_X** = ``0`` + +Enumerated value for the +X axis. + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_MINUS_X: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_MINUS_X** = ``1`` + +Enumerated value for the -X axis. + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_PLUS_Y: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_PLUS_Y** = ``2`` + +Enumerated value for the +Y axis. + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_MINUS_Y: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_MINUS_Y** = ``3`` + +Enumerated value for the -Y axis. + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_PLUS_Z: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_PLUS_Z** = ``4`` + +Enumerated value for the +Z axis. + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_MINUS_Z: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_MINUS_Z** = ``5`` + +Enumerated value for the -Z axis. + +.. _class_SpringBoneSimulator3D_constant_BONE_DIRECTION_FROM_PARENT: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneDirection` **BONE_DIRECTION_FROM_PARENT** = ``6`` + +Enumerated value for the axis from a parent bone to the child bone. + +.. rst-class:: classref-item-separator + +---- + +.. _enum_SpringBoneSimulator3D_CenterFrom: + +.. rst-class:: classref-enumeration + +enum **CenterFrom**: :ref:`🔗` + +.. _class_SpringBoneSimulator3D_constant_CENTER_FROM_WORLD_ORIGIN: + +.. rst-class:: classref-enumeration-constant + +:ref:`CenterFrom` **CENTER_FROM_WORLD_ORIGIN** = ``0`` + +The world origin is defined as center. + +.. _class_SpringBoneSimulator3D_constant_CENTER_FROM_NODE: + +.. rst-class:: classref-enumeration-constant + +:ref:`CenterFrom` **CENTER_FROM_NODE** = ``1`` + +The :ref:`Node3D` specified by :ref:`set_center_node` is defined as center. + +If :ref:`Node3D` is not found, the parent :ref:`Skeleton3D` is treated as center. + +.. _class_SpringBoneSimulator3D_constant_CENTER_FROM_BONE: + +.. rst-class:: classref-enumeration-constant + +:ref:`CenterFrom` **CENTER_FROM_BONE** = ``2`` + +The bone pose origin of the parent :ref:`Skeleton3D` specified by :ref:`set_center_bone` is defined as center. + +If :ref:`Node3D` is not found, the parent :ref:`Skeleton3D` is treated as center. + +.. rst-class:: classref-item-separator + +---- + +.. _enum_SpringBoneSimulator3D_RotationAxis: + +.. rst-class:: classref-enumeration + +enum **RotationAxis**: :ref:`🔗` + +.. _class_SpringBoneSimulator3D_constant_ROTATION_AXIS_X: + +.. rst-class:: classref-enumeration-constant + +:ref:`RotationAxis` **ROTATION_AXIS_X** = ``0`` + +Enumerated value for the rotation of the X axis. + +.. _class_SpringBoneSimulator3D_constant_ROTATION_AXIS_Y: + +.. rst-class:: classref-enumeration-constant + +:ref:`RotationAxis` **ROTATION_AXIS_Y** = ``1`` + +Enumerated value for the rotation of the Y axis. + +.. _class_SpringBoneSimulator3D_constant_ROTATION_AXIS_Z: + +.. rst-class:: classref-enumeration-constant + +:ref:`RotationAxis` **ROTATION_AXIS_Z** = ``2`` + +Enumerated value for the rotation of the Z axis. + +.. _class_SpringBoneSimulator3D_constant_ROTATION_AXIS_ALL: + +.. rst-class:: classref-enumeration-constant + +:ref:`RotationAxis` **ROTATION_AXIS_ALL** = ``3`` + +Enumerated value for the unconstrained rotation. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Property Descriptions +--------------------- + +.. _class_SpringBoneSimulator3D_property_setting_count: + +.. rst-class:: classref-property + +:ref:`int` **setting_count** = ``0`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_setting_count**\ (\ value\: :ref:`int`\ ) +- :ref:`int` **get_setting_count**\ (\ ) + +The number of settings. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_SpringBoneSimulator3D_method_are_all_child_collisions_enabled: + +.. rst-class:: classref-method + +:ref:`bool` **are_all_child_collisions_enabled**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns ``true`` if the all child :ref:`SpringBoneCollision3D`\ s are contained in the collision list at ``index`` in the settings. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_clear_collisions: + +.. rst-class:: classref-method + +|void| **clear_collisions**\ (\ index\: :ref:`int`\ ) :ref:`🔗` + +Clears all collisions from the collision list at ``index`` in the settings when :ref:`are_all_child_collisions_enabled` is ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_clear_exclude_collisions: + +.. rst-class:: classref-method + +|void| **clear_exclude_collisions**\ (\ index\: :ref:`int`\ ) :ref:`🔗` + +Clears all exclude collisions from the collision list at ``index`` in the settings when :ref:`are_all_child_collisions_enabled` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_clear_settings: + +.. rst-class:: classref-method + +|void| **clear_settings**\ (\ ) :ref:`🔗` + +Clears all settings. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_center_bone: + +.. rst-class:: classref-method + +:ref:`int` **get_center_bone**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the center bone index of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_center_bone_name: + +.. rst-class:: classref-method + +:ref:`String` **get_center_bone_name**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the center bone name of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_center_from: + +.. rst-class:: classref-method + +:ref:`CenterFrom` **get_center_from**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns what the center originates from in the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_center_node: + +.. rst-class:: classref-method + +:ref:`NodePath` **get_center_node**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the center node path of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_collision_count: + +.. rst-class:: classref-method + +:ref:`int` **get_collision_count**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the collision count of the bone chain's collision list when :ref:`are_all_child_collisions_enabled` is ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_collision_path: + +.. rst-class:: classref-method + +:ref:`NodePath` **get_collision_path**\ (\ index\: :ref:`int`, collision\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the node path of the :ref:`SpringBoneCollision3D` at ``collision`` in the bone chain's collision list when :ref:`are_all_child_collisions_enabled` is ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_drag: + +.. rst-class:: classref-method + +:ref:`float` **get_drag**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the drag force damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_drag_damping_curve: + +.. rst-class:: classref-method + +:ref:`Curve` **get_drag_damping_curve**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the drag force damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_end_bone: + +.. rst-class:: classref-method + +:ref:`int` **get_end_bone**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the end bone index of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_end_bone_direction: + +.. rst-class:: classref-method + +:ref:`BoneDirection` **get_end_bone_direction**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the end bone's tail direction of the bone chain when :ref:`is_end_bone_extended` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_end_bone_length: + +.. rst-class:: classref-method + +:ref:`float` **get_end_bone_length**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the end bone's tail length of the bone chain when :ref:`is_end_bone_extended` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_end_bone_name: + +.. rst-class:: classref-method + +:ref:`String` **get_end_bone_name**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the end bone name of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_exclude_collision_count: + +.. rst-class:: classref-method + +:ref:`int` **get_exclude_collision_count**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the exclude collision count of the bone chain's exclude collision list when :ref:`are_all_child_collisions_enabled` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_exclude_collision_path: + +.. rst-class:: classref-method + +:ref:`NodePath` **get_exclude_collision_path**\ (\ index\: :ref:`int`, collision\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the node path of the :ref:`SpringBoneCollision3D` at ``collision`` in the bone chain's exclude collision list when :ref:`are_all_child_collisions_enabled` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_gravity: + +.. rst-class:: classref-method + +:ref:`float` **get_gravity**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the gravity amount of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_gravity_damping_curve: + +.. rst-class:: classref-method + +:ref:`Curve` **get_gravity_damping_curve**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the gravity amount damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_gravity_direction: + +.. rst-class:: classref-method + +:ref:`Vector3` **get_gravity_direction**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the gravity direction of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_bone: + +.. rst-class:: classref-method + +:ref:`int` **get_joint_bone**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the bone index at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_bone_name: + +.. rst-class:: classref-method + +:ref:`String` **get_joint_bone_name**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the bone name at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_count: + +.. rst-class:: classref-method + +:ref:`int` **get_joint_count**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the joint count of the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_drag: + +.. rst-class:: classref-method + +:ref:`float` **get_joint_drag**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the drag force at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_gravity: + +.. rst-class:: classref-method + +:ref:`float` **get_joint_gravity**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the gravity amount at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_gravity_direction: + +.. rst-class:: classref-method + +:ref:`Vector3` **get_joint_gravity_direction**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the gravity direction at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_radius: + +.. rst-class:: classref-method + +:ref:`float` **get_joint_radius**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the radius at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_rotation_axis: + +.. rst-class:: classref-method + +:ref:`RotationAxis` **get_joint_rotation_axis**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the rotation axis at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_joint_stiffness: + +.. rst-class:: classref-method + +:ref:`float` **get_joint_stiffness**\ (\ index\: :ref:`int`, joint\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the stiffness force at ``joint`` in the bone chain's joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_radius: + +.. rst-class:: classref-method + +:ref:`float` **get_radius**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the joint radius of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_radius_damping_curve: + +.. rst-class:: classref-method + +:ref:`Curve` **get_radius_damping_curve**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the joint radius damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_root_bone: + +.. rst-class:: classref-method + +:ref:`int` **get_root_bone**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the root bone index of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_root_bone_name: + +.. rst-class:: classref-method + +:ref:`String` **get_root_bone_name**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the root bone name of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_rotation_axis: + +.. rst-class:: classref-method + +:ref:`RotationAxis` **get_rotation_axis**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the rotation axis of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_stiffness: + +.. rst-class:: classref-method + +:ref:`float` **get_stiffness**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the stiffness force of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_get_stiffness_damping_curve: + +.. rst-class:: classref-method + +:ref:`Curve` **get_stiffness_damping_curve**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the stiffness force damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_is_config_individual: + +.. rst-class:: classref-method + +:ref:`bool` **is_config_individual**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns ``true`` if the config can be edited individually for each joint. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_is_end_bone_extended: + +.. rst-class:: classref-method + +:ref:`bool` **is_end_bone_extended**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns ``true`` if the end bone is extended to have the tail. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_reset: + +.. rst-class:: classref-method + +|void| **reset**\ (\ ) :ref:`🔗` + +Resets a simulating state with respect to the current bone pose. + +It is useful to prevent the simulation result getting violent. For example, calling this immediately after a call to :ref:`AnimationPlayer.play` without a fading, or within the previous :ref:`SkeletonModifier3D.modification_processed` signal if it's condition changes significantly. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_center_bone: + +.. rst-class:: classref-method + +|void| **set_center_bone**\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) :ref:`🔗` + +Sets the center bone index of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_center_bone_name: + +.. rst-class:: classref-method + +|void| **set_center_bone_name**\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) :ref:`🔗` + +Sets the center bone name of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_center_from: + +.. rst-class:: classref-method + +|void| **set_center_from**\ (\ index\: :ref:`int`, center_from\: :ref:`CenterFrom`\ ) :ref:`🔗` + +Sets what the center originates from in the bone chain. + +Bone movement is calculated based on the difference in relative distance between center and bone in the previous and next frames. + +For example, if the parent :ref:`Skeleton3D` is used as the center, the bones are considered to have not moved if the :ref:`Skeleton3D` moves in the world. + +In this case, only a change in the bone pose is considered to be a bone movement. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_center_node: + +.. rst-class:: classref-method + +|void| **set_center_node**\ (\ index\: :ref:`int`, node_path\: :ref:`NodePath`\ ) :ref:`🔗` + +Sets the center node path of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_collision_count: + +.. rst-class:: classref-method + +|void| **set_collision_count**\ (\ index\: :ref:`int`, count\: :ref:`int`\ ) :ref:`🔗` + +Sets the number of collisions in the collision list at ``index`` in the settings when :ref:`are_all_child_collisions_enabled` is ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_collision_path: + +.. rst-class:: classref-method + +|void| **set_collision_path**\ (\ index\: :ref:`int`, collision\: :ref:`int`, node_path\: :ref:`NodePath`\ ) :ref:`🔗` + +Sets the node path of the :ref:`SpringBoneCollision3D` at ``collision`` in the bone chain's collision list when :ref:`are_all_child_collisions_enabled` is ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_drag: + +.. rst-class:: classref-method + +|void| **set_drag**\ (\ index\: :ref:`int`, drag\: :ref:`float`\ ) :ref:`🔗` + +Sets the drag force of the bone chain. The greater the value, the more suppressed the wiggling. + +The value is scaled by :ref:`set_drag_damping_curve` and cached in each joint setting in the joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_drag_damping_curve: + +.. rst-class:: classref-method + +|void| **set_drag_damping_curve**\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) :ref:`🔗` + +Sets the drag force damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_enable_all_child_collisions: + +.. rst-class:: classref-method + +|void| **set_enable_all_child_collisions**\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If sets ``enabled`` to ``true``, the all child :ref:`SpringBoneCollision3D`\ s are collided and :ref:`set_exclude_collision_path` is enabled as an exclusion list at ``index`` in the settings. + +If sets ``enabled`` to ``false``, you need to manually register all valid collisions with :ref:`set_collision_path`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_end_bone: + +.. rst-class:: classref-method + +|void| **set_end_bone**\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) :ref:`🔗` + +Sets the end bone index of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_end_bone_direction: + +.. rst-class:: classref-method + +|void| **set_end_bone_direction**\ (\ index\: :ref:`int`, bone_direction\: :ref:`BoneDirection`\ ) :ref:`🔗` + +Sets the end bone tail direction of the bone chain when :ref:`is_end_bone_extended` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_end_bone_length: + +.. rst-class:: classref-method + +|void| **set_end_bone_length**\ (\ index\: :ref:`int`, length\: :ref:`float`\ ) :ref:`🔗` + +Sets the end bone tail length of the bone chain when :ref:`is_end_bone_extended` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_end_bone_name: + +.. rst-class:: classref-method + +|void| **set_end_bone_name**\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) :ref:`🔗` + +Sets the end bone name of the bone chain. + +\ **Note:** End bone must be the root bone or a child of the root bone. If they are the same, the tail must be extended by :ref:`set_extend_end_bone` to jiggle the bone. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_exclude_collision_count: + +.. rst-class:: classref-method + +|void| **set_exclude_collision_count**\ (\ index\: :ref:`int`, count\: :ref:`int`\ ) :ref:`🔗` + +Sets the number of exclude collisions in the exclude collision list at ``index`` in the settings when :ref:`are_all_child_collisions_enabled` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_exclude_collision_path: + +.. rst-class:: classref-method + +|void| **set_exclude_collision_path**\ (\ index\: :ref:`int`, collision\: :ref:`int`, node_path\: :ref:`NodePath`\ ) :ref:`🔗` + +Sets the node path of the :ref:`SpringBoneCollision3D` at ``collision`` in the bone chain's exclude collision list when :ref:`are_all_child_collisions_enabled` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_extend_end_bone: + +.. rst-class:: classref-method + +|void| **set_extend_end_bone**\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If ``enabled`` is ``true``, the end bone is extended to have the tail. + +The extended tail config is allocated to the last element in the joint list. + +In other words, if you set ``enabled`` is ``false``, the config of last element in the joint list has no effect in the simulated result. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_gravity: + +.. rst-class:: classref-method + +|void| **set_gravity**\ (\ index\: :ref:`int`, gravity\: :ref:`float`\ ) :ref:`🔗` + +Sets the gravity amount of the bone chain. This value is not an acceleration, but a constant velocity of movement in :ref:`set_gravity_direction`. + +If ``gravity`` is not ``0``, the modified pose will not return to the original pose since it is always affected by gravity. + +The value is scaled by :ref:`set_gravity_damping_curve` and cached in each joint setting in the joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_gravity_damping_curve: + +.. rst-class:: classref-method + +|void| **set_gravity_damping_curve**\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) :ref:`🔗` + +Sets the gravity amount damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_gravity_direction: + +.. rst-class:: classref-method + +|void| **set_gravity_direction**\ (\ index\: :ref:`int`, gravity_direction\: :ref:`Vector3`\ ) :ref:`🔗` + +Sets the gravity direction of the bone chain. This value is internally normalized and then multiplied by :ref:`set_gravity`. + +The value is cached in each joint setting in the joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_individual_config: + +.. rst-class:: classref-method + +|void| **set_individual_config**\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If ``enabled`` is ``true``, the config can be edited individually for each joint. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_joint_drag: + +.. rst-class:: classref-method + +|void| **set_joint_drag**\ (\ index\: :ref:`int`, joint\: :ref:`int`, drag\: :ref:`float`\ ) :ref:`🔗` + +Sets the drag force at ``joint`` in the bone chain's joint list when :ref:`is_config_individual` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_joint_gravity: + +.. rst-class:: classref-method + +|void| **set_joint_gravity**\ (\ index\: :ref:`int`, joint\: :ref:`int`, gravity\: :ref:`float`\ ) :ref:`🔗` + +Sets the gravity amount at ``joint`` in the bone chain's joint list when :ref:`is_config_individual` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_joint_gravity_direction: + +.. rst-class:: classref-method + +|void| **set_joint_gravity_direction**\ (\ index\: :ref:`int`, joint\: :ref:`int`, gravity_direction\: :ref:`Vector3`\ ) :ref:`🔗` + +Sets the gravity direction at ``joint`` in the bone chain's joint list when :ref:`is_config_individual` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_joint_radius: + +.. rst-class:: classref-method + +|void| **set_joint_radius**\ (\ index\: :ref:`int`, joint\: :ref:`int`, radius\: :ref:`float`\ ) :ref:`🔗` + +Sets the joint radius at ``joint`` in the bone chain's joint list when :ref:`is_config_individual` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_joint_rotation_axis: + +.. rst-class:: classref-method + +|void| **set_joint_rotation_axis**\ (\ index\: :ref:`int`, joint\: :ref:`int`, axis\: :ref:`RotationAxis`\ ) :ref:`🔗` + +Sets the rotation axis at ``joint`` in the bone chain's joint list when :ref:`is_config_individual` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_joint_stiffness: + +.. rst-class:: classref-method + +|void| **set_joint_stiffness**\ (\ index\: :ref:`int`, joint\: :ref:`int`, stiffness\: :ref:`float`\ ) :ref:`🔗` + +Sets the stiffness force at ``joint`` in the bone chain's joint list when :ref:`is_config_individual` is ``true``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_radius: + +.. rst-class:: classref-method + +|void| **set_radius**\ (\ index\: :ref:`int`, radius\: :ref:`float`\ ) :ref:`🔗` + +Sets the joint radius of the bone chain. It is used to move and slide with the :ref:`SpringBoneCollision3D` in the collision list. + +The value is scaled by :ref:`set_radius_damping_curve` and cached in each joint setting in the joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_radius_damping_curve: + +.. rst-class:: classref-method + +|void| **set_radius_damping_curve**\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) :ref:`🔗` + +Sets the joint radius damping curve of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_root_bone: + +.. rst-class:: classref-method + +|void| **set_root_bone**\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) :ref:`🔗` + +Sets the root bone index of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_root_bone_name: + +.. rst-class:: classref-method + +|void| **set_root_bone_name**\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) :ref:`🔗` + +Sets the root bone name of the bone chain. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_rotation_axis: + +.. rst-class:: classref-method + +|void| **set_rotation_axis**\ (\ index\: :ref:`int`, axis\: :ref:`RotationAxis`\ ) :ref:`🔗` + +Sets the rotation axis of the bone chain. If sets a specific axis, it acts like a hinge joint. + +The value is cached in each joint setting in the joint list. + +\ **Note:** The rotation axis and the forward vector shouldn't be colinear to avoid unintended rotation since **SpringBoneSimulator3D** does not factor in twisting forces. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_stiffness: + +.. rst-class:: classref-method + +|void| **set_stiffness**\ (\ index\: :ref:`int`, stiffness\: :ref:`float`\ ) :ref:`🔗` + +Sets the stiffness force of the bone chain. The greater the value, the faster it recovers to its initial pose. + +If ``stiffness`` is ``0``, the modified pose will not return to the original pose. + +The value is scaled by :ref:`set_stiffness_damping_curve` and cached in each joint setting in the joint list. + +.. rst-class:: classref-item-separator + +---- + +.. _class_SpringBoneSimulator3D_method_set_stiffness_damping_curve: + +.. rst-class:: classref-method + +|void| **set_stiffness_damping_curve**\ (\ index\: :ref:`int`, curve\: :ref:`Curve`\ ) :ref:`🔗` + +Sets the stiffness force damping curve of the bone chain. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_string.rst b/classes/class_string.rst index cb9bc3722cd..dba0e498ff4 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -737,10 +737,10 @@ See also the :doc:`GDScript format string <../tutorials/scripting/gdscript/gdscr :: - print("{0} {1}".format(["{1}", "x"])) # Prints "x x". - print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}". - print("{a} {b}".format({"a": "{b}", "b": "c"})) # Prints "c c". - print("{a} {b}".format({"b": "c", "a": "{b}"})) # Prints "{b} c". + print("{0} {1}".format(["{1}", "x"])) # Prints "x x" + print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}" + print("{a} {b}".format({"a": "{b}", "b": "c"})) # Prints "c c" + print("{a} {b}".format({"b": "c", "a": "{b}"})) # Prints "{b} c" \ **Note:** In C#, it's recommended to `interpolate strings with "$" `__, instead. @@ -1231,7 +1231,7 @@ Returns the concatenation of ``parts``' elements, with each element separated by .. code-tab:: csharp - var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"}; + string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"]; // In C#, this method is static. GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi" diff --git a/classes/class_stringname.rst b/classes/class_stringname.rst index 4cf0fd0975c..5e599b82f2f 100644 --- a/classes/class_stringname.rst +++ b/classes/class_stringname.rst @@ -691,10 +691,10 @@ See also the :doc:`GDScript format string <../tutorials/scripting/gdscript/gdscr :: - print("{0} {1}".format(["{1}", "x"])) # Prints "x x". - print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}". - print("{a} {b}".format({"a": "{b}", "b": "c"})) # Prints "c c". - print("{a} {b}".format({"b": "c", "a": "{b}"})) # Prints "{b} c". + print("{0} {1}".format(["{1}", "x"])) # Prints "x x" + print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}" + print("{a} {b}".format({"a": "{b}", "b": "c"})) # Prints "c c" + print("{a} {b}".format({"b": "c", "a": "{b}"})) # Prints "{b} c" \ **Note:** In C#, it's recommended to `interpolate strings with "$" `__, instead. @@ -1171,7 +1171,7 @@ Returns the concatenation of ``parts``' elements, with each element separated by .. code-tab:: csharp - var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"}; + string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"]; // In C#, this method is static. GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi" diff --git a/classes/class_subtweentweener.rst b/classes/class_subtweentweener.rst new file mode 100644 index 00000000000..af7eea150dd --- /dev/null +++ b/classes/class_subtweentweener.rst @@ -0,0 +1,62 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Redot engine sources. +.. Generator: https://github.com/Redot-Engine/redot-engine/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/Redot-Engine/redot-engine/tree/master/doc/classes/SubtweenTweener.xml. + +.. _class_SubtweenTweener: + +SubtweenTweener +=============== + +**Inherits:** :ref:`Tweener` **<** :ref:`RefCounted` **<** :ref:`Object` + +Runs a :ref:`Tween` nested within another :ref:`Tween`. + +.. rst-class:: classref-introduction-group + +Description +----------- + +**SubtweenTweener** is used to execute a :ref:`Tween` as one step in a sequence defined by another :ref:`Tween`. See :ref:`Tween.tween_subtween` for more usage information. + +\ **Note:** :ref:`Tween.tween_subtween` is the only correct way to create **SubtweenTweener**. Any **SubtweenTweener** created manually will not function correctly. + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-----------------------------------------------+---------------------------------------------------------------------------------------------------+ + | :ref:`SubtweenTweener` | :ref:`set_delay`\ (\ delay\: :ref:`float`\ ) | + +-----------------------------------------------+---------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_SubtweenTweener_method_set_delay: + +.. rst-class:: classref-method + +:ref:`SubtweenTweener` **set_delay**\ (\ delay\: :ref:`float`\ ) :ref:`🔗` + +Sets the time in seconds after which the **SubtweenTweener** will start running the subtween. By default there's no delay. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_subviewport.rst b/classes/class_subviewport.rst index c148c999489..3e7a3799b9d 100644 --- a/classes/class_subviewport.rst +++ b/classes/class_subviewport.rst @@ -23,6 +23,8 @@ Description \ **Note:** **SubViewport** is a :ref:`Viewport` that isn't a :ref:`Window`, i.e. it doesn't draw anything by itself. To display anything, **SubViewport** must have a non-zero size and be either put inside a :ref:`SubViewportContainer` or assigned to a :ref:`ViewportTexture`. +\ **Note:** :ref:`InputEvent`\ s are not passed to a standalone **SubViewport** by default. To ensure :ref:`InputEvent` propagation, a **SubViewport** can be placed inside of a :ref:`SubViewportContainer`. + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_surfacetool.rst b/classes/class_surfacetool.rst index 4b607689c92..2de512245d7 100644 --- a/classes/class_surfacetool.rst +++ b/classes/class_surfacetool.rst @@ -341,7 +341,7 @@ Clear all information passed into the surface tool so far. Returns a constructed :ref:`ArrayMesh` from current information passed in. If an existing :ref:`ArrayMesh` is passed in as an argument, will add an extra surface to the existing :ref:`ArrayMesh`. -\ **FIXME:** Document possible values for ``flags``, it changed in 4.0. Likely some combinations of :ref:`ArrayFormat`. +The ``flags`` argument can be the bitwise OR of :ref:`Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE`, :ref:`Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS`, or :ref:`Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY`. .. rst-class:: classref-item-separator diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst index 83366e0f066..43dec047771 100644 --- a/classes/class_textedit.rst +++ b/classes/class_textedit.rst @@ -73,6 +73,8 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`editable` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`emoji_menu_enabled` | ``true`` | + +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty_selection_clipboard_enabled` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | @@ -235,7 +237,7 @@ Methods +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_line_background_color`\ (\ line\: :ref:`int`\ ) |const| | +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`get_line_column_at_pos`\ (\ position\: :ref:`Vector2i`, allow_out_of_bounds\: :ref:`bool` = true\ ) |const| | + | :ref:`Vector2i` | :ref:`get_line_column_at_pos`\ (\ position\: :ref:`Vector2i`, clamp_line\: :ref:`bool` = true, clamp_column\: :ref:`bool` = true\ ) |const| | +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_count`\ (\ ) |const| | +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -253,6 +255,8 @@ Methods +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_width`\ (\ line\: :ref:`int`, wrap_index\: :ref:`int` = -1\ ) |const| | +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_line_with_ime`\ (\ line\: :ref:`int`\ ) |const| | + +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_wrap_count`\ (\ line\: :ref:`int`\ ) |const| | +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_wrap_index_at_column`\ (\ line\: :ref:`int`, column\: :ref:`int`\ ) |const| | @@ -858,11 +862,19 @@ Inserts word joiner (WJ) character. Inserts soft hyphen (SHY) character. +.. _class_TextEdit_constant_MENU_EMOJI_AND_SYMBOL: + +.. rst-class:: classref-enumeration-constant + +:ref:`MenuItems` **MENU_EMOJI_AND_SYMBOL** = ``30`` + +Opens system emoji and symbol picker. + .. _class_TextEdit_constant_MENU_MAX: .. rst-class:: classref-enumeration-constant -:ref:`MenuItems` **MENU_MAX** = ``30`` +:ref:`MenuItems` **MENU_MAX** = ``31`` Represents the size of the :ref:`MenuItems` enum. @@ -1363,6 +1375,23 @@ If ``false``, existing text cannot be modified and new text cannot be added. ---- +.. _class_TextEdit_property_emoji_menu_enabled: + +.. rst-class:: classref-property + +:ref:`bool` **emoji_menu_enabled** = ``true`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_emoji_menu_enabled**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_emoji_menu_enabled**\ (\ ) + +If ``true``, "Emoji and Symbols" menu is enabled. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextEdit_property_empty_selection_clipboard_enabled: .. rst-class:: classref-property @@ -2424,9 +2453,13 @@ Returns the custom background color of the given line. If no color is set, retur .. rst-class:: classref-method -:ref:`Vector2i` **get_line_column_at_pos**\ (\ position\: :ref:`Vector2i`, allow_out_of_bounds\: :ref:`bool` = true\ ) |const| :ref:`🔗` +:ref:`Vector2i` **get_line_column_at_pos**\ (\ position\: :ref:`Vector2i`, clamp_line\: :ref:`bool` = true, clamp_column\: :ref:`bool` = true\ ) |const| :ref:`🔗` -Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line. If ``allow_out_of_bounds`` is ``false`` and the position is not over the text, both vector values will be set to ``-1``. +Returns the line and column at the given position. In the returned vector, ``x`` is the column and ``y`` is the line. + +If ``clamp_line`` is ``false`` and ``position`` is below the last line, ``Vector2i(-1, -1)`` is returned. + +If ``clamp_column`` is ``false`` and ``position`` is outside the column range of the line, ``Vector2i(-1, -1)`` is returned. .. rst-class:: classref-item-separator @@ -2532,6 +2565,18 @@ Returns the width in pixels of the ``wrap_index`` on ``line``. ---- +.. _class_TextEdit_method_get_line_with_ime: + +.. rst-class:: classref-method + +:ref:`String` **get_line_with_ime**\ (\ line\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns line text as it is currently displayed, including IME composition string. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextEdit_method_get_line_wrap_count: .. rst-class:: classref-method diff --git a/classes/class_textserver.rst b/classes/class_textserver.rst index 2baecbb811b..20de5caaf7b 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -337,6 +337,8 @@ Methods +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`shaped_get_span_count`\ (\ shaped\: :ref:`RID`\ ) |const| | +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`shaped_get_span_embedded_object`\ (\ shaped\: :ref:`RID`, index\: :ref:`int`\ ) |const| | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`shaped_get_span_meta`\ (\ shaped\: :ref:`RID`, index\: :ref:`int`\ ) |const| | +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`shaped_set_span_update_font`\ (\ shaped\: :ref:`RID`, index\: :ref:`int`, fonts\: :ref:`Array`\[:ref:`RID`\], size\: :ref:`int`, opentype_features\: :ref:`Dictionary` = {}\ ) | @@ -3394,6 +3396,18 @@ Returns number of text spans added using :ref:`shaped_text_add_string` **shaped_get_span_embedded_object**\ (\ shaped\: :ref:`RID`, index\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns text embedded object key. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServer_method_shaped_get_span_meta: .. rst-class:: classref-method @@ -4232,9 +4246,12 @@ When ``chars_per_line`` is greater than zero, line break boundaries are returned :: var ts = TextServerManager.get_primary_interface() - print(ts.string_get_word_breaks("The Redot Engine, 4")) # Prints [0, 3, 4, 9, 10, 16, 18, 19], which corresponds to the following substrings: "The", "Redot", "Engine", "4" - print(ts.string_get_word_breaks("The Redot Engine, 4", "en", 5)) # Prints [0, 3, 4, 9, 10, 15, 15, 19], which corresponds to the following substrings: "The", "Redot", "Engin", "e, 4" - print(ts.string_get_word_breaks("The Redot Engine, 4", "en", 10)) # Prints [0, 9, 10, 19], which corresponds to the following substrings: "The Redot", "Engine, 4" + # Corresponds to the substrings "The", "Redot", "Engine", and "4". + print(ts.string_get_word_breaks("The Redot Engine, 4")) # Prints [0, 3, 4, 9, 10, 16, 18, 19] + # Corresponds to the substrings "The", "Redot", "Engin", and "e, 4". + print(ts.string_get_word_breaks("The Redot Engine, 4", "en", 5)) # Prints [0, 3, 4, 9, 10, 15, 15, 19] + # Corresponds to the substrings "The Redot" and "Engine, 4". + print(ts.string_get_word_breaks("The Redot Engine, 4", "en", 10)) # Prints [0, 9, 10, 19] .. rst-class:: classref-item-separator diff --git a/classes/class_textserverextension.rst b/classes/class_textserverextension.rst index c97aaf1a536..1b8d834a30a 100644 --- a/classes/class_textserverextension.rst +++ b/classes/class_textserverextension.rst @@ -324,6 +324,8 @@ Methods +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_shaped_get_span_count`\ (\ shaped\: :ref:`RID`\ ) |virtual| |const| | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_shaped_get_span_embedded_object`\ (\ shaped\: :ref:`RID`, index\: :ref:`int`\ ) |virtual| |const| | + +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`_shaped_get_span_meta`\ (\ shaped\: :ref:`RID`, index\: :ref:`int`\ ) |virtual| |const| | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_shaped_set_span_update_font`\ (\ shaped\: :ref:`RID`, index\: :ref:`int`, fonts\: :ref:`Array`\[:ref:`RID`\], size\: :ref:`int`, opentype_features\: :ref:`Dictionary`\ ) |virtual| | @@ -2524,6 +2526,20 @@ Returns number of text spans added using :ref:`_shaped_text_add_string` **_shaped_get_span_embedded_object**\ (\ shaped\: :ref:`RID`, index\: :ref:`int`\ ) |virtual| |const| :ref:`🔗` + +**Required.**\ + +Returns text embedded object key. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServerExtension_private_method__shaped_get_span_meta: .. rst-class:: classref-method diff --git a/classes/class_textserverfallback.rst b/classes/class_textserverfallback.rst index 2e87477eeb9..cd859ac11c9 100644 --- a/classes/class_textserverfallback.rst +++ b/classes/class_textserverfallback.rst @@ -21,7 +21,7 @@ Description A fallback implementation of Redot's text server. This fallback is faster than :ref:`TextServerAdvanced` for processing a lot of text, but it does not support BiDi and complex text layout. -\ **Note:** This text server is not part of official Redot binaries. If you want to use it, compile the engine with the option ``module_text_server_fb_enabled=yes``. +\ **Note:** This text server is not part of official Redot binaries. If you want to use it, compile the engine with the option ``module_text_server_fb_enabled=yes``. When building with **TextServerFallback**, consider also disabling :ref:`TextServerAdvanced` with ``module_text_server_adv_enabled=no`` to reduce binary size. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_textureprogressbar.rst b/classes/class_textureprogressbar.rst index 7f4d03c5337..1eba8324db6 100644 --- a/classes/class_textureprogressbar.rst +++ b/classes/class_textureprogressbar.rst @@ -207,7 +207,7 @@ The fill direction. See :ref:`FillMode` for po - |void| **set_nine_patch_stretch**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_nine_patch_stretch**\ (\ ) -If ``true``, Redot treats the bar's textures like in :ref:`NinePatchRect`. Use the ``stretch_margin_*`` properties like :ref:`stretch_margin_bottom` to set up the nine patch's 3×3 grid. When using a radial :ref:`fill_mode`, this setting will enable stretching. +If ``true``, Redot treats the bar's textures like in :ref:`NinePatchRect`. Use the ``stretch_margin_*`` properties like :ref:`stretch_margin_bottom` to set up the nine patch's 3×3 grid. When using a radial :ref:`fill_mode`, this setting will only enable stretching for :ref:`texture_progress`, while :ref:`texture_under` and :ref:`texture_over` will be treated like in :ref:`NinePatchRect`. .. rst-class:: classref-item-separator diff --git a/classes/class_tiledata.rst b/classes/class_tiledata.rst index bc01ec64e3d..6ae0e7a3214 100644 --- a/classes/class_tiledata.rst +++ b/classes/class_tiledata.rst @@ -90,6 +90,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`\ ) |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_custom_data`\ (\ layer_name\: :ref:`String`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_collision_polygon_one_way`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_valid_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`\ ) |const| | @@ -433,7 +435,7 @@ Returns the constant linear velocity applied to objects colliding with this tile :ref:`Variant` **get_custom_data**\ (\ layer_name\: :ref:`String`\ ) |const| :ref:`🔗` -Returns the custom data value for custom data layer named ``layer_name``. +Returns the custom data value for custom data layer named ``layer_name``. To check if a custom data layer exists, use :ref:`has_custom_data`. .. rst-class:: classref-item-separator @@ -519,6 +521,18 @@ Returns the tile's terrain bit for the given ``peering_bit`` direction. To check ---- +.. _class_TileData_method_has_custom_data: + +.. rst-class:: classref-method + +:ref:`bool` **has_custom_data**\ (\ layer_name\: :ref:`String`\ ) |const| :ref:`🔗` + +Returns whether there exists a custom data layer named ``layer_name``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileData_method_is_collision_polygon_one_way: .. rst-class:: classref-method diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst index 332b9aa519e..dcaa6881be7 100644 --- a/classes/class_tilemap.rst +++ b/classes/class_tilemap.rst @@ -49,6 +49,8 @@ Tutorials - `2D Kinematic Character Demo `__ +- `2D Dynamic TileMap Layers Demo `__ + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_tilemaplayer.rst b/classes/class_tilemaplayer.rst index 0eb89a5fdab..492ddb036e0 100644 --- a/classes/class_tilemaplayer.rst +++ b/classes/class_tilemaplayer.rst @@ -25,6 +25,27 @@ For performance reasons, all TileMap updates are batched at the end of a frame. To force an update earlier on, call :ref:`update_internals`. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Using Tilemaps <../tutorials/2d/using_tilemaps>` + +- `2D Platformer Demo `__ + +- `2D Isometric Demo `__ + +- `2D Hexagonal Demo `__ + +- `2D Grid-based Navigation with AStarGrid2D Demo `__ + +- `2D Role Playing Game (RPG) Demo `__ + +- `2D Kinematic Character Demo `__ + +- `2D Dynamic TileMap Layers Demo `__ + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst index e798a2aa965..dfca9a20599 100644 --- a/classes/class_tileset.rst +++ b/classes/class_tileset.rst @@ -161,6 +161,8 @@ Methods +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_coords_level_tile_proxy`\ (\ source_from\: :ref:`int`, coords_from\: :ref:`Vector2i`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_custom_data_layer_by_name`\ (\ layer_name\: :ref:`String`\ ) |const| | + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_source`\ (\ source_id\: :ref:`int`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_source_level_tile_proxy`\ (\ source_from\: :ref:`int`\ ) | @@ -1150,6 +1152,18 @@ Returns if there is a coodinates-level proxy for the given identifiers. ---- +.. _class_TileSet_method_has_custom_data_layer_by_name: + +.. rst-class:: classref-method + +:ref:`bool` **has_custom_data_layer_by_name**\ (\ layer_name\: :ref:`String`\ ) |const| :ref:`🔗` + +Returns if there is a custom data layer named ``layer_name``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileSet_method_has_source: .. rst-class:: classref-method diff --git a/classes/class_timer.rst b/classes/class_timer.rst index 75dee989cc7..92ac7379687 100644 --- a/classes/class_timer.rst +++ b/classes/class_timer.rst @@ -168,7 +168,7 @@ If ``true``, the timer will start immediately when it enters the scene tree. .. rst-class:: classref-property-setget - |void| **set_ignore_time_scale**\ (\ value\: :ref:`bool`\ ) -- :ref:`bool` **get_ignore_time_scale**\ (\ ) +- :ref:`bool` **is_ignoring_time_scale**\ (\ ) If ``true``, the timer will ignore :ref:`Engine.time_scale` and update with the real, elapsed time. diff --git a/classes/class_tween.rst b/classes/class_tween.rst index 3a37e5803fa..fd4308b07ec 100644 --- a/classes/class_tween.rst +++ b/classes/class_tween.rst @@ -180,6 +180,8 @@ Methods +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Tween` | :ref:`set_ease`\ (\ ease\: :ref:`EaseType`\ ) | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Tween` | :ref:`set_ignore_time_scale`\ (\ ignore\: :ref:`bool` = true\ ) | + +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Tween` | :ref:`set_loops`\ (\ loops\: :ref:`int` = 0\ ) | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Tween` | :ref:`set_parallel`\ (\ parallel\: :ref:`bool` = true\ ) | @@ -202,6 +204,8 @@ Methods +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PropertyTweener` | :ref:`tween_property`\ (\ object\: :ref:`Object`, property\: :ref:`NodePath`, final_val\: :ref:`Variant`, duration\: :ref:`float`\ ) | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubtweenTweener` | :ref:`tween_subtween`\ (\ subtween\: :ref:`Tween`\ ) | + +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -691,6 +695,18 @@ Before this method is called, the default ease type is :ref:`EASE_IN_OUT` **set_ignore_time_scale**\ (\ ignore\: :ref:`bool` = true\ ) :ref:`🔗` + +If ``ignore`` is ``true``, the tween will ignore :ref:`Engine.time_scale` and update with the real, elapsed time. This affects all :ref:`Tweener`\ s and their delays. Default value is ``false``. + +.. rst-class:: classref-item-separator + +---- + .. _class_Tween_method_set_loops: .. rst-class:: classref-method @@ -1035,6 +1051,35 @@ will move the sprite to position (100, 200) and then to (200, 300). If you use : +.. rst-class:: classref-item-separator + +---- + +.. _class_Tween_method_tween_subtween: + +.. rst-class:: classref-method + +:ref:`SubtweenTweener` **tween_subtween**\ (\ subtween\: :ref:`Tween`\ ) :ref:`🔗` + +Creates and appends a :ref:`SubtweenTweener`. This method can be used to nest ``subtween`` within this **Tween**, allowing for the creation of more complex and composable sequences. + +:: + + # Subtween will rotate the object. + var subtween = create_tween() + subtween.tween_property(self, "rotation_degrees", 45.0, 1.0) + subtween.tween_property(self, "rotation_degrees", 0.0, 1.0) + + # Parent tween will execute the subtween as one of its steps. + var tween = create_tween() + tween.tween_property(self, "position:x", 500, 3.0) + tween.tween_subtween(subtween) + tween.tween_property(self, "position:x", 300, 2.0) + +\ **Note:** The methods :ref:`pause`, :ref:`stop`, and :ref:`set_loops` can cause the parent **Tween** to get stuck on the subtween step; see the documentation for those methods for more information. + +\ **Note:** The pause and process modes set by :ref:`set_pause_mode` and :ref:`set_process_mode` on ``subtween`` will be overridden by the parent **Tween**'s settings. + .. |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_tweener.rst b/classes/class_tweener.rst index c1c6ed01faa..86faa1067b3 100644 --- a/classes/class_tweener.rst +++ b/classes/class_tweener.rst @@ -12,7 +12,7 @@ Tweener **Inherits:** :ref:`RefCounted` **<** :ref:`Object` -**Inherited By:** :ref:`CallbackTweener`, :ref:`IntervalTweener`, :ref:`MethodTweener`, :ref:`PropertyTweener` +**Inherited By:** :ref:`CallbackTweener`, :ref:`IntervalTweener`, :ref:`MethodTweener`, :ref:`PropertyTweener`, :ref:`SubtweenTweener` Abstract class for all Tweeners used by :ref:`Tween`. diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index e01d2ddaec9..ad42067f407 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -673,9 +673,9 @@ Creates a unit **Vector2** rotated to the given ``angle`` in radians. This is eq :: - print(Vector2.from_angle(0)) # Prints (1.0, 0.0). + print(Vector2.from_angle(0)) # Prints (1.0, 0.0) print(Vector2(1, 0).angle()) # Prints 0.0, which is the angle used above. - print(Vector2.from_angle(PI / 2)) # Prints (0.0, 1.0). + print(Vector2.from_angle(PI / 2)) # Prints (0.0, 1.0) .. rst-class:: classref-item-separator diff --git a/classes/class_vector4.rst b/classes/class_vector4.rst index f338be65e4f..25696f76e67 100644 --- a/classes/class_vector4.rst +++ b/classes/class_vector4.rst @@ -901,7 +901,7 @@ Divides each component of the **Vector4** by the given :ref:`float` :: - print(Vector4(10, 20, 30, 40) / 2 # Prints (5.0, 10.0, 15.0, 20.0) + print(Vector4(10, 20, 30, 40) / 2) # Prints (5.0, 10.0, 15.0, 20.0) .. rst-class:: classref-item-separator diff --git a/classes/class_vector4i.rst b/classes/class_vector4i.rst index 36872b4657c..ac0a4f34b2f 100644 --- a/classes/class_vector4i.rst +++ b/classes/class_vector4i.rst @@ -569,7 +569,7 @@ Gets the remainder of each component of the **Vector4i** with the components of :: - print(Vector4i(10, -20, 30, -40) % Vector4i(7, 8, 9, 10)) # Prints (3, -4, 3, 0) + print(Vector4i(10, -20, 30, -40) % Vector4i(7, 8, 9, 10)) # Prints (3, -4, 3, 0) .. rst-class:: classref-item-separator @@ -585,7 +585,7 @@ Gets the remainder of each component of the **Vector4i** with the given :ref:`in :: - print(Vector4i(10, -20, 30, -40) % 7) # Prints (3, -6, 2, -5) + print(Vector4i(10, -20, 30, -40) % 7) # Prints (3, -6, 2, -5) .. rst-class:: classref-item-separator @@ -697,7 +697,7 @@ Returns a Vector4 value due to floating-point operations. :: - print(Vector4i(10, 20, 30, 40) / 2 # Prints (5.0, 10.0, 15.0, 20.0) + print(Vector4i(10, 20, 30, 40) / 2) # Prints (5.0, 10.0, 15.0, 20.0) .. rst-class:: classref-item-separator diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst index ab7fde0ede6..4b9ecea511a 100644 --- a/classes/class_viewport.rst +++ b/classes/class_viewport.rst @@ -217,6 +217,10 @@ Methods +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_input_handled`\ (\ ) |const| | +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`notify_mouse_entered`\ (\ ) | + +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`notify_mouse_exited`\ (\ ) | + +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`push_input`\ (\ event\: :ref:`InputEvent`, in_local_coords\: :ref:`bool` = false\ ) | +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`push_text_input`\ (\ text\: :ref:`String`\ ) | @@ -378,11 +382,43 @@ Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`scaling_3d_scale`. Values less than ``1.0`` will be result in the viewport being upscaled using FSR2. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` will use FSR2 at native resolution as a TAA solution. +.. _class_Viewport_constant_SCALING_3D_MODE_METALFX_SPATIAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`Scaling3DMode` **SCALING_3D_MODE_METALFX_SPATIAL** = ``3`` + +Use the `MetalFX spatial upscaler `__ for the viewport's 3D buffer. + +The amount of scaling can be set using :ref:`scaling_3d_scale`. + +Values less than ``1.0`` will be result in the viewport being upscaled using MetalFX. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` disables scaling. + +More information: `MetalFX `__. + +\ **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS. + +.. _class_Viewport_constant_SCALING_3D_MODE_METALFX_TEMPORAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`Scaling3DMode` **SCALING_3D_MODE_METALFX_TEMPORAL** = ``4`` + +Use the `MetalFX temporal upscaler `__ for the viewport's 3D buffer. + +The amount of scaling can be set using :ref:`scaling_3d_scale`. To determine the minimum input scale, use the :ref:`RenderingDevice.limit_get` method with :ref:`RenderingDevice.LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE`. + +Values less than ``1.0`` will be result in the viewport being upscaled using MetalFX. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` will use MetalFX at native resolution as a TAA solution. + +More information: `MetalFX `__. + +\ **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS. + .. _class_Viewport_constant_SCALING_3D_MODE_MAX: .. rst-class:: classref-enumeration-constant -:ref:`Scaling3DMode` **SCALING_3D_MODE_MAX** = ``3`` +:ref:`Scaling3DMode` **SCALING_3D_MODE_MAX** = ``5`` Represents the size of the :ref:`Scaling3DMode` enum. @@ -2328,6 +2364,34 @@ If :ref:`handle_input_locally` is ---- +.. _class_Viewport_method_notify_mouse_entered: + +.. rst-class:: classref-method + +|void| **notify_mouse_entered**\ (\ ) :ref:`🔗` + +Inform the Viewport that the mouse has entered its area. Use this function before sending an :ref:`InputEventMouseButton` or :ref:`InputEventMouseMotion` to the **Viewport** with :ref:`push_input`. See also :ref:`notify_mouse_exited`. + +\ **Note:** In most cases, it is not necessary to call this function because :ref:`SubViewport` nodes that are children of :ref:`SubViewportContainer` are notified automatically. This is only necessary when interacting with viewports in non-default ways, for example as textures in :ref:`TextureRect` or with an :ref:`Area3D` that forwards input events. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Viewport_method_notify_mouse_exited: + +.. rst-class:: classref-method + +|void| **notify_mouse_exited**\ (\ ) :ref:`🔗` + +Inform the Viewport that the mouse has left its area. Use this function when the node that displays the viewport notices the mouse has left the area of the displayed viewport. See also :ref:`notify_mouse_entered`. + +\ **Note:** In most cases, it is not necessary to call this function because :ref:`SubViewport` nodes that are children of :ref:`SubViewportContainer` are notified automatically. This is only necessary when interacting with viewports in non-default ways, for example as textures in :ref:`TextureRect` or with an :ref:`Area3D` that forwards input events. + +.. rst-class:: classref-item-separator + +---- + .. _class_Viewport_method_push_input: .. rst-class:: classref-method diff --git a/classes/class_window.rst b/classes/class_window.rst index 27bc0327f58..78113f51670 100644 --- a/classes/class_window.rst +++ b/classes/class_window.rst @@ -256,6 +256,10 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`show`\ (\ ) | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`start_drag`\ (\ ) | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`start_resize`\ (\ edge\: :ref:`WindowResizeEdge`\ ) | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -1326,13 +1330,13 @@ Passing an empty array will disable passthrough support (all mouse events will b .. code-tab:: csharp // Set region, using Path2D node. - GetNode("Window").MousePassthrough = GetNode("Path2D").Curve.GetBakedPoints(); + GetNode("Window").MousePassthroughPolygon = GetNode("Path2D").Curve.GetBakedPoints(); // Set region, using Polygon2D node. - GetNode("Window").MousePassthrough = GetNode("Polygon2D").Polygon; + GetNode("Window").MousePassthroughPolygon = GetNode("Polygon2D").Polygon; // Reset region to default. - GetNode("Window").MousePassthrough = new Vector2[] {}; + GetNode("Window").MousePassthroughPolygon = []; @@ -2555,6 +2559,30 @@ Enables font oversampling. This makes fonts look better when they are scaled up. Makes the **Window** appear. This enables interactions with the **Window** and doesn't change any of its property other than visibility (unlike e.g. :ref:`popup`). +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_start_drag: + +.. rst-class:: classref-method + +|void| **start_drag**\ (\ ) :ref:`🔗` + +Starts an interactive drag operation on the window, 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. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_start_resize: + +.. rst-class:: classref-method + +|void| **start_resize**\ (\ edge\: :ref:`WindowResizeEdge`\ ) :ref:`🔗` + +Starts an interactive resize operation on the window, 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. + .. rst-class:: classref-section-separator ---- diff --git a/classes/class_worldboundaryshape3d.rst b/classes/class_worldboundaryshape3d.rst index 8e0abe51da6..3d76c981642 100644 --- a/classes/class_worldboundaryshape3d.rst +++ b/classes/class_worldboundaryshape3d.rst @@ -21,6 +21,8 @@ Description A 3D world boundary shape, intended for use in physics. **WorldBoundaryShape3D** works like an infinite plane that forces all physics bodies to stay above it. The :ref:`plane`'s normal determines which direction is considered as "above" and in the editor, the line over the plane represents this direction. It can for example be used for endless flat floors. +\ **Note:** When the physics engine is set to **Jolt Physics** in the project settings (:ref:`ProjectSettings.physics/3d/physics_engine`), **WorldBoundaryShape3D** has a finite size (centered at the shape's origin). It can be adjusted by changing :ref:`ProjectSettings.physics/jolt_physics_3d/limits/world_boundary_shape_size`. + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_xrvrs.rst b/classes/class_xrvrs.rst index f02fc244eaa..0e5f614a826 100644 --- a/classes/class_xrvrs.rst +++ b/classes/class_xrvrs.rst @@ -29,11 +29,13 @@ Properties .. table:: :widths: auto - +---------------------------+------------------------------------------------------------+----------+ - | :ref:`float` | :ref:`vrs_min_radius` | ``20.0`` | - +---------------------------+------------------------------------------------------------+----------+ - | :ref:`float` | :ref:`vrs_strength` | ``1.0`` | - +---------------------------+------------------------------------------------------------+----------+ + +-----------------------------+------------------------------------------------------------------+------------------------+ + | :ref:`float` | :ref:`vrs_min_radius` | ``20.0`` | + +-----------------------------+------------------------------------------------------------------+------------------------+ + | :ref:`Rect2i` | :ref:`vrs_render_region` | ``Rect2i(0, 0, 0, 0)`` | + +-----------------------------+------------------------------------------------------------------+------------------------+ + | :ref:`float` | :ref:`vrs_strength` | ``1.0`` | + +-----------------------------+------------------------------------------------------------------+------------------------+ .. rst-class:: classref-reftable-group @@ -73,6 +75,23 @@ The minimum radius around the focal point where full quality is guaranteed if VR ---- +.. _class_XRVRS_property_vrs_render_region: + +.. rst-class:: classref-property + +:ref:`Rect2i` **vrs_render_region** = ``Rect2i(0, 0, 0, 0)`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_vrs_render_region**\ (\ value\: :ref:`Rect2i`\ ) +- :ref:`Rect2i` **get_vrs_render_region**\ (\ ) + +The render region that the VRS texture will be scaled to when generated. + +.. rst-class:: classref-item-separator + +---- + .. _class_XRVRS_property_vrs_strength: .. rst-class:: classref-property diff --git a/classes/index.rst b/classes/index.rst index 819faca8d78..c9d05341b63 100644 --- a/classes/index.rst +++ b/classes/index.rst @@ -240,6 +240,11 @@ Nodes class_splitcontainer class_spotlight3d class_springarm3d + class_springbonecollision3d + class_springbonecollisioncapsule3d + class_springbonecollisionplane3d + class_springbonecollisionsphere3d + class_springbonesimulator3d class_sprite2d class_sprite3d class_spritebase3d @@ -943,6 +948,7 @@ Other objects class_streampeergzip class_streampeertcp class_streampeertls + class_subtweentweener class_surfacetool class_tcpserver class_textline