From eab235f772739628d405e3dbdee83bfeb4f2a698 Mon Sep 17 00:00:00 2001 From: Godot Organization Date: Sat, 4 Jan 2025 03:20:59 +0000 Subject: [PATCH] classref: Sync with current master branch (bdf625b) --- classes/class_@gdscript.rst | 2 + classes/class_@globalscope.rst | 58 ++--- classes/class_array.rst | 10 +- classes/class_arraymesh.rst | 2 +- classes/class_astargrid2d.rst | 4 +- classes/class_basis.rst | 4 +- classes/class_callable.rst | 6 +- classes/class_color.rst | 22 ++ classes/class_editorcontextmenuplugin.rst | 2 +- classes/class_editorinterface.rst | 244 ++++++++++------------ classes/class_float.rst | 4 +- classes/class_importermesh.rst | 2 +- classes/class_javascriptobject.rst | 8 +- classes/class_json.rst | 2 +- classes/class_lineedit.rst | 23 +- classes/class_nativemenu.rst | 4 +- classes/class_node3d.rst | 4 +- classes/class_nodepath.rst | 26 +-- classes/class_os.rst | 16 +- classes/class_packedbytearray.rst | 4 +- classes/class_packeddatacontainer.rst | 13 +- classes/class_packeddatacontainerref.rst | 25 ++- classes/class_particleprocessmaterial.rst | 17 ++ classes/class_randomnumbergenerator.rst | 2 +- classes/class_renderingserver.rst | 66 ++---- classes/class_resourceloader.rst | 6 +- classes/class_retargetmodifier3d.rst | 186 +++++++++++++---- classes/class_richtextlabel.rst | 2 + classes/class_string.rst | 8 +- classes/class_stringname.rst | 8 +- classes/class_surfacetool.rst | 2 +- classes/class_textserver.rst | 9 +- classes/class_timer.rst | 2 +- classes/class_tween.rst | 14 ++ classes/class_vector2.rst | 4 +- classes/class_vector4.rst | 2 +- classes/class_vector4i.rst | 6 +- 37 files changed, 485 insertions(+), 334 deletions(-) diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index d9da9adf6d0..ea4a875a148 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`. :: diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index d515825e912..4b0abb5f67e 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -5767,9 +5767,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 +5934,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 +6448,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 Godot.Collections.Array a = [1, 2, 3]; - GD.Print("a", "b", a); // Prints ab[1, 2, 3] + GD.Print("a", "b", a); // Prints "ab[1, 2, 3]" @@ -6482,11 +6482,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 +6552,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 +6583,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 +6608,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 +6633,11 @@ Pushes an error message to Godot'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 +6660,11 @@ Pushes a warning message to Godot'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. @@ -7337,9 +7337,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 +7360,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 4189e5e9cd4..08cfcfc6be8 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -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 @@ -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 diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index d26df0aa57c..5c662eafaf9 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -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 15ed867c0d2..6f7aef78169 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`). 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 46820f80a1d..66ddfef6d70 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_color.rst b/classes/class_color.rst index 8c5b5ffbf9f..a8b112dc1c1 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_editorcontextmenuplugin.rst b/classes/class_editorcontextmenuplugin.rst index d99156845a4..51586bc9b07 100644 --- a/classes/class_editorcontextmenuplugin.rst +++ b/classes/class_editorcontextmenuplugin.rst @@ -166,7 +166,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_editorinterface.rst b/classes/class_editorinterface.rst index 899254d26c5..a07b56e60b1 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,7 @@ 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. @@ -713,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_float.rst b/classes/class_float.rst index 76b858d2953..7b1cc3276e2 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_importermesh.rst b/classes/class_importermesh.rst index f1639a7c13a..d5465a6c7ae 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_javascriptobject.rst b/classes/class_javascriptobject.rst index 87addd31d18..44f4d870c99 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 2f3bdddb0ee..208c62be51f 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_lineedit.rst b/classes/class_lineedit.rst index a14c03e116c..10ae4fc19af 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. @@ -121,6 +121,8 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :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`` | @@ -901,6 +903,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 +1310,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_nativemenu.rst b/classes/class_nativemenu.rst index 270fd9bf7da..df68922eed8 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_node3d.rst b/classes/class_node3d.rst index 2f1eea7f782..dfa491a3465 100644 --- a/classes/class_node3d.rst +++ b/classes/class_node3d.rst @@ -798,7 +798,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 8809e66d4a7..ad6ff3df50e 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_os.rst b/classes/class_os.rst index 65e9b3b67b4..7ac24fd643e 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -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. diff --git a/classes/class_packedbytearray.rst b/classes/class_packedbytearray.rst index 6954609fe7b..ae8d5083590 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 7d86c5ad767..2820ec2369c 100644 --- a/classes/class_packeddatacontainerref.rst +++ b/classes/class_packeddatacontainerref.rst @@ -24,7 +24,7 @@ When packing nested containers using :ref:`PackedDataContainer` + +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. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + Enumerations ------------ diff --git a/classes/class_randomnumbergenerator.rst b/classes/class_randomnumbergenerator.rst index 00a050eddfa..0a8427c587d 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_renderingserver.rst b/classes/class_renderingserver.rst index f2637dd8f6a..5227974d315 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -1634,11 +1634,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 +1642,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 +1650,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 +1658,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 +1666,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 +1674,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 +1682,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 +1690,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 +1698,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 +1714,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: @@ -11759,16 +11719,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)) diff --git a/classes/class_resourceloader.rst b/classes/class_resourceloader.rst index 01c96119b9e..e5b6e66aa26 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 117257a5645..3642b953052 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 db0be9974e2..a05eee83ea7 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -347,6 +347,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 ---- diff --git a/classes/class_string.rst b/classes/class_string.rst index 2f90f6d02e8..20a9dc19dd5 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. diff --git a/classes/class_stringname.rst b/classes/class_stringname.rst index f56bd8467fd..ca8f2880371 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. diff --git a/classes/class_surfacetool.rst b/classes/class_surfacetool.rst index e8151e2b760..d9b082ab297 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_textserver.rst b/classes/class_textserver.rst index 3051833921f..307aad84553 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -4232,9 +4232,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 Godot Engine, 4")) # Prints [0, 3, 4, 9, 10, 16, 18, 19], which corresponds to the following substrings: "The", "Godot", "Engine", "4" - print(ts.string_get_word_breaks("The Godot Engine, 4", "en", 5)) # Prints [0, 3, 4, 9, 10, 15, 15, 19], which corresponds to the following substrings: "The", "Godot", "Engin", "e, 4" - print(ts.string_get_word_breaks("The Godot Engine, 4", "en", 10)) # Prints [0, 9, 10, 19], which corresponds to the following substrings: "The Godot", "Engine, 4" + # Corresponds to the substrings "The", "Godot", "Engine", and "4". + print(ts.string_get_word_breaks("The Godot Engine, 4")) # Prints [0, 3, 4, 9, 10, 16, 18, 19] + # Corresponds to the substrings "The", "Godot", "Engin", and "e, 4". + print(ts.string_get_word_breaks("The Godot Engine, 4", "en", 5)) # Prints [0, 3, 4, 9, 10, 15, 15, 19] + # Corresponds to the substrings "The Godot" and "Engine, 4". + print(ts.string_get_word_breaks("The Godot Engine, 4", "en", 10)) # Prints [0, 9, 10, 19] .. rst-class:: classref-item-separator diff --git a/classes/class_timer.rst b/classes/class_timer.rst index b6127a5adc6..25d9dbb35fb 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 165ad175fe1..97290fecc4e 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\ ) | @@ -691,6 +693,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 diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index 80c3424a0c6..cdec82eb2bd 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 f5f97834fdf..a17a8388be8 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 84199a386f1..0ee7d81d7f3 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