From f18d48151390b18b0c5da307271b0f2609798287 Mon Sep 17 00:00:00 2001 From: Godot Organization Date: Sat, 29 Jun 2024 03:28:00 +0000 Subject: [PATCH] classref: Sync with current master branch (811ce36) --- classes/class_audioeffectspectrumanalyzer.rst | 2 + ...ss_audioeffectspectrumanalyzerinstance.rst | 26 +++++++-- classes/class_audiostreamwav.rst | 4 +- classes/class_editorsettings.rst | 58 ++++++++++++++----- classes/class_editorundoredomanager.rst | 16 +++++ classes/class_hashingcontext.rst | 10 ++-- classes/class_inputevent.rst | 4 +- classes/class_inputeventkey.rst | 4 +- classes/class_physicalbone3d.rst | 2 + classes/class_projectsettings.rst | 18 +++++- classes/class_resourceimporterwav.rst | 4 +- classes/class_resourceloader.rst | 4 +- classes/class_skeleton3d.rst | 4 ++ classes/class_textedit.rst | 57 ++++++++++++++++++ classes/class_textserver.rst | 5 +- classes/class_webxrinterface.rst | 18 ++++-- 16 files changed, 194 insertions(+), 42 deletions(-) diff --git a/classes/class_audioeffectspectrumanalyzer.rst b/classes/class_audioeffectspectrumanalyzer.rst index c2f812bfd36..2a862c5c0f3 100644 --- a/classes/class_audioeffectspectrumanalyzer.rst +++ b/classes/class_audioeffectspectrumanalyzer.rst @@ -21,6 +21,8 @@ Description This audio effect does not affect sound output, but can be used for real-time audio visualizations. +This resource configures an :ref:`AudioEffectSpectrumAnalyzerInstance`, which performs the actual analysis at runtime. An instance can be acquired with :ref:`AudioServer.get_bus_effect_instance`. + See also :ref:`AudioStreamGenerator` for procedurally generating sounds. .. rst-class:: classref-introduction-group diff --git a/classes/class_audioeffectspectrumanalyzerinstance.rst b/classes/class_audioeffectspectrumanalyzerinstance.rst index bd15e48e710..68c533dcf73 100644 --- a/classes/class_audioeffectspectrumanalyzerinstance.rst +++ b/classes/class_audioeffectspectrumanalyzerinstance.rst @@ -12,9 +12,23 @@ AudioEffectSpectrumAnalyzerInstance **Inherits:** :ref:`AudioEffectInstance` **<** :ref:`RefCounted` **<** :ref:`Object` -.. container:: contribute +Queryable instance of an :ref:`AudioEffectSpectrumAnalyzer`. - There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Description +----------- + +The runtime part of an :ref:`AudioEffectSpectrumAnalyzer`, which can be used to query the magnitude of a frequency range on its host bus. + +An instance of this class can be acquired with :ref:`AudioServer.get_bus_effect_instance`. + +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- `Audio Spectrum Visualizer Demo `__ .. rst-class:: classref-reftable-group @@ -49,7 +63,7 @@ enum **MagnitudeMode**: :ref:`🔗` **MAGNITUDE_AVERAGE** = ``0`` -Use the average value as magnitude. +Use the average value across the frequency range as magnitude. .. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_MAX: @@ -57,7 +71,7 @@ Use the average value as magnitude. :ref:`MagnitudeMode` **MAGNITUDE_MAX** = ``1`` -Use the maximum value as magnitude. +Use the maximum value of the frequency range as magnitude. .. rst-class:: classref-section-separator @@ -74,9 +88,9 @@ Method Descriptions :ref:`Vector2` **get_magnitude_for_frequency_range**\ (\ from_hz\: :ref:`float`, to_hz\: :ref:`float`, mode\: :ref:`MagnitudeMode` = 1\ ) |const| :ref:`🔗` -.. container:: contribute +Returns the magnitude of the frequencies from ``from_hz`` to ``to_hz`` in linear energy as a Vector2. The ``x`` component of the return value represents the left stereo channel, and ``y`` represents the right channel. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ ``mode`` determines how the frequency range will be processed. See :ref:`MagnitudeMode`. .. |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_audiostreamwav.rst b/classes/class_audiostreamwav.rst index 733b5fff25a..fb21bcccfb9 100644 --- a/classes/class_audiostreamwav.rst +++ b/classes/class_audiostreamwav.rst @@ -213,7 +213,7 @@ Audio format. See :ref:`Format` constants for values - |void| **set_loop_begin**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_loop_begin**\ (\ ) -The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. +The loop start point (in number of samples, relative to the beginning of the stream). This information will be imported automatically from the WAV file if present. .. rst-class:: classref-item-separator @@ -230,7 +230,7 @@ The loop start point (in number of samples, relative to the beginning of the sam - |void| **set_loop_end**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_loop_end**\ (\ ) -The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. +The loop end point (in number of samples, relative to the beginning of the stream). This information will be imported automatically from the WAV file if present. .. rst-class:: classref-item-separator diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index 620979d2e10..87720457f7b 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -321,8 +321,6 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`interface/editor/custom_display_scale` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`interface/editor/debug/enable_pseudolocalization` | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`interface/editor/display_scale` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`interface/editor/dock_tab_style` | @@ -569,6 +567,8 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`text_editor/behavior/indent/type` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`text_editor/behavior/navigation/custom_word_separators` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`text_editor/behavior/navigation/drag_and_drop_selection` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`text_editor/behavior/navigation/move_caret_on_right_click` | @@ -581,6 +581,10 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`text_editor/behavior/navigation/stay_in_script_editor_on_node_selected` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`text_editor/behavior/navigation/use_custom_word_separators` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`text_editor/behavior/navigation/use_default_word_separators` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`text_editor/behavior/navigation/v_scroll_speed` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`text_editor/completion/add_node_path_literals` | @@ -2451,20 +2455,6 @@ The custom editor scale factor to use. This can be used for displays with very h ---- -.. _class_EditorSettings_property_interface/editor/debug/enable_pseudolocalization: - -.. rst-class:: classref-property - -:ref:`bool` **interface/editor/debug/enable_pseudolocalization** :ref:`🔗` - -If ``true``, lengthens the editor's localizable strings and replaces their characters with accented variants. This allows spotting non-localizable strings easily, while also ensuring the UI layout doesn't break when strings are made longer (as many languages require strings to be longer). - -This is a debugging feature and should only be enabled when working on the editor itself. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorSettings_property_interface/editor/display_scale: .. rst-class:: classref-property @@ -4045,6 +4035,18 @@ The indentation style to use (tabs or spaces). ---- +.. _class_EditorSettings_property_text_editor/behavior/navigation/custom_word_separators: + +.. rst-class:: classref-property + +:ref:`String` **text_editor/behavior/navigation/custom_word_separators** :ref:`🔗` + +The characters to consider as word delimiters if :ref:`text_editor/behavior/navigation/use_custom_word_separators` is ``true``. The characters should be defined without separation, for example ``#_!``. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_text_editor/behavior/navigation/drag_and_drop_selection: .. rst-class:: classref-property @@ -4119,6 +4121,30 @@ If ``true``, prevents automatically switching between the Script and 2D/3D scree ---- +.. _class_EditorSettings_property_text_editor/behavior/navigation/use_custom_word_separators: + +.. rst-class:: classref-property + +:ref:`bool` **text_editor/behavior/navigation/use_custom_word_separators** :ref:`🔗` + +If ``false``, using :kbd:`Ctrl + Left` or :kbd:`Ctrl + Right` (:kbd:`Cmd + Left` or :kbd:`Cmd + Right` on macOS) bindings will use the behavior of :ref:`text_editor/behavior/navigation/use_default_word_separators`. If ``true``, it will also stop the caret if a character within :ref:`text_editor/behavior/navigation/custom_word_separators` is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorSettings_property_text_editor/behavior/navigation/use_default_word_separators: + +.. rst-class:: classref-property + +:ref:`bool` **text_editor/behavior/navigation/use_default_word_separators** :ref:`🔗` + +If ``false``, using :kbd:`Ctrl + Left` or :kbd:`Ctrl + Right` (:kbd:`Cmd + Left` or :kbd:`Cmd + Right` on macOS) bindings will stop moving caret only if a space or punctuation is detected. If ``true``, it will also stop the caret if a character is part of ```!"#$%&'()*+,-./:;<=>?@[\]^`{|}~``, the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_text_editor/behavior/navigation/v_scroll_speed: .. rst-class:: classref-property diff --git a/classes/class_editorundoredomanager.rst b/classes/class_editorundoredomanager.rst index a45eb3e1398..19b1042bf1e 100644 --- a/classes/class_editorundoredomanager.rst +++ b/classes/class_editorundoredomanager.rst @@ -60,6 +60,8 @@ Methods +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`create_action`\ (\ name\: :ref:`String`, merge_mode\: :ref:`MergeMode` = 0, custom_context\: :ref:`Object` = null, backward_undo_ops\: :ref:`bool` = false\ ) | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`force_fixed_history`\ (\ ) | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`UndoRedo` | :ref:`get_history_undo_redo`\ (\ id\: :ref:`int`\ ) |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_object_history_id`\ (\ object\: :ref:`Object`\ ) |const| | @@ -254,6 +256,20 @@ The way undo operation are ordered in actions is dictated by ``backward_undo_ops ---- +.. _class_EditorUndoRedoManager_method_force_fixed_history: + +.. rst-class:: classref-method + +|void| **force_fixed_history**\ (\ ) :ref:`🔗` + +Forces the next operation (e.g. :ref:`add_do_method`) to use the action's history rather than guessing it from the object. This is sometimes needed when a history can't be correctly determined, like for a nested resource that doesn't have a path yet. + +This method should only be used when absolutely necessary, otherwise it might cause invalid history state. For most of complex cases, the ``custom_context`` parameter of :ref:`create_action` is sufficient. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorUndoRedoManager_method_get_history_undo_redo: .. rst-class:: classref-method diff --git a/classes/class_hashingcontext.rst b/classes/class_hashingcontext.rst index bf5d5b98ac5..40232dc8460 100644 --- a/classes/class_hashingcontext.rst +++ b/classes/class_hashingcontext.rst @@ -40,8 +40,9 @@ The :ref:`HashType` enum shows the supported hashi # Open the file to hash. var file = FileAccess.open(path, FileAccess.READ) # Update the context after reading each chunk. - while not file.eof_reached(): - ctx.update(file.get_buffer(CHUNK_SIZE)) + while file.get_position() < file.get_length(): + var remaining = file.get_length() - file.get_position() + ctx.update(file.get_buffer(min(remaining, CHUNK_SIZE))) # Get the computed hash. var res = ctx.finish() # Print the result as hex string and array. @@ -64,9 +65,10 @@ The :ref:`HashType` enum shows the supported hashi // Open the file to hash. using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); // Update the context after reading each chunk. - while (!file.EofReached()) + while (file.GetPosition() < file.GetLength()) { - ctx.Update(file.GetBuffer(ChunkSize)); + int remaining = (int)(file.GetLength() - file.GetPosition()); + ctx.Update(file.GetBuffer(Mathf.Min(remaining, ChunkSize))); } // Get the computed hash. byte[] res = ctx.Finish(); diff --git a/classes/class_inputevent.rst b/classes/class_inputevent.rst index 9084aecf512..a10d7c967d5 100644 --- a/classes/class_inputevent.rst +++ b/classes/class_inputevent.rst @@ -248,7 +248,9 @@ Returns ``true`` if this input event has been canceled. :ref:`bool` **is_echo**\ (\ ) |const| :ref:`🔗` -Returns ``true`` if this input event is an echo event (only for events of type :ref:`InputEventKey`). Any other event type returns ``false``. +Returns ``true`` if this input event is an echo event (only for events of type :ref:`InputEventKey`). An echo event is a repeated key event sent when the user is holding down the key. Any other event type returns ``false``. + +\ **Note:** The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior. .. rst-class:: classref-item-separator diff --git a/classes/class_inputeventkey.rst b/classes/class_inputeventkey.rst index b889662fb89..78f83f59bb4 100644 --- a/classes/class_inputeventkey.rst +++ b/classes/class_inputeventkey.rst @@ -100,7 +100,9 @@ Property Descriptions - |void| **set_echo**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_echo**\ (\ ) -If ``true``, the key was already pressed before this event. It means the user is holding the key down. +If ``true``, the key was already pressed before this event. An echo event is a repeated key event sent when the user is holding down the key. + +\ **Note:** The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior. .. rst-class:: classref-item-separator diff --git a/classes/class_physicalbone3d.rst b/classes/class_physicalbone3d.rst index c830b8a7952..2325c9a540b 100644 --- a/classes/class_physicalbone3d.rst +++ b/classes/class_physicalbone3d.rst @@ -24,6 +24,8 @@ Description The **PhysicalBone3D** node is a physics body that can be used to make bones in a :ref:`Skeleton3D` react to physics. +\ **Note:** In order to detect physical bones with raycasts, the :ref:`SkeletonModifier3D.active` property of the parent :ref:`PhysicalBoneSimulator3D` must be ``true`` and the :ref:`Skeleton3D`'s bone must be assigned to **PhysicalBone3D** correctly; it means that :ref:`get_bone_id` should return a valid id (``>= 0``). + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 2c171e352b7..0fbdc6a155a 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -177,6 +177,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/assert_always_true` | ``1`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`debug/gdscript/warnings/confusable_capture_reassignment` | ``1`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/confusable_identifier` | ``1`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/confusable_local_declaration` | ``1`` | @@ -1820,6 +1822,8 @@ This user directory is used for storing persistent data (``user://`` filesystem) The :ref:`application/config/use_custom_user_dir` setting must be enabled for this to take effect. +\ **Note:** If :ref:`application/config/custom_user_dir_name` contains trailing periods, they will be stripped as folder names ending with a period are not allowed on Windows. + .. rst-class:: classref-item-separator ---- @@ -2080,7 +2084,7 @@ This setting can be overridden using the ``--frame-delay `` command line ar :ref:`bool` **application/run/low_processor_mode** = ``false`` :ref:`🔗` -If ``true``, enables low-processor usage mode. The screen is not redrawn if nothing changes visually. This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games. +If ``true``, enables low-processor usage mode. When enabled, the engine takes longer to redraw, but only redraws the screen if necessary. This may lower power consumption, and is intended for editors or mobile applications. For most games, because the screen needs to be redrawn every frame, it is recommended to keep this setting disabled. .. rst-class:: classref-item-separator @@ -2566,6 +2570,18 @@ When set to ``warn`` or ``error``, produces a warning or an error respectively w ---- +.. _class_ProjectSettings_property_debug/gdscript/warnings/confusable_capture_reassignment: + +.. rst-class:: classref-property + +:ref:`int` **debug/gdscript/warnings/confusable_capture_reassignment** = ``1`` :ref:`🔗` + +When set to ``warn`` or ``error``, produces a warning or an error respectively when a local variable captured by a lambda is reassigned, since this does not modify the outer local variable. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_debug/gdscript/warnings/confusable_identifier: .. rst-class:: classref-property diff --git a/classes/class_resourceimporterwav.rst b/classes/class_resourceimporterwav.rst index 1c71c45d83d..6cbf8292c99 100644 --- a/classes/class_resourceimporterwav.rst +++ b/classes/class_resourceimporterwav.rst @@ -91,7 +91,7 @@ The compression mode to use on import. :ref:`int` **edit/loop_begin** = ``0`` :ref:`🔗` -The begin loop point to use when :ref:`edit/loop_mode` is **Forward**, **Ping-Pong** or **Backward**. This is set in seconds after the beginning of the audio file. +The begin loop point to use when :ref:`edit/loop_mode` is **Forward**, **Ping-Pong**, or **Backward**. This is set in samples after the beginning of the audio file. .. rst-class:: classref-item-separator @@ -103,7 +103,7 @@ The begin loop point to use when :ref:`edit/loop_mode` **edit/loop_end** = ``-1`` :ref:`🔗` -The end loop point to use when :ref:`edit/loop_mode` is **Forward**, **Ping-Pong** or **Backward**. This is set in seconds after the beginning of the audio file. A value of ``-1`` uses the end of the audio file as the end loop point. +The end loop point to use when :ref:`edit/loop_mode` is **Forward**, **Ping-Pong**, or **Backward**. This is set in samples after the beginning of the audio file. A value of ``-1`` uses the end of the audio file as the end loop point. .. rst-class:: classref-item-separator diff --git a/classes/class_resourceloader.rst b/classes/class_resourceloader.rst index 46543e6f4ca..845ce3d19e0 100644 --- a/classes/class_resourceloader.rst +++ b/classes/class_resourceloader.rst @@ -294,7 +294,7 @@ GDScript has a simplified :ref:`@GDScript.load` bui Returns the resource loaded by :ref:`load_threaded_request`. -If this is called before the loading thread is done (i.e. :ref:`load_threaded_get_status` is not :ref:`THREAD_LOAD_LOADED`), the calling thread will be blocked until the resource has finished loading. +If this is called before the loading thread is done (i.e. :ref:`load_threaded_get_status` is not :ref:`THREAD_LOAD_LOADED`), the calling thread will be blocked until the resource has finished loading. However, it's recommended to use :ref:`load_threaded_get_status` to known when the load has actually completed. .. rst-class:: classref-item-separator @@ -310,6 +310,8 @@ Returns the status of a threaded loading operation started with :ref:`load_threa An array variable can optionally be passed via ``progress``, and will return a one-element array containing the percentage of completion of the threaded loading. +\ **Note:** The recommended way of using this method is to call it during different frames (e.g., in :ref:`Node._process`, instead of a loop). + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_skeleton3d.rst b/classes/class_skeleton3d.rst index 9616f8efb98..841f6b1af75 100644 --- a/classes/class_skeleton3d.rst +++ b/classes/class_skeleton3d.rst @@ -776,6 +776,10 @@ Sets all bone poses to rests. **Deprecated:** This method may be changed or removed in future versions. +This method exists for compatibility with old structures in which the **Skeleton3D** does not have a :ref:`PhysicalBoneSimulator3D` as a child, but directly has :ref:`PhysicalBone3D`\ s as children. + +In case you need to raycast to it without running :ref:`physical_bones_start_simulation`, call this method with ``enabled == true``. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst index a5913b3b3b0..f71171de46c 100644 --- a/classes/class_textedit.rst +++ b/classes/class_textedit.rst @@ -59,6 +59,8 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`context_menu_enabled` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`custom_word_separators` | ``""`` | + +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`deselect_on_focus_loss_enabled` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`drag_and_drop_selection_enabled` | ``true`` | @@ -117,6 +119,10 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`TextDirection` | :ref:`text_direction` | ``0`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_custom_word_separators` | ``false`` | + +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_default_word_separators` | ``true`` | + +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`virtual_keyboard_enabled` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`LineWrappingMode` | :ref:`wrap_mode` | ``0`` | @@ -1234,6 +1240,23 @@ If ``true``, a right-click displays the context menu. ---- +.. _class_TextEdit_property_custom_word_separators: + +.. rst-class:: classref-property + +:ref:`String` **custom_word_separators** = ``""`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_custom_word_separators**\ (\ value\: :ref:`String`\ ) +- :ref:`String` **get_custom_word_separators**\ (\ ) + +The characters to consider as word delimiters if :ref:`use_custom_word_separators` is ``true``. The characters should be defined without separation, for example ``#_!``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextEdit_property_deselect_on_focus_loss_enabled: .. rst-class:: classref-property @@ -1697,6 +1720,40 @@ Base text writing direction. ---- +.. _class_TextEdit_property_use_custom_word_separators: + +.. rst-class:: classref-property + +:ref:`bool` **use_custom_word_separators** = ``false`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_use_custom_word_separators**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_custom_word_separators_enabled**\ (\ ) + +If ``false``, using :kbd:`Ctrl + Left` or :kbd:`Ctrl + Right` (:kbd:`Cmd + Left` or :kbd:`Cmd + Right` on macOS) bindings will use the behavior of :ref:`use_default_word_separators`. If ``true``, it will also stop the caret if a character within :ref:`custom_word_separators` is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TextEdit_property_use_default_word_separators: + +.. rst-class:: classref-property + +:ref:`bool` **use_default_word_separators** = ``true`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_use_default_word_separators**\ (\ value\: :ref:`bool`\ ) +- :ref:`bool` **is_default_word_separators_enabled**\ (\ ) + +If ``false``, using :kbd:`Ctrl + Left` or :kbd:`Ctrl + Right` (:kbd:`Cmd + Left` or :kbd:`Cmd + Right` on macOS) bindings will stop moving caret only if a space or punctuation is detected. If ``true``, it will also stop the caret if a character is part of ``!"#$%&'()*+,-./:;<=>?@[\]^`{|}~``, the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextEdit_property_virtual_keyboard_enabled: .. rst-class:: classref-property diff --git a/classes/class_textserver.rst b/classes/class_textserver.rst index 5c820c8c863..655d54c9d71 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -4164,8 +4164,9 @@ 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("Godot Engine")) # Prints [0, 5, 6, 12] - print(ts.string_get_word_breaks("Godot Engine", "en", 5)) # Prints [0, 5, 6, 11, 11, 12] + 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" .. rst-class:: classref-item-separator diff --git a/classes/class_webxrinterface.rst b/classes/class_webxrinterface.rst index e99fd78f484..de4deb8f978 100644 --- a/classes/class_webxrinterface.rst +++ b/classes/class_webxrinterface.rst @@ -75,9 +75,10 @@ Here's the minimum code required to start an immersive VR session: # supported. webxr_interface.requested_reference_space_types = 'bounded-floor, local-floor, local' # In order to use 'local-floor' or 'bounded-floor' we must also - # mark the features as required or optional. + # mark the features as required or optional. By including 'hand-tracking' + # as an optional feature, it will be enabled if supported. webxr_interface.required_features = 'local-floor' - webxr_interface.optional_features = 'bounded-floor' + webxr_interface.optional_features = 'bounded-floor, hand-tracking' # This will return false if we're unable to even request the session, # however, it can still fail asynchronously later in the process, so we @@ -94,7 +95,10 @@ Here's the minimum code required to start an immersive VR session: # This will be the reference space type you ultimately got, out of the # types that you requested above. This is useful if you want the game to # work a little differently in 'bounded-floor' versus 'local-floor'. - print ("Reference space type: " + webxr_interface.reference_space_type) + print("Reference space type: ", webxr_interface.reference_space_type) + # This will be the list of features that were successfully enabled + # (except on browsers that don't support this property). + print("Enabled features: ", webxr_interface.enabled_features) func _webxr_session_ended(): $Button.visible = true @@ -419,7 +423,9 @@ Property Descriptions A comma-separated list of features that were successfully enabled by :ref:`XRInterface.initialize` when setting up the WebXR session. -This may include features requested by setting :ref:`required_features` and :ref:`optional_features`. +This may include features requested by setting :ref:`required_features` and :ref:`optional_features`, and will only be available after :ref:`session_started` has been emitted. + +\ **Note:** This may not be support by all web browsers, in which case it will be an empty string. .. rst-class:: classref-item-separator @@ -442,7 +448,7 @@ If a user's browser or device doesn't support one of the given features, initial This doesn't have any effect on the interface when already initialized. -Possible values come from `WebXR's XRReferenceSpaceType `__. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. +Possible values come from `WebXR's XRReferenceSpaceType `__, or include other features like ``"hand-tracking"`` to enable hand tracking. .. rst-class:: classref-item-separator @@ -506,7 +512,7 @@ If a user's browser or device doesn't support one of the given features, initial This doesn't have any effect on the interface when already initialized. -Possible values come from `WebXR's XRReferenceSpaceType `__. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. +Possible values come from `WebXR's XRReferenceSpaceType `__, or include other features like ``"hand-tracking"`` to enable hand tracking. .. rst-class:: classref-item-separator