diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index a514d7cbf..fb444e7b0 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -51,6 +51,8 @@ Properties +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`EngineDebugger` | :ref:`EngineDebugger` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`GDExtensionManager` | :ref:`GDExtensionManager` | + +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Geometry2D` | :ref:`Geometry2D` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Geometry3D` | :ref:`Geometry3D` | @@ -69,8 +71,6 @@ Properties +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Marshalls` | :ref:`Marshalls` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ - | :ref:`NativeExtensionManager` | :ref:`NativeExtensionManager` | - +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`NavigationMeshGenerator` | :ref:`NavigationMeshGenerator` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`NavigationServer2D` | :ref:`NavigationServer2D` | @@ -585,6 +585,14 @@ Aligns the top of the inline object (e.g. image, table) to the position of the t Aligns the center of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGNMENT_TO_*`` constant. +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BASELINE_TO: + +.. rst-class:: classref-enumeration-constant + +:ref:`InlineAlignment` **INLINE_ALIGNMENT_BASELINE_TO** = ``3`` + +Aligns the baseline (user defined) of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGNMENT_TO_*`` constant. + .. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BOTTOM_TO: .. rst-class:: classref-enumeration-constant @@ -5277,6 +5285,18 @@ The :ref:`EngineDebugger` singleton. ---- +.. _class_@GlobalScope_property_GDExtensionManager: + +.. rst-class:: classref-property + +:ref:`GDExtensionManager` **GDExtensionManager** + +The :ref:`GDExtensionManager` singleton. + +.. rst-class:: classref-item-separator + +---- + .. _class_@GlobalScope_property_Geometry2D: .. rst-class:: classref-property @@ -5389,18 +5409,6 @@ The :ref:`Marshalls` singleton. ---- -.. _class_@GlobalScope_property_NativeExtensionManager: - -.. rst-class:: classref-property - -:ref:`NativeExtensionManager` **NativeExtensionManager** - -The :ref:`NativeExtensionManager` singleton. - -.. rst-class:: classref-item-separator - ----- - .. _class_@GlobalScope_property_NavigationMeshGenerator: .. rst-class:: classref-property diff --git a/classes/class_array.rst b/classes/class_array.rst index d484c65b0..976795f62 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -859,7 +859,7 @@ Returns a random value from the target array. :: - var array: Array\ :ref:`int` = [1, 2, 3, 4] + var array: Array[int] = [1, 2, 3, 4] print(array.pick_random()) # Prints either of the four numbers. .. rst-class:: classref-item-separator diff --git a/classes/class_astargrid2d.rst b/classes/class_astargrid2d.rst index 49b1a5539..d5976e56f 100644 --- a/classes/class_astargrid2d.rst +++ b/classes/class_astargrid2d.rst @@ -121,7 +121,7 @@ enum **Heuristic**: :ref:`Heuristic` **HEURISTIC_EUCLIDEAN** = ``0`` -The Euclidean heuristic to be used for the pathfinding using the following formula: +The `Euclidean heuristic `__ to be used for the pathfinding using the following formula: :: @@ -129,13 +129,15 @@ The Euclidean heuristic to be used for the pathfinding using the following formu dy = abs(to_id.y - from_id.y) result = sqrt(dx * dx + dy * dy) +\ **Note:** This is also the internal heuristic used in :ref:`AStar3D` and :ref:`AStar2D` by default (with the inclusion of possible z-axis coordinate). + .. _class_AStarGrid2D_constant_HEURISTIC_MANHATTAN: .. rst-class:: classref-enumeration-constant :ref:`Heuristic` **HEURISTIC_MANHATTAN** = ``1`` -The Manhattan heuristic to be used for the pathfinding using the following formula: +The `Manhattan heuristic `__ to be used for the pathfinding using the following formula: :: @@ -143,6 +145,8 @@ The Manhattan heuristic to be used for the pathfinding using the following formu dy = abs(to_id.y - from_id.y) result = dx + dy +\ **Note:** This heuristic is intended to be used with 4-side orthogonal movements, provided by setting the :ref:`diagonal_mode` to :ref:`DIAGONAL_MODE_NEVER`. + .. _class_AStarGrid2D_constant_HEURISTIC_OCTILE: .. rst-class:: classref-enumeration-constant @@ -164,7 +168,7 @@ The Octile heuristic to be used for the pathfinding using the following formula: :ref:`Heuristic` **HEURISTIC_CHEBYSHEV** = ``3`` -The Chebyshev heuristic to be used for the pathfinding using the following formula: +The `Chebyshev heuristic `__ to be used for the pathfinding using the following formula: :: @@ -468,6 +472,8 @@ void **set_point_solid** **(** :ref:`Vector2i` id, :ref:`bool` is not needed after the call of this function. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_audiostreamrandomizer.rst b/classes/class_audiostreamrandomizer.rst index b70c2a1f1..9c5cf4f17 100644 --- a/classes/class_audiostreamrandomizer.rst +++ b/classes/class_audiostreamrandomizer.rst @@ -84,7 +84,7 @@ enum **PlaybackMode**: :ref:`PlaybackMode` **PLAYBACK_RANDOM_NO_REPEATS** = ``0`` -Pick a stream at random according to the probability weights chosen for each stream, but avoid playing the same stream twice in a row whenever possible. +Pick a stream at random according to the probability weights chosen for each stream, but avoid playing the same stream twice in a row whenever possible. If only 1 sound is present in the pool, the same sound will always play, effectively allowing repeats to occur. .. _class_AudioStreamRandomizer_constant_PLAYBACK_RANDOM: @@ -92,7 +92,7 @@ Pick a stream at random according to the probability weights chosen for each str :ref:`PlaybackMode` **PLAYBACK_RANDOM** = ``1`` -Pick a stream at random according to the probability weights chosen for each stream. +Pick a stream at random according to the probability weights chosen for each stream. If only 1 sound is present in the pool, the same sound will always play. .. _class_AudioStreamRandomizer_constant_PLAYBACK_SEQUENTIAL: @@ -100,7 +100,7 @@ Pick a stream at random according to the probability weights chosen for each str :ref:`PlaybackMode` **PLAYBACK_SEQUENTIAL** = ``2`` -Play streams in the order they appear in the stream pool. +Play streams in the order they appear in the stream pool. If only 1 sound is present in the pool, the same sound will always play. .. rst-class:: classref-section-separator diff --git a/classes/class_backbuffercopy.rst b/classes/class_backbuffercopy.rst index 2c5741ea4..ad06cfb8e 100644 --- a/classes/class_backbuffercopy.rst +++ b/classes/class_backbuffercopy.rst @@ -19,9 +19,9 @@ Copies a region of the screen (or the whole screen) to a buffer so it can be acc Description ----------- -Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the ``texture(SCREEN_TEXTURE, ...)`` function in your shader scripts to access the buffer. +Node for back-buffering the currently-displayed screen. The region defined in the **BackBufferCopy** node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the ``texture(SCREEN_TEXTURE, ...)`` function in your shader scripts to access the buffer. -\ **Note:** Since this node inherits from :ref:`Node2D` (and not :ref:`Control`), anchors and margins won't apply to child :ref:`Control`-derived nodes. This can be problematic when resizing the window. To avoid this, add :ref:`Control`-derived nodes as *siblings* to the BackBufferCopy node instead of adding them as children. +\ **Note:** Since this node inherits from :ref:`Node2D` (and not :ref:`Control`), anchors and margins won't apply to child :ref:`Control`-derived nodes. This can be problematic when resizing the window. To avoid this, add :ref:`Control`-derived nodes as *siblings* to the **BackBufferCopy** node instead of adding them as children. .. rst-class:: classref-reftable-group @@ -58,7 +58,7 @@ enum **CopyMode**: :ref:`CopyMode` **COPY_MODE_DISABLED** = ``0`` -Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers. +Disables the buffering mode. This means the **BackBufferCopy** node will directly use the portion of screen it covers. .. _class_BackBufferCopy_constant_COPY_MODE_RECT: @@ -66,7 +66,7 @@ Disables the buffering mode. This means the BackBufferCopy node will directly us :ref:`CopyMode` **COPY_MODE_RECT** = ``1`` -BackBufferCopy buffers a rectangular region. +**BackBufferCopy** buffers a rectangular region. .. _class_BackBufferCopy_constant_COPY_MODE_VIEWPORT: @@ -74,7 +74,7 @@ BackBufferCopy buffers a rectangular region. :ref:`CopyMode` **COPY_MODE_VIEWPORT** = ``2`` -BackBufferCopy buffers the entire screen. +**BackBufferCopy** buffers the entire screen. .. rst-class:: classref-section-separator @@ -113,7 +113,7 @@ Buffer mode. See :ref:`CopyMode` constants. - void **set_rect** **(** :ref:`Rect2` value **)** - :ref:`Rect2` **get_rect** **(** **)** -The area covered by the BackBufferCopy. Only used if :ref:`copy_mode` is :ref:`COPY_MODE_RECT`. +The area covered by the **BackBufferCopy**. Only used if :ref:`copy_mode` is :ref:`COPY_MODE_RECT`. .. |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_canvasgroup.rst b/classes/class_canvasgroup.rst index 83cfc9298..79fc0a875 100644 --- a/classes/class_canvasgroup.rst +++ b/classes/class_canvasgroup.rst @@ -21,6 +21,22 @@ Description Child :ref:`CanvasItem` nodes of a **CanvasGroup** are drawn as a single object. It allows to e.g. draw overlapping translucent 2D nodes without blending (set :ref:`CanvasItem.self_modulate` property of **CanvasGroup** to achieve this effect). +\ **Note:** The **CanvasGroup** uses a custom shader to read from the backbuffer to draw its children. Assigning a :ref:`Material` to the **CanvasGroup** overrides the builtin shader. To duplicate the behavior of the builtin shader in a custom :ref:`Shader` use the following: + +:: + + shader_type canvas_item; + + void fragment() { + vec4 c = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0); + + if (c.a > 0.0001) { + c.rgb /= c.a; + } + + COLOR *= c; + } + \ **Note:** Since **CanvasGroup** and :ref:`CanvasItem.clip_children` both utilize the backbuffer, children of a **CanvasGroup** who have their :ref:`CanvasItem.clip_children` set to anything other than :ref:`CanvasItem.CLIP_CHILDREN_DISABLED` will not function correctly. .. rst-class:: classref-reftable-group @@ -59,9 +75,7 @@ Property Descriptions - void **set_clear_margin** **(** :ref:`float` value **)** - :ref:`float` **get_clear_margin** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Sets the size of the margin used to expand the clearing rect of this **CanvasGroup**. This expands the area of the backbuffer that will be used by the **CanvasGroup**. A smaller margin will reduce the area of the backbuffer used which can increase performance, however if :ref:`use_mipmaps` is enabled, a small margin may result in mipmap errors at the edge of the **CanvasGroup**. Accordingly, this should be left as small as possible, but should be increased if artifacts appear along the edges of the canvas group. .. rst-class:: classref-item-separator @@ -78,9 +92,7 @@ Property Descriptions - void **set_fit_margin** **(** :ref:`float` value **)** - :ref:`float` **get_fit_margin** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Sets the size of a margin used to expand the drawable rect of this **CanvasGroup**. The size of the **CanvasGroup** is determined by fitting a rect around its children then expanding that rect by :ref:`fit_margin`. This increases both the backbuffer area used and the area covered by the **CanvasGroup** both of which can reduce performance. This should be kept as small as possible and should only be expanded when an increased size is needed (e.g. for custom shader effects). .. rst-class:: classref-item-separator @@ -97,9 +109,7 @@ Property Descriptions - void **set_use_mipmaps** **(** :ref:`bool` value **)** - :ref:`bool` **is_using_mipmaps** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, calculates mipmaps for the backbuffer before drawing the **CanvasGroup** so that mipmaps can be used in a custom :ref:`ShaderMaterial` attached to the **CanvasGroup**. Generating mipmaps has a performance cost so this should not be enabled unless required. .. |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_canvasitem.rst b/classes/class_canvasitem.rst index a0139ea70..2231a62ef 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -117,7 +117,7 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_mesh` **(** :ref:`Mesh` mesh, :ref:`Texture2D` texture, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`Color` modulate=Color(1, 1, 1, 1) **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_msdf_texture_rect_region` **(** :ref:`Texture2D` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`float` outline=0.0, :ref:`float` pixel_range=4.0 **)** | + | void | :ref:`draw_msdf_texture_rect_region` **(** :ref:`Texture2D` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`float` outline=0.0, :ref:`float` pixel_range=4.0, :ref:`float` scale=1.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_multiline` **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -929,7 +929,7 @@ Draws a :ref:`Mesh` in 2D, using the provided texture. See :ref:`Mes .. rst-class:: classref-method -void **draw_msdf_texture_rect_region** **(** :ref:`Texture2D` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`float` outline=0.0, :ref:`float` pixel_range=4.0 **)** +void **draw_msdf_texture_rect_region** **(** :ref:`Texture2D` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`float` outline=0.0, :ref:`float` pixel_range=4.0, :ref:`float` scale=1.0 **)** Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See :ref:`FontFile.multichannel_signed_distance_field` for more information and caveats about MSDF font rendering. @@ -1228,7 +1228,7 @@ Returns the canvas item RID used by :ref:`RenderingServer :ref:`Transform2D` **get_canvas_transform** **(** **)** |const| -Returns the transform matrix of this item's canvas. +Returns the transform from the coordinate system of the canvas, this item is in, to the :ref:`Viewport`\ s coordinate system. .. rst-class:: classref-item-separator @@ -1264,7 +1264,7 @@ Returns the global transform matrix of this item, i.e. the combined transform up :ref:`Transform2D` **get_global_transform_with_canvas** **(** **)** |const| -Returns the global transform matrix of this item in relation to the canvas. +Returns the transform from the local coordinate system of this **CanvasItem** to the :ref:`Viewport`\ s coordinate system. .. rst-class:: classref-item-separator @@ -1326,7 +1326,7 @@ Returns the viewport's boundaries as a :ref:`Rect2`. :ref:`Transform2D` **get_viewport_transform** **(** **)** |const| -Returns this item's transform in relation to the viewport. +Returns the transform from the coordinate system of the canvas, this item is in, to the :ref:`Viewport`\ s embedders coordinate system. .. rst-class:: classref-item-separator diff --git a/classes/class_canvaslayer.rst b/classes/class_canvaslayer.rst index 3677aee8f..e32004afd 100644 --- a/classes/class_canvaslayer.rst +++ b/classes/class_canvaslayer.rst @@ -72,13 +72,15 @@ Methods .. table:: :widths: auto - +-----------------------+----------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`get_canvas` **(** **)** |const| | - +-----------------------+----------------------------------------------------------------------------+ - | void | :ref:`hide` **(** **)** | - +-----------------------+----------------------------------------------------------------------------+ - | void | :ref:`show` **(** **)** | - +-----------------------+----------------------------------------------------------------------------+ + +---------------------------------------+----------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_canvas` **(** **)** |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`get_final_transform` **(** **)** |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------+ + | void | :ref:`hide` **(** **)** | + +---------------------------------------+----------------------------------------------------------------------------------------------+ + | void | :ref:`show` **(** **)** | + +---------------------------------------+----------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -280,6 +282,18 @@ Returns the RID of the canvas used by this layer. ---- +.. _class_CanvasLayer_method_get_final_transform: + +.. rst-class:: classref-method + +:ref:`Transform2D` **get_final_transform** **(** **)** |const| + +Returns the transform from the **CanvasLayer**\ s coordinate system to the :ref:`Viewport`\ s coordinate system. + +.. rst-class:: classref-item-separator + +---- + .. _class_CanvasLayer_method_hide: .. rst-class:: classref-method diff --git a/classes/class_collisionobject2d.rst b/classes/class_collisionobject2d.rst index c6a72e083..123f41887 100644 --- a/classes/class_collisionobject2d.rst +++ b/classes/class_collisionobject2d.rst @@ -576,7 +576,7 @@ Returns the parent object of the given shape owner. :ref:`Shape2D` **shape_owner_get_shape** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| -Returns the :ref:`Shape2D` with the given id from the given shape owner. +Returns the :ref:`Shape2D` with the given ID from the given shape owner. .. rst-class:: classref-item-separator @@ -600,7 +600,7 @@ Returns the number of shapes the given shape owner contains. :ref:`int` **shape_owner_get_shape_index** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| -Returns the child index of the :ref:`Shape2D` with the given id from the given shape owner. +Returns the child index of the :ref:`Shape2D` with the given ID from the given shape owner. .. rst-class:: classref-item-separator diff --git a/classes/class_collisionobject3d.rst b/classes/class_collisionobject3d.rst index 51a3e4ba5..c9b3e64e6 100644 --- a/classes/class_collisionobject3d.rst +++ b/classes/class_collisionobject3d.rst @@ -509,7 +509,7 @@ Returns the parent object of the given shape owner. :ref:`Shape3D` **shape_owner_get_shape** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| -Returns the :ref:`Shape3D` with the given id from the given shape owner. +Returns the :ref:`Shape3D` with the given ID from the given shape owner. .. rst-class:: classref-item-separator @@ -533,7 +533,7 @@ Returns the number of shapes the given shape owner contains. :ref:`int` **shape_owner_get_shape_index** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| -Returns the child index of the :ref:`Shape3D` with the given id from the given shape owner. +Returns the child index of the :ref:`Shape3D` with the given ID from the given shape owner. .. rst-class:: classref-item-separator diff --git a/classes/class_color.rst b/classes/class_color.rst index dda4a7bac..cab1d374e 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -1795,12 +1795,23 @@ Returns the **Color** associated with the provided ``hex`` integer in 32-bit ARG In GDScript and C#, the :ref:`int` is best visualized with hexadecimal notation (``"0x"`` prefix). -:: + +.. tabs:: + + .. code-tab:: gdscript var red = Color.hex(0xffff0000) var dark_cyan = Color.hex(0xff008b8b) var my_color = Color.hex(0xa4bbefd2) + .. code-tab:: csharp + + var red = new Color(0xffff0000); + var dark_cyan = new Color(0xff008b8b); + var my_color = new Color(0xa4bbefd2); + + + .. rst-class:: classref-item-separator ---- @@ -1842,9 +1853,9 @@ Returns a new color from ``rgba``, an HTML hexadecimal color string. ``rgba`` is .. code-tab:: csharp - var blue = new Color("#0000ff"); // blue is Color(0.0, 0.0, 1.0, 1.0) - var green = new Color("#0F0"); // green is Color(0.0, 1.0, 0.0, 1.0) - var col = new Color("663399cc"); // col is Color(0.4, 0.2, 0.6, 0.8) + var blue = Color.FromHtml("#0000ff"); // blue is Color(0.0, 0.0, 1.0, 1.0) + var green = Color.FromHtml("#0F0"); // green is Color(0.0, 1.0, 0.0, 1.0) + var col = Color.FromHtml("663399cc"); // col is Color(0.4, 0.2, 0.6, 0.8) @@ -1875,14 +1886,13 @@ Returns ``true`` if ``color`` is a valid HTML hexadecimal color string. The stri .. code-tab:: csharp - // This method is not available in C#. Use `StringExtensions.IsValidHtmlColor()`, instead. - "#55AAFF".IsValidHtmlColor(); // Returns true - "#55AAFF20".IsValidHtmlColor(); // Returns true - "55AAFF".IsValidHtmlColor(); // Returns true - "#F2C".IsValidHtmlColor(); // Returns true + Color.IsHtmlValid("#55AAFF"); // Returns true + Color.IsHtmlValid("#55AAFF20"); // Returns true + Color.IsHtmlValid("55AAFF"); // Returns true + Color.IsHtmlValid("#F2C"); // Returns true - "#AABBC".IsValidHtmlColor(); // Returns false - "#55aaFF5".IsValidHtmlColor(); // Returns false + Color.IsHtmlValid("#AABBC"); // Returns false + Color.IsHtmlValid("#55aaFF5"); // Returns false diff --git a/classes/class_control.rst b/classes/class_control.rst index 44edcfaa9..f35b73fee 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -121,6 +121,8 @@ Properties +------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ | :ref:`float` | :ref:`rotation` | ``0.0`` | +------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`rotation_degrees` | | + +------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ | :ref:`Vector2` | :ref:`scale` | ``Vector2(1, 1)`` | +------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ | :ref:`Node` | :ref:`shortcut_context` | | @@ -1653,6 +1655,23 @@ The node's rotation around its pivot, in radians. See :ref:`pivot_offset` **rotation_degrees** + +.. rst-class:: classref-property-setget + +- void **set_rotation_degrees** **(** :ref:`float` value **)** +- :ref:`float` **get_rotation_degrees** **(** **)** + +Helper property to access :ref:`rotation` in degrees instead of radians. + +.. rst-class:: classref-item-separator + +---- + .. _class_Control_property_scale: .. rst-class:: classref-property @@ -1769,7 +1788,9 @@ Tells the parent :ref:`Container` nodes how they should resize - void **set_theme** **(** :ref:`Theme` value **)** - :ref:`Theme` **get_theme** **(** **)** -The :ref:`Theme` resource this node and all its **Control** children use. If a child node has its own :ref:`Theme` resource set, theme items are merged with child's definitions having higher priority. +The :ref:`Theme` resource this node and all its **Control** and :ref:`Window` children use. If a child node has its own :ref:`Theme` resource set, theme items are merged with child's definitions having higher priority. + +\ **Note:** :ref:`Window` styles will have no effect unless the window is embedded. .. rst-class:: classref-item-separator diff --git a/classes/class_curve3d.rst b/classes/class_curve3d.rst index fbf64751e..4cd45ef26 100644 --- a/classes/class_curve3d.rst +++ b/classes/class_curve3d.rst @@ -378,7 +378,7 @@ If the curve has no up vectors, the function sends an error to the console, and :ref:`Transform3D` **sample_baked_with_rotation** **(** :ref:`float` offset=0.0, :ref:`bool` cubic=false, :ref:`bool` apply_tilt=false **)** |const| -Similar with ``interpolate_baked()``. The the return value is ``Transform3D``, with ``origin`` as point position, ``basis.x`` as sideway vector, ``basis.y`` as up vector, ``basis.z`` as forward vector. When the curve length is 0, there is no reasonable way to caculate the rotation, all vectors aligned with global space axes. +Similar with ``interpolate_baked()``. The the return value is ``Transform3D``, with ``origin`` as point position, ``basis.x`` as sideway vector, ``basis.y`` as up vector, ``basis.z`` as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. .. rst-class:: classref-item-separator diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index d0ec62138..c290c6a74 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -189,7 +189,7 @@ The keys of a dictionary can be iterated with the ``for`` keyword: \ **Note:** Erasing elements while iterating over dictionaries is **not** supported and will result in unpredictable behavior. -\ **Note:** When declaring a dictionary with ``const``, the dictionary becomes read-only. A read-only Dictionary's entries cannot be overriden at run-time. This does *not* affect nested :ref:`Array` and **Dictionary** values. +\ **Note:** When declaring a dictionary with ``const``, the dictionary becomes read-only. A read-only Dictionary's entries cannot be overridden at run-time. This does *not* affect nested :ref:`Array` and **Dictionary** values. .. rst-class:: classref-introduction-group diff --git a/classes/class_displayserver.rst b/classes/class_displayserver.rst index f09fce961..ac2bad7d6 100644 --- a/classes/class_displayserver.rst +++ b/classes/class_displayserver.rst @@ -170,6 +170,8 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_dark_mode_supported` **(** **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_touchscreen_available` **(** **)** |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`keyboard_get_current_layout` **(** **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Key` | :ref:`keyboard_get_keycode_from_physical` **(** :ref:`Key` keycode **)** |const| | @@ -210,8 +212,6 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`screen_is_kept_on` **(** **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`screen_is_touchscreen` **(** :ref:`int` screen=-1 **)** |const| | - +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`screen_set_keep_on` **(** :ref:`bool` enable **)** | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`screen_set_orientation` **(** :ref:`ScreenOrientation` orientation, :ref:`int` screen=-1 **)** | @@ -276,12 +276,14 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_position` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_real_size` **(** :ref:`int` window_id=0 **)** |const| | + | :ref:`Vector2i` | :ref:`window_get_position_with_decorations` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3i` | :ref:`window_get_safe_title_margins` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_size_with_decorations` **(** :ref:`int` window_id=0 **)** |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`VSyncMode` | :ref:`window_get_vsync_mode` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`window_is_maximize_allowed` **(** :ref:`int` window_id=0 **)** |const| | @@ -900,9 +902,11 @@ Maximized window mode, i.e. :ref:`Window` will occupy whole screen :ref:`WindowMode` **WINDOW_MODE_FULLSCREEN** = ``3`` -Full screen window mode. Note that this is not *exclusive* full screen. On Windows and Linux (X11), a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. +Full screen mode with full multi-window support. -Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode. +Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed. + +\ **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN: @@ -910,13 +914,17 @@ Regardless of the platform, enabling full screen will change the window size to :ref:`WindowMode` **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = ``4`` -Exclusive full screen window mode. This mode is implemented on Windows and macOS only. On other platforms, it is equivalent to :ref:`WINDOW_MODE_FULLSCREEN`. +A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition). -\ **On Windows:** Only one window in exclusive full screen mode can be visible on a given screen at a time. If multiple windows are in exclusive full screen mode for the same screen, the last one being set to this mode takes precedence. +Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed. -\ **On macOS:** Exclusive full-screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen. +\ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment. -Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode. +\ **On macOS:** Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen. + +\ **On Linux (X11):** Exclusive full screen mode bypasses compositor. + +\ **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode. .. rst-class:: classref-item-separator @@ -2341,6 +2349,18 @@ Returns ``true`` if OS supports dark mode. ---- +.. _class_DisplayServer_method_is_touchscreen_available: + +.. rst-class:: classref-method + +:ref:`bool` **is_touchscreen_available** **(** **)** |const| + +Returns ``true`` if touch events are available (Android or iOS), the capability is detected on the Webplatform or if :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse` is ``true``. + +.. rst-class:: classref-item-separator + +---- + .. _class_DisplayServer_method_keyboard_get_current_layout: .. rst-class:: classref-method @@ -2639,18 +2659,6 @@ Returns ``true`` if the screen should never be turned off by the operating syste ---- -.. _class_DisplayServer_method_screen_is_touchscreen: - -.. rst-class:: classref-method - -:ref:`bool` **screen_is_touchscreen** **(** :ref:`int` screen=-1 **)** |const| - -Returns ``true`` if the screen can send touch events or if :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse` is ``true``. - -.. rst-class:: classref-item-separator - ----- - .. _class_DisplayServer_method_screen_set_keep_on: .. rst-class:: classref-method @@ -3099,19 +3107,19 @@ Returns the bounding box of control, or menu item that was used to open the popu :ref:`Vector2i` **window_get_position** **(** :ref:`int` window_id=0 **)** |const| -Returns the position of the given window to on the screen. +Returns the position of the client area of the given window on the screen. .. rst-class:: classref-item-separator ---- -.. _class_DisplayServer_method_window_get_real_size: +.. _class_DisplayServer_method_window_get_position_with_decorations: .. rst-class:: classref-method -:ref:`Vector2i` **window_get_real_size** **(** :ref:`int` window_id=0 **)** |const| +:ref:`Vector2i` **window_get_position_with_decorations** **(** :ref:`int` window_id=0 **)** |const| -Returns the size of the window specified by ``window_id`` (in pixels), including the borders drawn by the operating system. See also :ref:`window_get_size`. +Returns the position of the given window on the screen including the borders drawn by the operating system. See also :ref:`window_get_position`. .. rst-class:: classref-item-separator @@ -3135,7 +3143,19 @@ Returns left margins (``x``), right margins (``y``) and height (``z``) of the ti :ref:`Vector2i` **window_get_size** **(** :ref:`int` window_id=0 **)** |const| -Returns the size of the window specified by ``window_id`` (in pixels), excluding the borders drawn by the operating system. This is also called the "client area". See also :ref:`window_get_real_size`, :ref:`window_set_size` and :ref:`window_get_position`. +Returns the size of the window specified by ``window_id`` (in pixels), excluding the borders drawn by the operating system. This is also called the "client area". See also :ref:`window_get_size_with_decorations`, :ref:`window_set_size` and :ref:`window_get_position`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_DisplayServer_method_window_get_size_with_decorations: + +.. rst-class:: classref-method + +:ref:`Vector2i` **window_get_size_with_decorations** **(** :ref:`int` window_id=0 **)** |const| + +Returns the size of the window specified by ``window_id`` (in pixels), including the borders drawn by the operating system. See also :ref:`window_get_size`. .. rst-class:: classref-item-separator diff --git a/classes/class_editorpaths.rst b/classes/class_editorpaths.rst index 40a6adbe0..f23fe30ee 100644 --- a/classes/class_editorpaths.rst +++ b/classes/class_editorpaths.rst @@ -23,7 +23,7 @@ This editor-only singleton returns OS-specific paths to various data folders and \ **Note:** This singleton is not accessible in exported projects. Attempting to access it in an exported project will result in a script error as the singleton won't be declared. To prevent script errors in exported projects, use :ref:`Engine.has_singleton` to check whether the singleton is available before using it. -\ **Note:** Godot complies with the `XDG Base Directory Specification `__ on *all* platforms. You can override environment variables following the specification to change the editor and project data paths. +\ **Note:** On the Linux/BSD platform, Godot complies with the `XDG Base Directory Specification `__. You can override environment variables following the specification to change the editor and project data paths. .. rst-class:: classref-introduction-group diff --git a/classes/class_editorscenepostimport.rst b/classes/class_editorscenepostimport.rst index ed02e2d1f..63a5a2aa9 100644 --- a/classes/class_editorscenepostimport.rst +++ b/classes/class_editorscenepostimport.rst @@ -49,12 +49,12 @@ The :ref:`_post_import` callbac // This sample changes all node names. // Called right after the scene is imported and gets the root node. [Tool] - public class NodeRenamer : EditorScenePostImport + public partial class NodeRenamer : EditorScenePostImport { - public override Object PostImport(Object scene) + public override Object _PostImport(Node scene) { // Change all node names to "modified_[oldnodename]" - Iterate(scene as Node); + Iterate(scene); return scene; // Remember to return the imported scene } public void Iterate(Node node) diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index d37239298..1350a25d2 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -325,6 +325,8 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`network/tls/editor_tls_certificates` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`project_manager/default_renderer` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`project_manager/sorting_order` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`run/auto_save/save_before_running` | @@ -2289,6 +2291,18 @@ The TLS certificate bundle to use for HTTP requests made within the editor (e.g. ---- +.. _class_EditorSettings_property_project_manager/default_renderer: + +.. rst-class:: classref-property + +:ref:`String` **project_manager/default_renderer** + +The renderer type that will be checked off by default when creating a new project. Accepted strings are "forward_plus", "mobile" or "gl_compatibility". + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_project_manager/sorting_order: .. rst-class:: classref-property diff --git a/classes/class_editorundoredomanager.rst b/classes/class_editorundoredomanager.rst index 1f8544361..fb2148b9f 100644 --- a/classes/class_editorundoredomanager.rst +++ b/classes/class_editorundoredomanager.rst @@ -115,6 +115,14 @@ enum **SpecialHistory**: Global history not associated with any scene, but with external resources etc. +.. _class_EditorUndoRedoManager_constant_REMOTE_HISTORY: + +.. rst-class:: classref-enumeration-constant + +:ref:`SpecialHistory` **REMOTE_HISTORY** = ``-9`` + +History associated with remote inspector. Used when live editing a running project. + .. _class_EditorUndoRedoManager_constant_INVALID_HISTORY: .. rst-class:: classref-enumeration-constant diff --git a/classes/class_float.rst b/classes/class_float.rst index cc4290581..d7e59a9a1 100644 --- a/classes/class_float.rst +++ b/classes/class_float.rst @@ -19,7 +19,7 @@ Description The **float** built-in type is a 64-bit double-precision floating-point number, equivalent to ``double`` in C++. This type has 14 reliable decimal digits of precision. The **float** type can be stored in :ref:`Variant`, which is the generic type used by the engine. The maximum value of **float** is approximately ``1.79769e308``, and the minimum is approximately ``-1.79769e308``. -Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to ``float`` in C++, which have 6 reliable decimal digits of precision. For data structures such as :ref:`Vector2` and :ref:`Vector3`, Godot uses 32-bit floating-point numbers by default, but it can be changed to use 64-bit doubles if Godot is compiled with the ``float=64`` option. +Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to ``float`` in C++, which have 6 reliable decimal digits of precision. For data structures such as :ref:`Vector2` and :ref:`Vector3`, Godot uses 32-bit floating-point numbers by default, but it can be changed to use 64-bit doubles if Godot is compiled with the ``precision=double`` option. Math done using the **float** type is not guaranteed to be exact or deterministic, and will often result in small errors. You should usually use the :ref:`@GlobalScope.is_equal_approx` and :ref:`@GlobalScope.is_zero_approx` methods instead of ``==`` to compare **float** values for equality. diff --git a/classes/class_nativeextension.rst b/classes/class_gdextension.rst similarity index 59% rename from classes/class_nativeextension.rst rename to classes/class_gdextension.rst index 37d5118ad..fbac307a2 100644 --- a/classes/class_nativeextension.rst +++ b/classes/class_gdextension.rst @@ -3,12 +3,12 @@ .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. -.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/NativeExtension.xml. +.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GDExtension.xml. -.. _class_NativeExtension: +.. _class_GDExtension: -NativeExtension -=============== +GDExtension +=========== **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` @@ -24,17 +24,17 @@ Methods .. table:: :widths: auto - +----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`close_library` **(** **)** | - +----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`InitializationLevel` | :ref:`get_minimum_library_initialization_level` **(** **)** |const| | - +----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`initialize_library` **(** :ref:`InitializationLevel` level **)** | - +----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_library_open` **(** **)** |const| | - +----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`open_library` **(** :ref:`String` path, :ref:`String` entry_symbol **)** | - +----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`close_library` **(** **)** | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`InitializationLevel` | :ref:`get_minimum_library_initialization_level` **(** **)** |const| | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`initialize_library` **(** :ref:`InitializationLevel` level **)** | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_library_open` **(** **)** |const| | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`open_library` **(** :ref:`String` path, :ref:`String` entry_symbol **)** | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -45,41 +45,41 @@ Methods Enumerations ------------ -.. _enum_NativeExtension_InitializationLevel: +.. _enum_GDExtension_InitializationLevel: .. rst-class:: classref-enumeration enum **InitializationLevel**: -.. _class_NativeExtension_constant_INITIALIZATION_LEVEL_CORE: +.. _class_GDExtension_constant_INITIALIZATION_LEVEL_CORE: .. rst-class:: classref-enumeration-constant -:ref:`InitializationLevel` **INITIALIZATION_LEVEL_CORE** = ``0`` +:ref:`InitializationLevel` **INITIALIZATION_LEVEL_CORE** = ``0`` -.. _class_NativeExtension_constant_INITIALIZATION_LEVEL_SERVERS: +.. _class_GDExtension_constant_INITIALIZATION_LEVEL_SERVERS: .. rst-class:: classref-enumeration-constant -:ref:`InitializationLevel` **INITIALIZATION_LEVEL_SERVERS** = ``1`` +:ref:`InitializationLevel` **INITIALIZATION_LEVEL_SERVERS** = ``1`` -.. _class_NativeExtension_constant_INITIALIZATION_LEVEL_SCENE: +.. _class_GDExtension_constant_INITIALIZATION_LEVEL_SCENE: .. rst-class:: classref-enumeration-constant -:ref:`InitializationLevel` **INITIALIZATION_LEVEL_SCENE** = ``2`` +:ref:`InitializationLevel` **INITIALIZATION_LEVEL_SCENE** = ``2`` -.. _class_NativeExtension_constant_INITIALIZATION_LEVEL_EDITOR: +.. _class_GDExtension_constant_INITIALIZATION_LEVEL_EDITOR: .. rst-class:: classref-enumeration-constant -:ref:`InitializationLevel` **INITIALIZATION_LEVEL_EDITOR** = ``3`` +:ref:`InitializationLevel` **INITIALIZATION_LEVEL_EDITOR** = ``3`` @@ -92,7 +92,7 @@ enum **InitializationLevel**: Method Descriptions ------------------- -.. _class_NativeExtension_method_close_library: +.. _class_GDExtension_method_close_library: .. rst-class:: classref-method @@ -106,11 +106,11 @@ void **close_library** **(** **)** ---- -.. _class_NativeExtension_method_get_minimum_library_initialization_level: +.. _class_GDExtension_method_get_minimum_library_initialization_level: .. rst-class:: classref-method -:ref:`InitializationLevel` **get_minimum_library_initialization_level** **(** **)** |const| +:ref:`InitializationLevel` **get_minimum_library_initialization_level** **(** **)** |const| .. container:: contribute @@ -120,11 +120,11 @@ void **close_library** **(** **)** ---- -.. _class_NativeExtension_method_initialize_library: +.. _class_GDExtension_method_initialize_library: .. rst-class:: classref-method -void **initialize_library** **(** :ref:`InitializationLevel` level **)** +void **initialize_library** **(** :ref:`InitializationLevel` level **)** .. container:: contribute @@ -134,7 +134,7 @@ void **initialize_library** **(** :ref:`InitializationLevel` @@ -24,19 +24,19 @@ Methods .. table:: :widths: auto - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`NativeExtension` | :ref:`get_extension` **(** :ref:`String` path **)** | - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_loaded_extensions` **(** **)** |const| | - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_extension_loaded` **(** :ref:`String` path **)** |const| | - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`LoadStatus` | :ref:`load_extension` **(** :ref:`String` path **)** | - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`LoadStatus` | :ref:`reload_extension` **(** :ref:`String` path **)** | - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`LoadStatus` | :ref:`unload_extension` **(** :ref:`String` path **)** | - +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`GDExtension` | :ref:`get_extension` **(** :ref:`String` path **)** | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_loaded_extensions` **(** **)** |const| | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_extension_loaded` **(** :ref:`String` path **)** |const| | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`LoadStatus` | :ref:`load_extension` **(** :ref:`String` path **)** | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`LoadStatus` | :ref:`reload_extension` **(** :ref:`String` path **)** | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`LoadStatus` | :ref:`unload_extension` **(** :ref:`String` path **)** | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -47,49 +47,49 @@ Methods Enumerations ------------ -.. _enum_NativeExtensionManager_LoadStatus: +.. _enum_GDExtensionManager_LoadStatus: .. rst-class:: classref-enumeration enum **LoadStatus**: -.. _class_NativeExtensionManager_constant_LOAD_STATUS_OK: +.. _class_GDExtensionManager_constant_LOAD_STATUS_OK: .. rst-class:: classref-enumeration-constant -:ref:`LoadStatus` **LOAD_STATUS_OK** = ``0`` +:ref:`LoadStatus` **LOAD_STATUS_OK** = ``0`` -.. _class_NativeExtensionManager_constant_LOAD_STATUS_FAILED: +.. _class_GDExtensionManager_constant_LOAD_STATUS_FAILED: .. rst-class:: classref-enumeration-constant -:ref:`LoadStatus` **LOAD_STATUS_FAILED** = ``1`` +:ref:`LoadStatus` **LOAD_STATUS_FAILED** = ``1`` -.. _class_NativeExtensionManager_constant_LOAD_STATUS_ALREADY_LOADED: +.. _class_GDExtensionManager_constant_LOAD_STATUS_ALREADY_LOADED: .. rst-class:: classref-enumeration-constant -:ref:`LoadStatus` **LOAD_STATUS_ALREADY_LOADED** = ``2`` +:ref:`LoadStatus` **LOAD_STATUS_ALREADY_LOADED** = ``2`` -.. _class_NativeExtensionManager_constant_LOAD_STATUS_NOT_LOADED: +.. _class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED: .. rst-class:: classref-enumeration-constant -:ref:`LoadStatus` **LOAD_STATUS_NOT_LOADED** = ``3`` +:ref:`LoadStatus` **LOAD_STATUS_NOT_LOADED** = ``3`` -.. _class_NativeExtensionManager_constant_LOAD_STATUS_NEEDS_RESTART: +.. _class_GDExtensionManager_constant_LOAD_STATUS_NEEDS_RESTART: .. rst-class:: classref-enumeration-constant -:ref:`LoadStatus` **LOAD_STATUS_NEEDS_RESTART** = ``4`` +:ref:`LoadStatus` **LOAD_STATUS_NEEDS_RESTART** = ``4`` @@ -102,11 +102,11 @@ enum **LoadStatus**: Method Descriptions ------------------- -.. _class_NativeExtensionManager_method_get_extension: +.. _class_GDExtensionManager_method_get_extension: .. rst-class:: classref-method -:ref:`NativeExtension` **get_extension** **(** :ref:`String` path **)** +:ref:`GDExtension` **get_extension** **(** :ref:`String` path **)** .. container:: contribute @@ -116,7 +116,7 @@ Method Descriptions ---- -.. _class_NativeExtensionManager_method_get_loaded_extensions: +.. _class_GDExtensionManager_method_get_loaded_extensions: .. rst-class:: classref-method @@ -130,7 +130,7 @@ Method Descriptions ---- -.. _class_NativeExtensionManager_method_is_extension_loaded: +.. _class_GDExtensionManager_method_is_extension_loaded: .. rst-class:: classref-method @@ -144,11 +144,11 @@ Method Descriptions ---- -.. _class_NativeExtensionManager_method_load_extension: +.. _class_GDExtensionManager_method_load_extension: .. rst-class:: classref-method -:ref:`LoadStatus` **load_extension** **(** :ref:`String` path **)** +:ref:`LoadStatus` **load_extension** **(** :ref:`String` path **)** .. container:: contribute @@ -158,11 +158,11 @@ Method Descriptions ---- -.. _class_NativeExtensionManager_method_reload_extension: +.. _class_GDExtensionManager_method_reload_extension: .. rst-class:: classref-method -:ref:`LoadStatus` **reload_extension** **(** :ref:`String` path **)** +:ref:`LoadStatus` **reload_extension** **(** :ref:`String` path **)** .. container:: contribute @@ -172,11 +172,11 @@ Method Descriptions ---- -.. _class_NativeExtensionManager_method_unload_extension: +.. _class_GDExtensionManager_method_unload_extension: .. rst-class:: classref-method -:ref:`LoadStatus` **unload_extension** **(** :ref:`String` path **)** +:ref:`LoadStatus` **unload_extension** **(** :ref:`String` path **)** .. container:: contribute diff --git a/classes/class_geometryinstance3d.rst b/classes/class_geometryinstance3d.rst index 255f3da2e..57696d970 100644 --- a/classes/class_geometryinstance3d.rst +++ b/classes/class_geometryinstance3d.rst @@ -31,35 +31,37 @@ Properties .. table:: :widths: auto - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`ShadowCastingSetting` | :ref:`cast_shadow` | ``1`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`extra_cull_margin` | ``0.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`LightmapScale` | :ref:`gi_lightmap_scale` | ``0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`GIMode` | :ref:`gi_mode` | ``1`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`ignore_occlusion_culling` | ``false`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`lod_bias` | ``1.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`Material` | :ref:`material_overlay` | | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`Material` | :ref:`material_override` | | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`transparency` | ``0.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`visibility_range_begin` | ``0.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`visibility_range_begin_margin` | ``0.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`visibility_range_end` | ``0.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`visibility_range_end_margin` | ``0.0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`VisibilityRangeFadeMode` | :ref:`visibility_range_fade_mode` | ``0`` | - +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`ShadowCastingSetting` | :ref:`cast_shadow` | ``1`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`AABB` | :ref:`custom_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`extra_cull_margin` | ``0.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`LightmapScale` | :ref:`gi_lightmap_scale` | ``0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`GIMode` | :ref:`gi_mode` | ``1`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`bool` | :ref:`ignore_occlusion_culling` | ``false`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`lod_bias` | ``1.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`Material` | :ref:`material_overlay` | | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`Material` | :ref:`material_override` | | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`transparency` | ``0.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`visibility_range_begin` | ``0.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`visibility_range_begin_margin` | ``0.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`visibility_range_end` | ``0.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`visibility_range_end_margin` | ``0.0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`VisibilityRangeFadeMode` | :ref:`visibility_range_fade_mode` | ``0`` | + +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+ .. rst-class:: classref-reftable-group @@ -72,8 +74,6 @@ Methods +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_instance_shader_parameter` **(** :ref:`StringName` name **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_custom_aabb` **(** :ref:`AABB` aabb **)** | - +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_instance_shader_parameter` **(** :ref:`StringName` name, :ref:`Variant` value **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -274,6 +274,23 @@ The selected shadow casting flag. See :ref:`ShadowCastingSetting` **custom_aabb** = ``AABB(0, 0, 0, 0, 0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_custom_aabb** **(** :ref:`AABB` value **)** +- :ref:`AABB` **get_custom_aabb** **(** **)** + +Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive :ref:`AABB` recalculation that happens when a skeleton is used with a :ref:`MeshInstance3D` or to have fine control over the :ref:`MeshInstance3D`'s bounding box. To remove this, set value to an :ref:`AABB` with all fields set to zero. + +.. rst-class:: classref-item-separator + +---- + .. _class_GeometryInstance3D_property_extra_cull_margin: .. rst-class:: classref-property @@ -528,18 +545,6 @@ Get the value of a shader parameter as set on this instance. ---- -.. _class_GeometryInstance3D_method_set_custom_aabb: - -.. rst-class:: classref-method - -void **set_custom_aabb** **(** :ref:`AABB` aabb **)** - -Overrides the bounding box of this node with a custom one. To remove it, set an :ref:`AABB` with all fields set to zero. - -.. rst-class:: classref-item-separator - ----- - .. _class_GeometryInstance3D_method_set_instance_shader_parameter: .. rst-class:: classref-method diff --git a/classes/class_gltfdocumentextension.rst b/classes/class_gltfdocumentextension.rst index 61cf8109c..e1cb63cfa 100644 --- a/classes/class_gltfdocumentextension.rst +++ b/classes/class_gltfdocumentextension.rst @@ -42,7 +42,7 @@ Methods +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_export_post` **(** :ref:`GLTFState` state **)** |virtual| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_export_preflight` **(** :ref:`Node` root **)** |virtual| | + | :ref:`int` | :ref:`_export_preflight` **(** :ref:`GLTFState` state, :ref:`Node` root **)** |virtual| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Node3D` | :ref:`_generate_scene_node` **(** :ref:`GLTFState` state, :ref:`GLTFNode` gltf_node, :ref:`Node` scene_parent **)** |virtual| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -114,11 +114,11 @@ This method can be used to modify the final JSON of the generated GLTF file. .. rst-class:: classref-method -:ref:`int` **_export_preflight** **(** :ref:`Node` root **)** |virtual| +:ref:`int` **_export_preflight** **(** :ref:`GLTFState` state, :ref:`Node` root **)** |virtual| Part of the export process. This method is run first, before all other parts of the export process. -The return value is used to determine if this GLTFDocumentExtension class should be used for exporting a given GLTF file. If :ref:`@GlobalScope.OK`, the export will use this GLTFDocumentExtension class. If not overridden, :ref:`@GlobalScope.OK` is returned. +The return value is used to determine if this **GLTFDocumentExtension** instance should be used for exporting a given GLTF file. If :ref:`@GlobalScope.OK`, the export will use this **GLTFDocumentExtension** instance. If not overridden, :ref:`@GlobalScope.OK` is returned. .. rst-class:: classref-item-separator @@ -202,7 +202,7 @@ This method can be used to modify any of the data imported so far, including any Part of the import process. This method is run first, before all other parts of the import process. -The return value is used to determine if this GLTFDocumentExtension class should be used for importing a given GLTF file. If :ref:`@GlobalScope.OK`, the import will use this GLTFDocumentExtension class. If not overridden, :ref:`@GlobalScope.OK` is returned. +The return value is used to determine if this **GLTFDocumentExtension** instance should be used for importing a given GLTF file. If :ref:`@GlobalScope.OK`, the import will use this **GLTFDocumentExtension** instance. If not overridden, :ref:`@GlobalScope.OK` is returned. .. rst-class:: classref-item-separator @@ -216,7 +216,7 @@ The return value is used to determine if this GLTFDocumentExtension class should Part of the import process. This method is run after :ref:`_get_supported_extensions` and before :ref:`_generate_scene_node`. -Runs when parsing the node extensions of a GLTFNode. This method can be used to process the extension JSON data into a format that can be used by :ref:`_generate_scene_node`. +Runs when parsing the node extensions of a GLTFNode. This method can be used to process the extension JSON data into a format that can be used by :ref:`_generate_scene_node`. The return value should be a member of the :ref:`Error` enum. .. |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_input.rst b/classes/class_input.rst index d9e9b6035..6dd90fbe8 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -963,7 +963,7 @@ Sets the value of the magnetic field of the magnetometer sensor. Can be used for void **start_joy_vibration** **(** :ref:`int` device, :ref:`float` weak_magnitude, :ref:`float` strong_magnitude, :ref:`float` duration=0 **)** -Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. ``weak_magnitude`` is the strength of the weak motor (between 0 and 1) and ``strong_magnitude`` is the strength of the strong motor (between 0 and 1). ``duration`` is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). +Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. ``weak_magnitude`` is the strength of the weak motor (between 0 and 1) and ``strong_magnitude`` is the strength of the strong motor (between 0 and 1). ``duration`` is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). The vibration can be stopped early by calling :ref:`stop_joy_vibration`. \ **Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds. @@ -977,7 +977,7 @@ Starts to vibrate the joypad. Joypads usually come with two rumble motors, a str void **stop_joy_vibration** **(** :ref:`int` device **)** -Stops the vibration of the joypad. +Stops the vibration of the joypad started with :ref:`start_joy_vibration`. .. rst-class:: classref-item-separator @@ -989,15 +989,15 @@ Stops the vibration of the joypad. void **vibrate_handheld** **(** :ref:`int` duration_ms=500 **)** -Vibrate handheld devices. +Vibrate the handheld device for the specified duration in milliseconds. -\ **Note:** This method is implemented on Android, iOS, and Web. +\ **Note:** This method is implemented on Android, iOS, and Web. It has no effect on other platforms. -\ **Note:** For Android, it requires enabling the ``VIBRATE`` permission in the export preset. +\ **Note:** For Android, :ref:`vibrate_handheld` requires enabling the ``VIBRATE`` permission in the export preset. Otherwise, :ref:`vibrate_handheld` will have no effect. -\ **Note:** For iOS, specifying the duration is supported in iOS 13 and later. +\ **Note:** For iOS, specifying the duration is only supported in iOS 13 and later. -\ **Note:** Some web browsers such as Safari and Firefox for Android do not support this method. +\ **Note:** Some web browsers such as Safari and Firefox for Android do not support :ref:`vibrate_handheld`. .. rst-class:: classref-item-separator diff --git a/classes/class_light3d.rst b/classes/class_light3d.rst index 666fbd70a..7a6a0d09b 100644 --- a/classes/class_light3d.rst +++ b/classes/class_light3d.rst @@ -85,7 +85,7 @@ Properties +----------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`shadow_enabled` | ``false`` | +----------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ - | :ref:`float` | :ref:`shadow_normal_bias` | ``1.0`` | + | :ref:`float` | :ref:`shadow_normal_bias` | ``2.0`` | +----------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`shadow_opacity` | ``1.0`` | +----------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ @@ -752,7 +752,7 @@ If ``true``, the light will cast real-time shadows. This has a significant perfo .. rst-class:: classref-property -:ref:`float` **shadow_normal_bias** = ``1.0`` +:ref:`float` **shadow_normal_bias** = ``2.0`` .. rst-class:: classref-property-setget diff --git a/classes/class_linkbutton.rst b/classes/class_linkbutton.rst index 435523627..bd99cef04 100644 --- a/classes/class_linkbutton.rst +++ b/classes/class_linkbutton.rst @@ -48,6 +48,8 @@ Properties +-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`UnderlineMode` | :ref:`underline` | ``0`` | +-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`uri` | ``""`` | + +-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -223,7 +225,43 @@ Base text writing direction. - void **set_underline_mode** **(** :ref:`UnderlineMode` value **)** - :ref:`UnderlineMode` **get_underline_mode** **(** **)** -Determines when to show the underline. See :ref:`UnderlineMode` for options. +The underline mode to use for the text. See :ref:`UnderlineMode` for the available modes. + +.. rst-class:: classref-item-separator + +---- + +.. _class_LinkButton_property_uri: + +.. rst-class:: classref-property + +:ref:`String` **uri** = ``""`` + +.. rst-class:: classref-property-setget + +- void **set_uri** **(** :ref:`String` value **)** +- :ref:`String` **get_uri** **(** **)** + +The `URI `__ for this **LinkButton**. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (via :ref:`OS.shell_open`). HTTP and HTTPS URLs open the default web browser. + +\ **Examples:**\ + + +.. tabs:: + + .. code-tab:: gdscript + + uri = "https://godotengine.org" # Opens the URL in the default web browser. + uri = "C:\SomeFolder" # Opens the file explorer at the given path. + uri = "C:\SomeImage.png" # Opens the given image in the default viewing app. + + .. code-tab:: csharp + + Uri = "https://godotengine.org"; // Opens the URL in the default web browser. + Uri = "C:\SomeFolder"; // Opens the file explorer at the given path. + Uri = "C:\SomeImage.png"; // Opens the given image in the default viewing app. + + .. rst-class:: classref-section-separator diff --git a/classes/class_meshlibrary.rst b/classes/class_meshlibrary.rst index 7ba1e38a2..7c90098a8 100644 --- a/classes/class_meshlibrary.rst +++ b/classes/class_meshlibrary.rst @@ -38,47 +38,47 @@ Methods .. table:: :widths: auto - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear` **(** **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`create_item` **(** :ref:`int` id **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`find_item_by_name` **(** :ref:`String` name **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedInt32Array` | :ref:`get_item_list` **(** **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Mesh` | :ref:`get_item_mesh` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Transform3D` | :ref:`get_item_mesh_transform` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_item_name` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`NavigationMesh` | :ref:`get_item_navmesh` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Transform3D` | :ref:`get_item_navmesh_transform` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Texture2D` | :ref:`get_item_preview` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Array` | :ref:`get_item_shapes` **(** :ref:`int` id **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_last_unused_item_id` **(** **)** |const| | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_item` **(** :ref:`int` id **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_mesh` **(** :ref:`int` id, :ref:`Mesh` mesh **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_mesh_transform` **(** :ref:`int` id, :ref:`Transform3D` mesh_transform **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_name` **(** :ref:`int` id, :ref:`String` name **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_navmesh` **(** :ref:`int` id, :ref:`NavigationMesh` navmesh **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_navmesh_transform` **(** :ref:`int` id, :ref:`Transform3D` navmesh **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_preview` **(** :ref:`int` id, :ref:`Texture2D` texture **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_item_shapes` **(** :ref:`int` id, :ref:`Array` shapes **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear` **(** **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`create_item` **(** :ref:`int` id **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`find_item_by_name` **(** :ref:`String` name **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt32Array` | :ref:`get_item_list` **(** **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Mesh` | :ref:`get_item_mesh` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`get_item_mesh_transform` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_item_name` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NavigationMesh` | :ref:`get_item_navigation_mesh` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`get_item_navigation_mesh_transform` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Texture2D` | :ref:`get_item_preview` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Array` | :ref:`get_item_shapes` **(** :ref:`int` id **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_last_unused_item_id` **(** **)** |const| | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_item` **(** :ref:`int` id **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_mesh` **(** :ref:`int` id, :ref:`Mesh` mesh **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_mesh_transform` **(** :ref:`int` id, :ref:`Transform3D` mesh_transform **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_name` **(** :ref:`int` id, :ref:`String` name **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_navigation_mesh` **(** :ref:`int` id, :ref:`NavigationMesh` navigation_mesh **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_navigation_mesh_transform` **(** :ref:`int` id, :ref:`Transform3D` navigation_mesh **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_preview` **(** :ref:`int` id, :ref:`Texture2D` texture **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_shapes` **(** :ref:`int` id, :ref:`Array` shapes **)** | + +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -175,11 +175,11 @@ Returns the item's name. ---- -.. _class_MeshLibrary_method_get_item_navmesh: +.. _class_MeshLibrary_method_get_item_navigation_mesh: .. rst-class:: classref-method -:ref:`NavigationMesh` **get_item_navmesh** **(** :ref:`int` id **)** |const| +:ref:`NavigationMesh` **get_item_navigation_mesh** **(** :ref:`int` id **)** |const| Returns the item's navigation mesh. @@ -187,11 +187,11 @@ Returns the item's navigation mesh. ---- -.. _class_MeshLibrary_method_get_item_navmesh_transform: +.. _class_MeshLibrary_method_get_item_navigation_mesh_transform: .. rst-class:: classref-method -:ref:`Transform3D` **get_item_navmesh_transform** **(** :ref:`int` id **)** |const| +:ref:`Transform3D` **get_item_navigation_mesh_transform** **(** :ref:`int` id **)** |const| Returns the transform applied to the item's navigation mesh. @@ -287,11 +287,11 @@ This name is shown in the editor. It can also be used to look up the item later ---- -.. _class_MeshLibrary_method_set_item_navmesh: +.. _class_MeshLibrary_method_set_item_navigation_mesh: .. rst-class:: classref-method -void **set_item_navmesh** **(** :ref:`int` id, :ref:`NavigationMesh` navmesh **)** +void **set_item_navigation_mesh** **(** :ref:`int` id, :ref:`NavigationMesh` navigation_mesh **)** Sets the item's navigation mesh. @@ -299,11 +299,11 @@ Sets the item's navigation mesh. ---- -.. _class_MeshLibrary_method_set_item_navmesh_transform: +.. _class_MeshLibrary_method_set_item_navigation_mesh_transform: .. rst-class:: classref-method -void **set_item_navmesh_transform** **(** :ref:`int` id, :ref:`Transform3D` navmesh **)** +void **set_item_navigation_mesh_transform** **(** :ref:`int` id, :ref:`Transform3D` navigation_mesh **)** Sets the transform to apply to the item's navigation mesh. diff --git a/classes/class_multiplayersynchronizer.rst b/classes/class_multiplayersynchronizer.rst index 6a4e6cb4d..1f3953704 100644 --- a/classes/class_multiplayersynchronizer.rst +++ b/classes/class_multiplayersynchronizer.rst @@ -232,7 +232,7 @@ void **add_visibility_filter** **(** :ref:`Callable` filter **)* Adds a peer visibility filter for this synchronizer. -\ ``filter`` should take a peer id :ref:`int` and return a :ref:`bool`. +\ ``filter`` should take a peer ID :ref:`int` and return a :ref:`bool`. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationagent2d.rst b/classes/class_navigationagent2d.rst index d990e194e..cad675d6a 100644 --- a/classes/class_navigationagent2d.rst +++ b/classes/class_navigationagent2d.rst @@ -66,12 +66,12 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`distance_to_target` **(** **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`get_current_navigation_path` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_current_navigation_path_index` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_final_location` **(** **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedVector2Array` | :ref:`get_nav_path` **(** **)** |const| | - +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_nav_path_index` **(** **)** |const| | - +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value` **(** :ref:`int` layer_number **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_navigation_map` **(** **)** |const| | @@ -361,23 +361,11 @@ Returns the distance to the target location, using the agent's global position. ---- -.. _class_NavigationAgent2D_method_get_final_location: +.. _class_NavigationAgent2D_method_get_current_navigation_path: .. rst-class:: classref-method -:ref:`Vector2` **get_final_location** **(** **)** - -Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame. - -.. rst-class:: classref-item-separator - ----- - -.. _class_NavigationAgent2D_method_get_nav_path: - -.. rst-class:: classref-method - -:ref:`PackedVector2Array` **get_nav_path** **(** **)** |const| +:ref:`PackedVector2Array` **get_current_navigation_path** **(** **)** |const| Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended :ref:`get_next_location` once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. @@ -385,11 +373,11 @@ Returns this agent's current path from start to finish in global coordinates. Th ---- -.. _class_NavigationAgent2D_method_get_nav_path_index: +.. _class_NavigationAgent2D_method_get_current_navigation_path_index: .. rst-class:: classref-method -:ref:`int` **get_nav_path_index** **(** **)** |const| +:ref:`int` **get_current_navigation_path_index** **(** **)** |const| Returns which index the agent is currently on in the navigation path's :ref:`PackedVector2Array`. @@ -397,6 +385,18 @@ Returns which index the agent is currently on in the navigation path's :ref:`Pac ---- +.. _class_NavigationAgent2D_method_get_final_location: + +.. rst-class:: classref-method + +:ref:`Vector2` **get_final_location** **(** **)** + +Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationAgent2D_method_get_navigation_layer_value: .. rst-class:: classref-method diff --git a/classes/class_navigationagent3d.rst b/classes/class_navigationagent3d.rst index 1ee643739..3817ee6c0 100644 --- a/classes/class_navigationagent3d.rst +++ b/classes/class_navigationagent3d.rst @@ -70,12 +70,12 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`distance_to_target` **(** **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector3Array` | :ref:`get_current_navigation_path` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_current_navigation_path_index` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_final_location` **(** **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedVector3Array` | :ref:`get_nav_path` **(** **)** |const| | - +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_nav_path_index` **(** **)** |const| | - +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value` **(** :ref:`int` layer_number **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_navigation_map` **(** **)** |const| | @@ -399,23 +399,11 @@ Returns the distance to the target location, using the agent's global position. ---- -.. _class_NavigationAgent3D_method_get_final_location: +.. _class_NavigationAgent3D_method_get_current_navigation_path: .. rst-class:: classref-method -:ref:`Vector3` **get_final_location** **(** **)** - -Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame. - -.. rst-class:: classref-item-separator - ----- - -.. _class_NavigationAgent3D_method_get_nav_path: - -.. rst-class:: classref-method - -:ref:`PackedVector3Array` **get_nav_path** **(** **)** |const| +:ref:`PackedVector3Array` **get_current_navigation_path** **(** **)** |const| Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended :ref:`get_next_location` once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. @@ -423,11 +411,11 @@ Returns this agent's current path from start to finish in global coordinates. Th ---- -.. _class_NavigationAgent3D_method_get_nav_path_index: +.. _class_NavigationAgent3D_method_get_current_navigation_path_index: .. rst-class:: classref-method -:ref:`int` **get_nav_path_index** **(** **)** |const| +:ref:`int` **get_current_navigation_path_index** **(** **)** |const| Returns which index the agent is currently on in the navigation path's :ref:`PackedVector3Array`. @@ -435,6 +423,18 @@ Returns which index the agent is currently on in the navigation path's :ref:`Pac ---- +.. _class_NavigationAgent3D_method_get_final_location: + +.. rst-class:: classref-method + +:ref:`Vector3` **get_final_location** **(** **)** + +Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationAgent3D_method_get_navigation_layer_value: .. rst-class:: classref-method diff --git a/classes/class_navigationlink2d.rst b/classes/class_navigationlink2d.rst index e7194f6b0..a0a74d8a9 100644 --- a/classes/class_navigationlink2d.rst +++ b/classes/class_navigationlink2d.rst @@ -134,7 +134,7 @@ The distance the link will search is controlled by :ref:`NavigationServer2D.map_ - void **set_enter_cost** **(** :ref:`float` value **)** - :ref:`float` **get_enter_cost** **(** **)** -When pathfinding enters this link from another regions navmesh the ``enter_cost`` value is added to the path distance for determining the shortest path. +When pathfinding enters this link from another regions navigation mesh the ``enter_cost`` value is added to the path distance for determining the shortest path. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationlink3d.rst b/classes/class_navigationlink3d.rst index 4794f646e..e8d0808bd 100644 --- a/classes/class_navigationlink3d.rst +++ b/classes/class_navigationlink3d.rst @@ -134,7 +134,7 @@ The distance the link will search is controlled by :ref:`NavigationServer3D.map_ - void **set_enter_cost** **(** :ref:`float` value **)** - :ref:`float` **get_enter_cost** **(** **)** -When pathfinding enters this link from another regions navmesh the ``enter_cost`` value is added to the path distance for determining the shortest path. +When pathfinding enters this link from another regions navigation mesh the ``enter_cost`` value is added to the path distance for determining the shortest path. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationmesh.rst b/classes/class_navigationmesh.rst index a18540801..38d8d332e 100644 --- a/classes/class_navigationmesh.rst +++ b/classes/class_navigationmesh.rst @@ -36,53 +36,53 @@ Properties .. table:: :widths: auto - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`agent_height` | ``1.5`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`agent_max_climb` | ``0.25`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`agent_max_slope` | ``45.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`agent_radius` | ``0.5`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`cell_height` | ``0.25`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`cell_size` | ``0.25`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`detail_sample_distance` | ``6.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`detail_sample_max_error` | ``1.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`edge_max_error` | ``1.3`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`edge_max_length` | ``12.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`AABB` | :ref:`filter_baking_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`Vector3` | :ref:`filter_baking_aabb_offset` | ``Vector3(0, 0, 0)`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`bool` | :ref:`filter_ledge_spans` | ``false`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`bool` | :ref:`filter_low_hanging_obstacles` | ``false`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`bool` | :ref:`filter_walkable_low_height_spans` | ``false`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`int` | :ref:`geometry_collision_mask` | ``4294967295`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`ParsedGeometryType` | :ref:`geometry_parsed_geometry_type` | ``0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`SourceGeometryMode` | :ref:`geometry_source_geometry_mode` | ``0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`StringName` | :ref:`geometry_source_group_name` | ``&"navmesh"`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`polygon_verts_per_poly` | ``6.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`region_merge_size` | ``20.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`float` | :ref:`region_min_size` | ``2.0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ - | :ref:`SamplePartitionType` | :ref:`sample_partition_type` | ``0`` | - +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+----------------------------+ + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`agent_height` | ``1.5`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`agent_max_climb` | ``0.25`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`agent_max_slope` | ``45.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`agent_radius` | ``0.5`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`cell_height` | ``0.25`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`cell_size` | ``0.25`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`detail_sample_distance` | ``6.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`detail_sample_max_error` | ``1.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`edge_max_error` | ``1.3`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`edge_max_length` | ``12.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`AABB` | :ref:`filter_baking_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Vector3` | :ref:`filter_baking_aabb_offset` | ``Vector3(0, 0, 0)`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`bool` | :ref:`filter_ledge_spans` | ``false`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`bool` | :ref:`filter_low_hanging_obstacles` | ``false`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`bool` | :ref:`filter_walkable_low_height_spans` | ``false`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`geometry_collision_mask` | ``4294967295`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`ParsedGeometryType` | :ref:`geometry_parsed_geometry_type` | ``0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`SourceGeometryMode` | :ref:`geometry_source_geometry_mode` | ``0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`StringName` | :ref:`geometry_source_group_name` | ``&"navigation_mesh_source_group"`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`polygon_vertices_per_polyon` | ``6.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`region_merge_size` | ``20.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`region_min_size` | ``2.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`SamplePartitionType` | :ref:`sample_partition_type` | ``0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ .. rst-class:: classref-reftable-group @@ -211,13 +211,13 @@ Represents the size of the :ref:`ParsedGeometryType` **SOURCE_GEOMETRY_NAVMESH_CHILDREN** = ``0`` +:ref:`SourceGeometryMode` **SOURCE_GEOMETRY_ROOT_NODE_CHILDREN** = ``0`` -Scans the child nodes of :ref:`NavigationRegion3D` recursively for geometry. +Scans the child nodes of the root node recursively for geometry. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN: @@ -572,7 +572,7 @@ The source of the geometry used when baking. See :ref:`SourceGeometryMode` **geometry_source_group_name** = ``&"navmesh"`` +:ref:`StringName` **geometry_source_group_name** = ``&"navigation_mesh_source_group"`` .. rst-class:: classref-property-setget @@ -587,16 +587,16 @@ Only used when :ref:`geometry_source_geometry_mode` **polygon_verts_per_poly** = ``6.0`` +:ref:`float` **polygon_vertices_per_polyon** = ``6.0`` .. rst-class:: classref-property-setget -- void **set_verts_per_poly** **(** :ref:`float` value **)** -- :ref:`float` **get_verts_per_poly** **(** **)** +- void **set_vertices_per_polyon** **(** :ref:`float` value **)** +- :ref:`float` **get_vertices_per_polyon** **(** **)** The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. diff --git a/classes/class_navigationmeshgenerator.rst b/classes/class_navigationmeshgenerator.rst index 436ed0d81..48e5a62ba 100644 --- a/classes/class_navigationmeshgenerator.rst +++ b/classes/class_navigationmeshgenerator.rst @@ -37,11 +37,11 @@ Methods .. table:: :widths: auto - +------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`bake` **(** :ref:`NavigationMesh` nav_mesh, :ref:`Node` root_node **)** | - +------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear` **(** :ref:`NavigationMesh` nav_mesh **)** | - +------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`bake` **(** :ref:`NavigationMesh` navigation_mesh, :ref:`Node` root_node **)** | + +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear` **(** :ref:`NavigationMesh` navigation_mesh **)** | + +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -56,9 +56,9 @@ Method Descriptions .. rst-class:: classref-method -void **bake** **(** :ref:`NavigationMesh` nav_mesh, :ref:`Node` root_node **)** +void **bake** **(** :ref:`NavigationMesh` navigation_mesh, :ref:`Node` root_node **)** -Bakes navigation data to the provided ``nav_mesh`` by parsing child nodes under the provided ``root_node`` or a specific group of nodes for potential source geometry. The parse behavior can be controlled with the :ref:`NavigationMesh.geometry_parsed_geometry_type` and :ref:`NavigationMesh.geometry_source_geometry_mode` properties on the :ref:`NavigationMesh` resource. +Bakes navigation data to the provided ``navigation_mesh`` by parsing child nodes under the provided ``root_node`` or a specific group of nodes for potential source geometry. The parse behavior can be controlled with the :ref:`NavigationMesh.geometry_parsed_geometry_type` and :ref:`NavigationMesh.geometry_source_geometry_mode` properties on the :ref:`NavigationMesh` resource. .. rst-class:: classref-item-separator @@ -68,9 +68,9 @@ Bakes navigation data to the provided ``nav_mesh`` by parsing child nodes under .. rst-class:: classref-method -void **clear** **(** :ref:`NavigationMesh` nav_mesh **)** +void **clear** **(** :ref:`NavigationMesh` navigation_mesh **)** -Removes all polygons and vertices from the provided ``nav_mesh`` resource. +Removes all polygons and vertices from the provided ``navigation_mesh`` resource. .. |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_navigationpathqueryparameters2d.rst b/classes/class_navigationpathqueryparameters2d.rst index 1635aa993..c1b6a03ce 100644 --- a/classes/class_navigationpathqueryparameters2d.rst +++ b/classes/class_navigationpathqueryparameters2d.rst @@ -82,7 +82,7 @@ enum **PathPostProcessing**: :ref:`PathPostProcessing` **PATH_POSTPROCESSING_CORRIDORFUNNEL** = ``0`` -Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navmesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. +Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. .. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_EDGECENTERED: @@ -90,7 +90,7 @@ Applies a funnel algorithm to the raw path corridor found by the pathfinding alg :ref:`PathPostProcessing` **PATH_POSTPROCESSING_EDGECENTERED** = ``1`` -Centers every path position in the middle of the traveled navmesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. +Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. .. rst-class:: classref-section-separator diff --git a/classes/class_navigationpathqueryparameters3d.rst b/classes/class_navigationpathqueryparameters3d.rst index 53498a59e..917ed1566 100644 --- a/classes/class_navigationpathqueryparameters3d.rst +++ b/classes/class_navigationpathqueryparameters3d.rst @@ -82,7 +82,7 @@ enum **PathPostProcessing**: :ref:`PathPostProcessing` **PATH_POSTPROCESSING_CORRIDORFUNNEL** = ``0`` -Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navmesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. +Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. .. _class_NavigationPathQueryParameters3D_constant_PATH_POSTPROCESSING_EDGECENTERED: @@ -90,7 +90,7 @@ Applies a funnel algorithm to the raw path corridor found by the pathfinding alg :ref:`PathPostProcessing` **PATH_POSTPROCESSING_EDGECENTERED** = ``1`` -Centers every path position in the middle of the traveled navmesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. +Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. .. rst-class:: classref-section-separator diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst index dd90b8ba5..c7d2a8cea 100644 --- a/classes/class_navigationpolygon.rst +++ b/classes/class_navigationpolygon.rst @@ -32,7 +32,7 @@ Using :ref:`add_outline`: var outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.add_outline(outline) polygon.make_polygons_from_outlines() - $NavigationRegion2D.navpoly = polygon + $NavigationRegion2D.navigation_polygon = polygon .. code-tab:: csharp @@ -40,7 +40,7 @@ Using :ref:`add_outline`: var outline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; polygon.AddOutline(outline); polygon.MakePolygonsFromOutlines(); - GetNode("NavigationRegion2D").Navpoly = polygon; + GetNode("NavigationRegion2D").NavigationPolygon = polygon; @@ -56,7 +56,7 @@ Using :ref:`add_polygon` and indices polygon.vertices = vertices var indices = PackedInt32Array([0, 1, 2, 3]) polygon.add_polygon(indices) - $NavigationRegion2D.navpoly = polygon + $NavigationRegion2D.navigation_polygon = polygon .. code-tab:: csharp @@ -65,7 +65,7 @@ Using :ref:`add_polygon` and indices polygon.Vertices = vertices; var indices = new int[] { 0, 1, 2, 3 }; polygon.AddPolygon(indices); - GetNode("NavigationRegion2D").Navpoly = polygon; + GetNode("NavigationRegion2D").NavigationPolygon = polygon; @@ -95,7 +95,7 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_polygons` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`NavigationMesh` | :ref:`get_mesh` **(** **)** | + | :ref:`NavigationMesh` | :ref:`get_navigation_mesh` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector2Array` | :ref:`get_outline` **(** :ref:`int` idx **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -185,13 +185,13 @@ Clears the array of polygons, but it doesn't clear the array of outlines and ver ---- -.. _class_NavigationPolygon_method_get_mesh: +.. _class_NavigationPolygon_method_get_navigation_mesh: .. rst-class:: classref-method -:ref:`NavigationMesh` **get_mesh** **(** **)** +:ref:`NavigationMesh` **get_navigation_mesh** **(** **)** -Returns the :ref:`NavigationMesh` resulting from this navigation polygon. This navmesh can be used to update the navmesh of a region with the :ref:`NavigationServer3D.region_set_navmesh` API directly (as 2D uses the 3D server behind the scene). +Returns the :ref:`NavigationMesh` resulting from this navigation polygon. This navigation mesh can be used to update the navigation mesh of a region with the :ref:`NavigationServer3D.region_set_navigation_mesh` API directly (as 2D uses the 3D server behind the scene). .. rst-class:: classref-item-separator diff --git a/classes/class_navigationregion2d.rst b/classes/class_navigationregion2d.rst index 62569ef4c..687652531 100644 --- a/classes/class_navigationregion2d.rst +++ b/classes/class_navigationregion2d.rst @@ -23,7 +23,7 @@ A region of the navigation map. It tells the :ref:`NavigationServer2D`. -\ **Note:** Overlapping two regions' polygons is not enough for connecting two regions. They must share a similar edge. +\ **Note:** Overlapping two regions' navigation polygons is not enough for connecting two regions. They must share a similar edge. The pathfinding cost of entering this region from another region can be controlled with the :ref:`enter_cost` value. @@ -41,17 +41,17 @@ Properties .. table:: :widths: auto - +---------------------------------------------------+-------------------------------------------------------------------------------+----------+ - | :ref:`bool` | :ref:`enabled` | ``true`` | - +---------------------------------------------------+-------------------------------------------------------------------------------+----------+ - | :ref:`float` | :ref:`enter_cost` | ``0.0`` | - +---------------------------------------------------+-------------------------------------------------------------------------------+----------+ - | :ref:`int` | :ref:`navigation_layers` | ``1`` | - +---------------------------------------------------+-------------------------------------------------------------------------------+----------+ - | :ref:`NavigationPolygon` | :ref:`navpoly` | | - +---------------------------------------------------+-------------------------------------------------------------------------------+----------+ - | :ref:`float` | :ref:`travel_cost` | ``1.0`` | - +---------------------------------------------------+-------------------------------------------------------------------------------+----------+ + +---------------------------------------------------+---------------------------------------------------------------------------------+----------+ + | :ref:`bool` | :ref:`enabled` | ``true`` | + +---------------------------------------------------+---------------------------------------------------------------------------------+----------+ + | :ref:`float` | :ref:`enter_cost` | ``0.0`` | + +---------------------------------------------------+---------------------------------------------------------------------------------+----------+ + | :ref:`int` | :ref:`navigation_layers` | ``1`` | + +---------------------------------------------------+---------------------------------------------------------------------------------+----------+ + | :ref:`NavigationPolygon` | :ref:`navigation_polygon` | | + +---------------------------------------------------+---------------------------------------------------------------------------------+----------+ + | :ref:`float` | :ref:`travel_cost` | ``1.0`` | + +---------------------------------------------------+---------------------------------------------------------------------------------+----------+ .. rst-class:: classref-reftable-group @@ -106,7 +106,7 @@ Determines if the **NavigationRegion2D** is enabled or disabled. - void **set_enter_cost** **(** :ref:`float` value **)** - :ref:`float` **get_enter_cost** **(** **)** -When pathfinding enters this region's navmesh from another regions navmesh the ``enter_cost`` value is added to the path distance for determining the shortest path. +When pathfinding enters this region's navigation mesh from another regions navigation mesh the ``enter_cost`` value is added to the path distance for determining the shortest path. .. rst-class:: classref-item-separator @@ -129,11 +129,11 @@ A bitfield determining all navigation layers the region belongs to. These naviga ---- -.. _class_NavigationRegion2D_property_navpoly: +.. _class_NavigationRegion2D_property_navigation_polygon: .. rst-class:: classref-property -:ref:`NavigationPolygon` **navpoly** +:ref:`NavigationPolygon` **navigation_polygon** .. rst-class:: classref-property-setget @@ -157,7 +157,7 @@ The :ref:`NavigationPolygon` resource to use. - void **set_travel_cost** **(** :ref:`float` value **)** - :ref:`float` **get_travel_cost** **(** **)** -When pathfinding moves inside this region's navmesh the traveled distances are multiplied with ``travel_cost`` for determining the shortest path. +When pathfinding moves inside this region's navigation mesh the traveled distances are multiplied with ``travel_cost`` for determining the shortest path. .. rst-class:: classref-section-separator diff --git a/classes/class_navigationregion3d.rst b/classes/class_navigationregion3d.rst index 0dbf674d5..f47c0934d 100644 --- a/classes/class_navigationregion3d.rst +++ b/classes/class_navigationregion3d.rst @@ -23,7 +23,7 @@ A region of the navigation map. It tells the :ref:`NavigationServer3D`. -\ **Note:** Overlapping two regions' navmeshes is not enough for connecting two regions. They must share a similar edge. +\ **Note:** Overlapping two regions' navigation meshes is not enough for connecting two regions. They must share a similar edge. The cost of entering this region from another region can be controlled with the :ref:`enter_cost` value. @@ -48,7 +48,7 @@ Properties +---------------------------------------------+-------------------------------------------------------------------------------+----------+ | :ref:`int` | :ref:`navigation_layers` | ``1`` | +---------------------------------------------+-------------------------------------------------------------------------------+----------+ - | :ref:`NavigationMesh` | :ref:`navmesh` | | + | :ref:`NavigationMesh` | :ref:`navigation_mesh` | | +---------------------------------------------+-------------------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`travel_cost` | ``1.0`` | +---------------------------------------------+-------------------------------------------------------------------------------+----------+ @@ -137,7 +137,7 @@ Determines if the **NavigationRegion3D** is enabled or disabled. - void **set_enter_cost** **(** :ref:`float` value **)** - :ref:`float` **get_enter_cost** **(** **)** -When pathfinding enters this region's navmesh from another regions navmesh the ``enter_cost`` value is added to the path distance for determining the shortest path. +When pathfinding enters this region's navigation mesh from another regions navigation mesh the ``enter_cost`` value is added to the path distance for determining the shortest path. .. rst-class:: classref-item-separator @@ -160,11 +160,11 @@ A bitfield determining all navigation layers the region belongs to. These naviga ---- -.. _class_NavigationRegion3D_property_navmesh: +.. _class_NavigationRegion3D_property_navigation_mesh: .. rst-class:: classref-property -:ref:`NavigationMesh` **navmesh** +:ref:`NavigationMesh` **navigation_mesh** .. rst-class:: classref-property-setget @@ -188,7 +188,7 @@ The :ref:`NavigationMesh` resource to use. - void **set_travel_cost** **(** :ref:`float` value **)** - :ref:`float` **get_travel_cost** **(** **)** -When pathfinding moves inside this region's navmesh the traveled distances are multiplied with ``travel_cost`` for determining the shortest path. +When pathfinding moves inside this region's navigation mesh the traveled distances are multiplied with ``travel_cost`` for determining the shortest path. .. rst-class:: classref-section-separator diff --git a/classes/class_navigationserver2d.rst b/classes/class_navigationserver2d.rst index c0521d185..e81a1b19a 100644 --- a/classes/class_navigationserver2d.rst +++ b/classes/class_navigationserver2d.rst @@ -57,7 +57,7 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`agent_set_callback` **(** :ref:`RID` agent, :ref:`Object` receiver, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| | + | void | :ref:`agent_set_callback` **(** :ref:`RID` agent, :ref:`int` object_id, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`agent_set_map` **(** :ref:`RID` agent, :ref:`RID` map **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -91,6 +91,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`link_get_navigation_layers` **(** :ref:`RID` link **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`link_get_owner_id` **(** :ref:`RID` link **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`link_get_start_location` **(** :ref:`RID` link **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`link_get_travel_cost` **(** :ref:`RID` link **)** |const| | @@ -107,6 +109,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`link_set_navigation_layers` **(** :ref:`RID` link, :ref:`int` navigation_layers **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`link_set_owner_id` **(** :ref:`RID` link, :ref:`int` owner_id **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`link_set_start_location` **(** :ref:`RID` link, :ref:`Vector2` location **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`link_set_travel_cost` **(** :ref:`RID` link, :ref:`float` travel_cost **)** |const| | @@ -159,6 +163,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_navigation_layers` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`region_get_owner_id` **(** :ref:`RID` region **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`region_get_travel_cost` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_owns_point` **(** :ref:`RID` region, :ref:`Vector2` point **)** |const| | @@ -169,7 +175,9 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_navigation_layers` **(** :ref:`RID` region, :ref:`int` navigation_layers **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`region_set_navpoly` **(** :ref:`RID` region, :ref:`NavigationPolygon` nav_poly **)** |const| | + | void | :ref:`region_set_navigation_polygon` **(** :ref:`RID` region, :ref:`NavigationPolygon` navigation_polygon **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`region_set_owner_id` **(** :ref:`RID` region, :ref:`int` owner_id **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_transform` **(** :ref:`RID` region, :ref:`Transform2D` transform **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -242,11 +250,11 @@ Returns true if the map got changed the previous frame. .. rst-class:: classref-method -void **agent_set_callback** **(** :ref:`RID` agent, :ref:`Object` receiver, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| +void **agent_set_callback** **(** :ref:`RID` agent, :ref:`int` object_id, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| -Callback called at the end of the RVO process. If a callback is created manually and the agent is placed on a navigation map it will calculate avoidance for the agent and dispatch the calculated ``safe_velocity`` to the ``receiver`` object with a signal to the chosen ``method`` name. +Sets the callback ``object_id`` and ``method`` that gets called after each avoidance processing step for the ``agent``. The calculated ``safe_velocity`` will be dispatched with a signal to the object just before the physics calculations. -\ **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use :ref:`agent_set_callback` again with a ``null`` object as the ``receiver``. +\ **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use :ref:`agent_set_callback` again with a ``0`` ObjectID as the ``object_id``. .. rst-class:: classref-item-separator @@ -444,6 +452,18 @@ Returns the navigation layers for this ``link``. ---- +.. _class_NavigationServer2D_method_link_get_owner_id: + +.. rst-class:: classref-method + +:ref:`int` **link_get_owner_id** **(** :ref:`RID` link **)** |const| + +Returns the ``ObjectID`` of the object which manages this link. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_link_get_start_location: .. rst-class:: classref-method @@ -540,6 +560,18 @@ Set the links's navigation layers. This allows selecting links from a path reque ---- +.. _class_NavigationServer2D_method_link_set_owner_id: + +.. rst-class:: classref-method + +void **link_set_owner_id** **(** :ref:`RID` link, :ref:`int` owner_id **)** |const| + +Set the ``ObjectID`` of the object which manages this link. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_link_set_start_location: .. rst-class:: classref-method @@ -858,6 +890,18 @@ Returns the region's navigation layers. ---- +.. _class_NavigationServer2D_method_region_get_owner_id: + +.. rst-class:: classref-method + +:ref:`int` **region_get_owner_id** **(** :ref:`RID` region **)** |const| + +Returns the ``ObjectID`` of the object which manages this region. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_region_get_travel_cost: .. rst-class:: classref-method @@ -922,13 +966,25 @@ Set the region's navigation layers. This allows selecting regions from a path re ---- -.. _class_NavigationServer2D_method_region_set_navpoly: +.. _class_NavigationServer2D_method_region_set_navigation_polygon: .. rst-class:: classref-method -void **region_set_navpoly** **(** :ref:`RID` region, :ref:`NavigationPolygon` nav_poly **)** |const| +void **region_set_navigation_polygon** **(** :ref:`RID` region, :ref:`NavigationPolygon` navigation_polygon **)** |const| -Sets the navigation mesh for the region. +Sets the ``navigation_polygon`` for the region. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_region_set_owner_id: + +.. rst-class:: classref-method + +void **region_set_owner_id** **(** :ref:`RID` region, :ref:`int` owner_id **)** |const| + +Set the ``ObjectID`` of the object which manages this region. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationserver3d.rst b/classes/class_navigationserver3d.rst index dfa7efdbe..9a0008d02 100644 --- a/classes/class_navigationserver3d.rst +++ b/classes/class_navigationserver3d.rst @@ -57,7 +57,7 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`agent_set_callback` **(** :ref:`RID` agent, :ref:`Object` receiver, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| | + | void | :ref:`agent_set_callback` **(** :ref:`RID` agent, :ref:`int` object_id, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`agent_set_map` **(** :ref:`RID` agent, :ref:`RID` map **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -91,6 +91,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`link_get_navigation_layers` **(** :ref:`RID` link **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`link_get_owner_id` **(** :ref:`RID` link **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`link_get_start_location` **(** :ref:`RID` link **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`link_get_travel_cost` **(** :ref:`RID` link **)** |const| | @@ -107,6 +109,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`link_set_navigation_layers` **(** :ref:`RID` link, :ref:`int` navigation_layers **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`link_set_owner_id` **(** :ref:`RID` link, :ref:`int` owner_id **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`link_set_start_location` **(** :ref:`RID` link, :ref:`Vector3` location **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`link_set_travel_cost` **(** :ref:`RID` link, :ref:`float` travel_cost **)** |const| | @@ -155,7 +159,7 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`query_path` **(** :ref:`NavigationPathQueryParameters3D` parameters, :ref:`NavigationPathQueryResult3D` result **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`region_bake_navmesh` **(** :ref:`NavigationMesh` mesh, :ref:`Node` node **)** |const| | + | void | :ref:`region_bake_navigation_mesh` **(** :ref:`NavigationMesh` navigation_mesh, :ref:`Node` root_node **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_create` **(** **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -171,6 +175,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_navigation_layers` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`region_get_owner_id` **(** :ref:`RID` region **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`region_get_travel_cost` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_owns_point` **(** :ref:`RID` region, :ref:`Vector3` point **)** |const| | @@ -181,7 +187,9 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_navigation_layers` **(** :ref:`RID` region, :ref:`int` navigation_layers **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`region_set_navmesh` **(** :ref:`RID` region, :ref:`NavigationMesh` nav_mesh **)** |const| | + | void | :ref:`region_set_navigation_mesh` **(** :ref:`RID` region, :ref:`NavigationMesh` navigation_mesh **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`region_set_owner_id` **(** :ref:`RID` region, :ref:`int` owner_id **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_transform` **(** :ref:`RID` region, :ref:`Transform3D` transform **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -268,11 +276,11 @@ Returns true if the map got changed the previous frame. .. rst-class:: classref-method -void **agent_set_callback** **(** :ref:`RID` agent, :ref:`Object` receiver, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| +void **agent_set_callback** **(** :ref:`RID` agent, :ref:`int` object_id, :ref:`StringName` method, :ref:`Variant` userdata=null **)** |const| -Callback called at the end of the RVO process. If a callback is created manually and the agent is placed on a navigation map it will calculate avoidance for the agent and dispatch the calculated ``safe_velocity`` to the ``receiver`` object with a signal to the chosen ``method`` name. +Sets the callback ``object_id`` and ``method`` that gets called after each avoidance processing step for the ``agent``. The calculated ``safe_velocity`` will be dispatched with a signal to the object just before the physics calculations. -\ **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use :ref:`agent_set_callback` again with a ``null`` object as the ``receiver``. +\ **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use :ref:`agent_set_callback` again with a ``0`` ObjectID as the ``object_id``. .. rst-class:: classref-item-separator @@ -470,6 +478,18 @@ Returns the navigation layers for this ``link``. ---- +.. _class_NavigationServer3D_method_link_get_owner_id: + +.. rst-class:: classref-method + +:ref:`int` **link_get_owner_id** **(** :ref:`RID` link **)** |const| + +Returns the ``ObjectID`` of the object which manages this link. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_link_get_start_location: .. rst-class:: classref-method @@ -566,6 +586,18 @@ Set the links's navigation layers. This allows selecting links from a path reque ---- +.. _class_NavigationServer3D_method_link_set_owner_id: + +.. rst-class:: classref-method + +void **link_set_owner_id** **(** :ref:`RID` link, :ref:`int` owner_id **)** |const| + +Set the ``ObjectID`` of the object which manages this link. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_link_set_start_location: .. rst-class:: classref-method @@ -864,13 +896,13 @@ Queries a path in a given navigation map. Start and target position and other pa ---- -.. _class_NavigationServer3D_method_region_bake_navmesh: +.. _class_NavigationServer3D_method_region_bake_navigation_mesh: .. rst-class:: classref-method -void **region_bake_navmesh** **(** :ref:`NavigationMesh` mesh, :ref:`Node` node **)** |const| +void **region_bake_navigation_mesh** **(** :ref:`NavigationMesh` navigation_mesh, :ref:`Node` root_node **)** |const| -Bakes the navigation mesh. +Bakes the ``navigation_mesh`` with bake source geometry collected starting from the ``root_node``. .. rst-class:: classref-item-separator @@ -960,6 +992,18 @@ Returns the region's navigation layers. ---- +.. _class_NavigationServer3D_method_region_get_owner_id: + +.. rst-class:: classref-method + +:ref:`int` **region_get_owner_id** **(** :ref:`RID` region **)** |const| + +Returns the ``ObjectID`` of the object which manages this region. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_region_get_travel_cost: .. rst-class:: classref-method @@ -1024,11 +1068,11 @@ Set the region's navigation layers. This allows selecting regions from a path re ---- -.. _class_NavigationServer3D_method_region_set_navmesh: +.. _class_NavigationServer3D_method_region_set_navigation_mesh: .. rst-class:: classref-method -void **region_set_navmesh** **(** :ref:`RID` region, :ref:`NavigationMesh` nav_mesh **)** |const| +void **region_set_navigation_mesh** **(** :ref:`RID` region, :ref:`NavigationMesh` navigation_mesh **)** |const| Sets the navigation mesh for the region. @@ -1036,6 +1080,18 @@ Sets the navigation mesh for the region. ---- +.. _class_NavigationServer3D_method_region_set_owner_id: + +.. rst-class:: classref-method + +void **region_set_owner_id** **(** :ref:`RID` region, :ref:`int` owner_id **)** |const| + +Set the ``ObjectID`` of the object which manages this region. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_region_set_transform: .. rst-class:: classref-method diff --git a/classes/class_node2d.rst b/classes/class_node2d.rst index 0855e2a99..76dc8b82b 100644 --- a/classes/class_node2d.rst +++ b/classes/class_node2d.rst @@ -40,27 +40,31 @@ Properties .. table:: :widths: auto - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`global_position` | | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`global_rotation` | | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`global_scale` | | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`global_skew` | | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Transform2D` | :ref:`global_transform` | | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`rotation` | ``0.0`` | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`scale` | ``Vector2(1, 1)`` | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`skew` | ``0.0`` | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Transform2D` | :ref:`transform` | | - +---------------------------------------+-----------------------------------------------------------------+-------------------+ + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`global_position` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`global_rotation` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`global_rotation_degrees` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`global_scale` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`global_skew` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`Transform2D` | :ref:`global_transform` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`rotation` | ``0.0`` | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`rotation_degrees` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`scale` | ``Vector2(1, 1)`` | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`skew` | ``0.0`` | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ + | :ref:`Transform2D` | :ref:`transform` | | + +---------------------------------------+-------------------------------------------------------------------------------+-------------------+ .. rst-class:: classref-reftable-group @@ -137,6 +141,23 @@ Global rotation in radians. ---- +.. _class_Node2D_property_global_rotation_degrees: + +.. rst-class:: classref-property + +:ref:`float` **global_rotation_degrees** + +.. rst-class:: classref-property-setget + +- void **set_global_rotation_degrees** **(** :ref:`float` value **)** +- :ref:`float` **get_global_rotation_degrees** **(** **)** + +Helper property to access :ref:`global_rotation` in degrees instead of radians. + +.. rst-class:: classref-item-separator + +---- + .. _class_Node2D_property_global_scale: .. rst-class:: classref-property @@ -222,6 +243,23 @@ Rotation in radians, relative to the node's parent. ---- +.. _class_Node2D_property_rotation_degrees: + +.. rst-class:: classref-property + +:ref:`float` **rotation_degrees** + +.. rst-class:: classref-property-setget + +- void **set_rotation_degrees** **(** :ref:`float` value **)** +- :ref:`float` **get_rotation_degrees** **(** **)** + +Helper property to access :ref:`rotation` in degrees instead of radians. + +.. rst-class:: classref-item-separator + +---- + .. _class_Node2D_property_scale: .. rst-class:: classref-property diff --git a/classes/class_node3d.rst b/classes/class_node3d.rst index 4b815ac6d..8da3e8a8d 100644 --- a/classes/class_node3d.rst +++ b/classes/class_node3d.rst @@ -44,35 +44,39 @@ Properties .. table:: :widths: auto - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Basis` | :ref:`basis` | | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Vector3` | :ref:`global_position` | | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Vector3` | :ref:`global_rotation` | | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Transform3D` | :ref:`global_transform` | | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Vector3` | :ref:`position` | ``Vector3(0, 0, 0)`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Quaternion` | :ref:`quaternion` | | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Vector3` | :ref:`rotation` | ``Vector3(0, 0, 0)`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`RotationEditMode` | :ref:`rotation_edit_mode` | ``0`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`EulerOrder` | :ref:`rotation_order` | ``2`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Vector3` | :ref:`scale` | ``Vector3(1, 1, 1)`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`bool` | :ref:`top_level` | ``false`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`Transform3D` | :ref:`transform` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`NodePath` | :ref:`visibility_parent` | ``NodePath("")`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ - | :ref:`bool` | :ref:`visible` | ``true`` | - +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Basis` | :ref:`basis` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`global_position` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`global_rotation` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`global_rotation_degrees` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Transform3D` | :ref:`global_transform` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`position` | ``Vector3(0, 0, 0)`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Quaternion` | :ref:`quaternion` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`rotation` | ``Vector3(0, 0, 0)`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`rotation_degrees` | | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`RotationEditMode` | :ref:`rotation_edit_mode` | ``0`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`EulerOrder` | :ref:`rotation_order` | ``2`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Vector3` | :ref:`scale` | ``Vector3(1, 1, 1)`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`bool` | :ref:`top_level` | ``false`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`Transform3D` | :ref:`transform` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`NodePath` | :ref:`visibility_parent` | ``NodePath("")`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ + | :ref:`bool` | :ref:`visible` | ``true`` | + +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -327,6 +331,23 @@ Rotation part of the global transformation in radians, specified in terms of YXZ ---- +.. _class_Node3D_property_global_rotation_degrees: + +.. rst-class:: classref-property + +:ref:`Vector3` **global_rotation_degrees** + +.. rst-class:: classref-property-setget + +- void **set_global_rotation_degrees** **(** :ref:`Vector3` value **)** +- :ref:`Vector3` **get_global_rotation_degrees** **(** **)** + +Helper property to access :ref:`global_rotation` in degrees instead of radians. + +.. rst-class:: classref-item-separator + +---- + .. _class_Node3D_property_global_transform: .. rst-class:: classref-property @@ -397,6 +418,23 @@ Rotation part of the local transformation in radians, specified in terms of Eule ---- +.. _class_Node3D_property_rotation_degrees: + +.. rst-class:: classref-property + +:ref:`Vector3` **rotation_degrees** + +.. rst-class:: classref-property-setget + +- void **set_rotation_degrees** **(** :ref:`Vector3` value **)** +- :ref:`Vector3` **get_rotation_degrees** **(** **)** + +Helper property to access :ref:`rotation` in degrees instead of radians. + +.. rst-class:: classref-item-separator + +---- + .. _class_Node3D_property_rotation_edit_mode: .. rst-class:: classref-property diff --git a/classes/class_object.rst b/classes/class_object.rst index 6c24090c1..82d277575 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -10,7 +10,7 @@ Object ====== -**Inherited By:** :ref:`AudioServer`, :ref:`CameraServer`, :ref:`ClassDB`, :ref:`DisplayServer`, :ref:`EditorFileSystemDirectory`, :ref:`EditorPaths`, :ref:`EditorSelection`, :ref:`EditorVCSInterface`, :ref:`Engine`, :ref:`EngineDebugger`, :ref:`Geometry2D`, :ref:`Geometry3D`, :ref:`GodotSharp`, :ref:`Input`, :ref:`InputMap`, :ref:`IP`, :ref:`JavaClassWrapper`, :ref:`JavaScriptBridge`, :ref:`JNISingleton`, :ref:`JSONRPC`, :ref:`MainLoop`, :ref:`Marshalls`, :ref:`MovieWriter`, :ref:`NativeExtensionManager`, :ref:`NavigationMeshGenerator`, :ref:`NavigationServer2D`, :ref:`NavigationServer3D`, :ref:`Node`, :ref:`OS`, :ref:`Performance`, :ref:`PhysicsDirectBodyState2D`, :ref:`PhysicsDirectBodyState3D`, :ref:`PhysicsDirectSpaceState2D`, :ref:`PhysicsDirectSpaceState3D`, :ref:`PhysicsServer2D`, :ref:`PhysicsServer2DManager`, :ref:`PhysicsServer3D`, :ref:`PhysicsServer3DManager`, :ref:`PhysicsServer3DRenderingServerHandler`, :ref:`ProjectSettings`, :ref:`RefCounted`, :ref:`RenderingDevice`, :ref:`RenderingServer`, :ref:`ResourceLoader`, :ref:`ResourceSaver`, :ref:`ResourceUID`, :ref:`ScriptLanguage`, :ref:`TextServerManager`, :ref:`ThemeDB`, :ref:`TileData`, :ref:`Time`, :ref:`TranslationServer`, :ref:`TreeItem`, :ref:`UndoRedo`, :ref:`WorkerThreadPool`, :ref:`XRServer` +**Inherited By:** :ref:`AudioServer`, :ref:`CameraServer`, :ref:`ClassDB`, :ref:`DisplayServer`, :ref:`EditorFileSystemDirectory`, :ref:`EditorPaths`, :ref:`EditorSelection`, :ref:`EditorVCSInterface`, :ref:`Engine`, :ref:`EngineDebugger`, :ref:`GDExtensionManager`, :ref:`Geometry2D`, :ref:`Geometry3D`, :ref:`GodotSharp`, :ref:`Input`, :ref:`InputMap`, :ref:`IP`, :ref:`JavaClassWrapper`, :ref:`JavaScriptBridge`, :ref:`JNISingleton`, :ref:`JSONRPC`, :ref:`MainLoop`, :ref:`Marshalls`, :ref:`MovieWriter`, :ref:`NavigationMeshGenerator`, :ref:`NavigationServer2D`, :ref:`NavigationServer3D`, :ref:`Node`, :ref:`OS`, :ref:`Performance`, :ref:`PhysicsDirectBodyState2D`, :ref:`PhysicsDirectBodyState3D`, :ref:`PhysicsDirectSpaceState2D`, :ref:`PhysicsDirectSpaceState3D`, :ref:`PhysicsServer2D`, :ref:`PhysicsServer2DManager`, :ref:`PhysicsServer3D`, :ref:`PhysicsServer3DManager`, :ref:`PhysicsServer3DRenderingServerHandler`, :ref:`ProjectSettings`, :ref:`RefCounted`, :ref:`RenderingDevice`, :ref:`RenderingServer`, :ref:`ResourceLoader`, :ref:`ResourceSaver`, :ref:`ResourceUID`, :ref:`ScriptLanguage`, :ref:`TextServerManager`, :ref:`ThemeDB`, :ref:`TileData`, :ref:`Time`, :ref:`TranslationServer`, :ref:`TreeItem`, :ref:`UndoRedo`, :ref:`WorkerThreadPool`, :ref:`XRServer` Base class for all other classes in the engine. @@ -27,7 +27,7 @@ To delete an Object instance, call :ref:`free`. This i Objects can have a :ref:`Script` attached to them. Once the :ref:`Script` is instantiated, it effectively acts as an extension to the base class, allowing it to define and inherit new properties, methods and signals. -Inside a :ref:`Script`, :ref:`_get_property_list` may be overriden to customize properties in several ways. This allows them to be available to the editor, display as lists of options, sub-divide into groups, save on disk, etc. Scripting languages offer easier ways to customize properties, such as with the :ref:`@GDScript.@export` annotation. +Inside a :ref:`Script`, :ref:`_get_property_list` may be overridden to customize properties in several ways. This allows them to be available to the editor, display as lists of options, sub-divide into groups, save on disk, etc. Scripting languages offer easier ways to customize properties, such as with the :ref:`@GDScript.@export` annotation. Godot is very dynamic. An object's script, and therefore its properties, methods and signals, can be changed at run-time. Because of this, there can be occasions where, for example, a property required by a method may not exist. To prevent run-time errors, see methods such as :ref:`set`, :ref:`get`, :ref:`call`, :ref:`has_method`, :ref:`has_signal`, etc. Note that these methods are **much** slower than direct references. diff --git a/classes/class_omnilight3d.rst b/classes/class_omnilight3d.rst index e1ca547be..f33872139 100644 --- a/classes/class_omnilight3d.rst +++ b/classes/class_omnilight3d.rst @@ -36,15 +36,15 @@ Properties .. table:: :widths: auto - +------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------------+ - | :ref:`float` | :ref:`omni_attenuation` | ``1.0`` | - +------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------------+ - | :ref:`float` | :ref:`omni_range` | ``5.0`` | - +------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------------+ - | :ref:`ShadowMode` | :ref:`omni_shadow_mode` | ``1`` | - +------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------------+ - | :ref:`float` | shadow_bias | ``0.2`` (overrides :ref:`Light3D`) | - +------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------------+ + +------------------------------------------------+----------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`omni_attenuation` | ``1.0`` | + +------------------------------------------------+----------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`omni_range` | ``5.0`` | + +------------------------------------------------+----------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`ShadowMode` | :ref:`omni_shadow_mode` | ``1`` | + +------------------------------------------------+----------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | shadow_normal_bias | ``1.0`` (overrides :ref:`Light3D`) | + +------------------------------------------------+----------------------------------------------------------------------+-------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator diff --git a/classes/class_pathfollow3d.rst b/classes/class_pathfollow3d.rst index e8a687b96..fab23919a 100644 --- a/classes/class_pathfollow3d.rst +++ b/classes/class_pathfollow3d.rst @@ -276,7 +276,7 @@ Method Descriptions :ref:`Transform3D` **correct_posture** **(** :ref:`Transform3D` transform, :ref:`RotationMode` rotation_mode **)** |static| -Correct the ``transform``. ``rotation_mode`` implicitly specifies how posture (forward, up and sideway direction) is caculated. +Correct the ``transform``. ``rotation_mode`` implicitly specifies how posture (forward, up and sideway direction) is calculated. .. |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_physicspointqueryparameters2d.rst b/classes/class_physicspointqueryparameters2d.rst index efae4f15f..43cdd5ae3 100644 --- a/classes/class_physicspointqueryparameters2d.rst +++ b/classes/class_physicspointqueryparameters2d.rst @@ -63,7 +63,7 @@ Property Descriptions - void **set_canvas_instance_id** **(** :ref:`int` value **)** - :ref:`int` **get_canvas_instance_id** **(** **)** -If different from ``0``, restricts the query to a specific canvas layer specified by its instance id. See :ref:`Object.get_instance_id`. +If different from ``0``, restricts the query to a specific canvas layer specified by its instance ID. See :ref:`Object.get_instance_id`. .. rst-class:: classref-item-separator diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index 2f7f03d31..60f8c542a 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -702,7 +702,7 @@ Returns the icon of the item at the given ``index``. :ref:`int` **get_item_id** **(** :ref:`int` index **)** |const| -Returns the id of the item at the given ``index``. ``id`` can be manually assigned, while index can not. +Returns the ID of the item at the given ``index``. ``id`` can be manually assigned, while index can not. .. rst-class:: classref-item-separator diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index db2ba5279..5900a187a 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -133,8 +133,6 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`compression/formats/zstd/window_log_size` | ``27`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`debug/disable_touch` | ``false`` | - +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`debug/file_logging/enable_file_logging` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`debug/file_logging/enable_file_logging.pc` | ``true`` | @@ -1059,8 +1057,6 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/environment/glow/upscale_mode.mobile` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`rendering/environment/glow/use_high_quality` | ``false`` | - +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/environment/screen_space_reflection/roughness_quality` | ``1`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/environment/ssao/adaptive_target` | ``0.5`` | @@ -1299,7 +1295,7 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/textures/webp_compression/lossless_compression_factor` | ``25`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`rendering/transparent_background` | ``false`` | + | :ref:`bool` | :ref:`rendering/viewport/transparent_background` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/vrs/mode` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ @@ -1319,6 +1315,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`xr/openxr/reference_space` | ``"1"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`xr/openxr/submit_depth_buffer` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`xr/openxr/view_configuration` | ``"1"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`xr/shaders/enabled` | ``false`` | @@ -1941,18 +1939,6 @@ Largest size limit (in power of 2) allowed when compressing using long-distance ---- -.. _class_ProjectSettings_property_debug/disable_touch: - -.. rst-class:: classref-property - -:ref:`bool` **debug/disable_touch** = ``false`` - -Disable touch input. Only has effect on iOS. - -.. rst-class:: classref-item-separator - ----- - .. _class_ProjectSettings_property_debug/file_logging/enable_file_logging: .. rst-class:: classref-property @@ -2901,7 +2887,7 @@ If ``true``, it will require two swipes to access iOS UI that uses gestures. :ref:`bool` **display/window/per_pixel_transparency/allowed** = ``false`` -If ``true``, allows per-pixel transparency for the window background. This affects performance, so leave it on ``false`` unless you need it. See also :ref:`display/window/size/transparent` and :ref:`rendering/transparent_background`. +If ``true``, allows per-pixel transparency for the window background. This affects performance, so leave it on ``false`` unless you need it. See also :ref:`display/window/size/transparent` and :ref:`rendering/viewport/transparent_background`. .. rst-class:: classref-item-separator @@ -2993,7 +2979,7 @@ Allows the window to be resizable by default. :ref:`bool` **display/window/size/transparent** = ``false`` -If ``true``, enables a window manager hint that the main window background *can* be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling :ref:`rendering/transparent_background`. +If ``true``, enables a window manager hint that the main window background *can* be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling :ref:`rendering/viewport/transparent_background`. \ **Note:** To use a transparent splash screen, set :ref:`application/boot_splash/bg_color` to ``Color(0, 0, 0, 0)``. @@ -7831,18 +7817,6 @@ Lower-end override for :ref:`rendering/environment/glow/upscale_mode` **rendering/environment/glow/use_high_quality** = ``false`` - -Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long. - -.. rst-class:: classref-item-separator - ----- - .. _class_ProjectSettings_property_rendering/environment/screen_space_reflection/roughness_quality: .. rst-class:: classref-property @@ -9351,11 +9325,11 @@ The default compression factor for lossless WebP. Decompression speed is mostly ---- -.. _class_ProjectSettings_property_rendering/transparent_background: +.. _class_ProjectSettings_property_rendering/viewport/transparent_background: .. rst-class:: classref-property -:ref:`bool` **rendering/transparent_background** = ``false`` +:ref:`bool` **rendering/viewport/transparent_background** = ``false`` If ``true``, enables :ref:`Viewport.transparent_bg` on the root viewport. This allows per-pixel transparency to be effective after also enabling :ref:`display/window/size/transparent` and :ref:`display/window/per_pixel_transparency/allowed`. @@ -9492,6 +9466,18 @@ Specify the default reference space. ---- +.. _class_ProjectSettings_property_xr/openxr/submit_depth_buffer: + +.. rst-class:: classref-property + +:ref:`bool` **xr/openxr/submit_depth_buffer** = ``false`` + +If ``true``, OpenXR will manage the depth buffer and use the depth buffer for advanced reprojection provided this is supported by the XR runtime. Note that some rendering features in Godot can't be used with this feature. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_xr/openxr/view_configuration: .. rst-class:: classref-property diff --git a/classes/class_renderingdevice.rst b/classes/class_renderingdevice.rst index a89e92707..23948e9c9 100644 --- a/classes/class_renderingdevice.rst +++ b/classes/class_renderingdevice.rst @@ -24,189 +24,189 @@ Methods .. table:: :widths: auto - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`barrier` **(** :ref:`BarrierMask` from=7, :ref:`BarrierMask` to=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`buffer_clear` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedByteArray` | :ref:`buffer_get_data` **(** :ref:`RID` buffer **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`buffer_update` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`PackedByteArray` data, :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`capture_timestamp` **(** :ref:`String` name **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_add_barrier` **(** :ref:`int` compute_list **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`compute_list_begin` **(** :ref:`bool` allow_draw_overlap=false **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_bind_compute_pipeline` **(** :ref:`int` compute_list, :ref:`RID` compute_pipeline **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_bind_uniform_set` **(** :ref:`int` compute_list, :ref:`RID` uniform_set, :ref:`int` set_index **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_dispatch` **(** :ref:`int` compute_list, :ref:`int` x_groups, :ref:`int` y_groups, :ref:`int` z_groups **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_end` **(** :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_set_push_constant` **(** :ref:`int` compute_list, :ref:`PackedByteArray` buffer, :ref:`int` size_bytes **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`compute_pipeline_create` **(** :ref:`RID` shader, :ref:`RDPipelineSpecializationConstant[]` specialization_constants=[] **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`compute_pipeline_is_valid` **(** :ref:`RID` compute_pieline **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RenderingDevice` | :ref:`create_local_device` **(** **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_command_begin_label` **(** :ref:`String` name, :ref:`Color` color **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_command_end_label` **(** **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_command_insert_label` **(** :ref:`String` name, :ref:`Color` color **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`draw_list_begin` **(** :ref:`RID` framebuffer, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`Array` storage_textures=[] **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`draw_list_begin_for_screen` **(** :ref:`int` screen=0, :ref:`Color` clear_color=Color(0, 0, 0, 1) **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedInt64Array` | :ref:`draw_list_begin_split` **(** :ref:`RID` framebuffer, :ref:`int` splits, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`RID[]` storage_textures=[] **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_bind_index_array` **(** :ref:`int` draw_list, :ref:`RID` index_array **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_bind_render_pipeline` **(** :ref:`int` draw_list, :ref:`RID` render_pipeline **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_bind_uniform_set` **(** :ref:`int` draw_list, :ref:`RID` uniform_set, :ref:`int` set_index **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_bind_vertex_array` **(** :ref:`int` draw_list, :ref:`RID` vertex_array **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_disable_scissor` **(** :ref:`int` draw_list **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_draw` **(** :ref:`int` draw_list, :ref:`bool` use_indices, :ref:`int` instances, :ref:`int` procedural_vertex_count=0 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_enable_scissor` **(** :ref:`int` draw_list, :ref:`Rect2` rect=Rect2(0, 0, 0, 0) **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_end` **(** :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_set_blend_constants` **(** :ref:`int` draw_list, :ref:`Color` color **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_set_push_constant` **(** :ref:`int` draw_list, :ref:`PackedByteArray` buffer, :ref:`int` size_bytes **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`draw_list_switch_to_next_pass` **(** **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedInt64Array` | :ref:`draw_list_switch_to_next_pass_split` **(** :ref:`int` splits **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`framebuffer_create` **(** :ref:`RID[]` textures, :ref:`int` validate_with_format=-1, :ref:`int` view_count=1 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`framebuffer_create_empty` **(** :ref:`Vector2i` size, :ref:`TextureSamples` samples=0, :ref:`int` validate_with_format=-1 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`framebuffer_create_multipass` **(** :ref:`RID[]` textures, :ref:`RDFramebufferPass[]` passes, :ref:`int` validate_with_format=-1, :ref:`int` view_count=1 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`framebuffer_format_create` **(** :ref:`RDAttachmentFormat[]` attachments, :ref:`int` view_count=1 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`framebuffer_format_create_empty` **(** :ref:`TextureSamples` samples=0 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`framebuffer_format_create_multipass` **(** :ref:`RDAttachmentFormat[]` attachments, :ref:`RDFramebufferPass[]` passes, :ref:`int` view_count=1 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`TextureSamples` | :ref:`framebuffer_format_get_texture_samples` **(** :ref:`int` format, :ref:`int` render_pass=0 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`framebuffer_get_format` **(** :ref:`RID` framebuffer **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`framebuffer_is_valid` **(** :ref:`RID` framebuffer **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`free_rid` **(** :ref:`RID` rid **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`full_barrier` **(** **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_captured_timestamp_cpu_time` **(** :ref:`int` index **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_captured_timestamp_gpu_time` **(** :ref:`int` index **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_captured_timestamp_name` **(** :ref:`int` index **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_captured_timestamps_count` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_captured_timestamps_frame` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_device_name` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_device_pipeline_cache_uuid` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_device_vendor_name` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_driver_resource` **(** :ref:`DriverResource` resource, :ref:`RID` rid, :ref:`int` index **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_frame_delay` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_memory_usage` **(** :ref:`MemoryType` type **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`index_array_create` **(** :ref:`RID` index_buffer, :ref:`int` index_offset, :ref:`int` index_count **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`index_buffer_create` **(** :ref:`int` size_indices, :ref:`IndexBufferFormat` format, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`bool` use_restart_indices=false **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`limit_get` **(** :ref:`Limit` limit **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`render_pipeline_create` **(** :ref:`RID` shader, :ref:`int` framebuffer_format, :ref:`int` vertex_format, :ref:`RenderPrimitive` primitive, :ref:`RDPipelineRasterizationState` rasterization_state, :ref:`RDPipelineMultisampleState` multisample_state, :ref:`RDPipelineDepthStencilState` stencil_state, :ref:`RDPipelineColorBlendState` color_blend_state, :ref:`int` dynamic_state_flags=0, :ref:`int` for_render_pass=0, :ref:`RDPipelineSpecializationConstant[]` specialization_constants=[] **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`render_pipeline_is_valid` **(** :ref:`RID` render_pipeline **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`sampler_create` **(** :ref:`RDSamplerState` state **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`screen_get_framebuffer_format` **(** **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`screen_get_height` **(** :ref:`int` screen=0 **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`screen_get_width` **(** :ref:`int` screen=0 **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_resource_name` **(** :ref:`RID` id, :ref:`String` name **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedByteArray` | :ref:`shader_compile_binary_from_spirv` **(** :ref:`RDShaderSPIRV` spirv_data, :ref:`String` name="" **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RDShaderSPIRV` | :ref:`shader_compile_spirv_from_source` **(** :ref:`RDShaderSource` shader_source, :ref:`bool` allow_cache=true **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`shader_create_from_bytecode` **(** :ref:`PackedByteArray` binary_data **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`shader_create_from_spirv` **(** :ref:`RDShaderSPIRV` spirv_data, :ref:`String` name="" **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`shader_get_vertex_input_attribute_mask` **(** :ref:`RID` shader **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`storage_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`int` usage=0 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`submit` **(** **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`sync` **(** **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`texture_buffer_create` **(** :ref:`int` size_bytes, :ref:`DataFormat` format, :ref:`PackedByteArray` data=PackedByteArray() **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_clear` **(** :ref:`RID` texture, :ref:`Color` color, :ref:`int` base_mipmap, :ref:`int` mipmap_count, :ref:`int` base_layer, :ref:`int` layer_count, :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_copy` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`Vector3` from_pos, :ref:`Vector3` to_pos, :ref:`Vector3` size, :ref:`int` src_mipmap, :ref:`int` dst_mipmap, :ref:`int` src_layer, :ref:`int` dst_layer, :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`texture_create` **(** :ref:`RDTextureFormat` format, :ref:`RDTextureView` view, :ref:`PackedByteArray[]` data=[] **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`texture_create_shared` **(** :ref:`RDTextureView` view, :ref:`RID` with_texture **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`texture_create_shared_from_slice` **(** :ref:`RDTextureView` view, :ref:`RID` with_texture, :ref:`int` layer, :ref:`int` mipmap, :ref:`int` mipmaps=1, :ref:`TextureSliceType` slice_type=0 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedByteArray` | :ref:`texture_get_data` **(** :ref:`RID` texture, :ref:`int` layer **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`texture_is_format_supported_for_usage` **(** :ref:`DataFormat` format, :ref:`TextureUsageBits` usage_flags **)** |const| | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`texture_is_shared` **(** :ref:`RID` texture **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`texture_is_valid` **(** :ref:`RID` texture **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_resolve_multisample` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_update` **(** :ref:`RID` texture, :ref:`int` layer, :ref:`PackedByteArray` data, :ref:`BarrierMask` post_barrier=7 **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`uniform_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray() **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`uniform_set_create` **(** :ref:`RDUniform[]` uniforms, :ref:`RID` shader, :ref:`int` shader_set **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`uniform_set_is_valid` **(** :ref:`RID` uniform_set **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`vertex_array_create` **(** :ref:`int` vertex_count, :ref:`int` vertex_format, :ref:`RID[]` src_buffers, :ref:`PackedInt64Array` offsets=PackedInt64Array() **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`vertex_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`bool` use_as_storage=false **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`vertex_format_create` **(** :ref:`RDVertexAttribute[]` vertex_descriptions **)** | - +------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`barrier` **(** :ref:`BarrierMask` from=7, :ref:`BarrierMask` to=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`buffer_clear` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`buffer_get_data` **(** :ref:`RID` buffer **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`buffer_update` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`PackedByteArray` data, :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`capture_timestamp` **(** :ref:`String` name **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`compute_list_add_barrier` **(** :ref:`int` compute_list **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`compute_list_begin` **(** :ref:`bool` allow_draw_overlap=false **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`compute_list_bind_compute_pipeline` **(** :ref:`int` compute_list, :ref:`RID` compute_pipeline **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`compute_list_bind_uniform_set` **(** :ref:`int` compute_list, :ref:`RID` uniform_set, :ref:`int` set_index **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`compute_list_dispatch` **(** :ref:`int` compute_list, :ref:`int` x_groups, :ref:`int` y_groups, :ref:`int` z_groups **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`compute_list_end` **(** :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`compute_list_set_push_constant` **(** :ref:`int` compute_list, :ref:`PackedByteArray` buffer, :ref:`int` size_bytes **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`compute_pipeline_create` **(** :ref:`RID` shader, :ref:`RDPipelineSpecializationConstant[]` specialization_constants=[] **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`compute_pipeline_is_valid` **(** :ref:`RID` compute_pieline **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RenderingDevice` | :ref:`create_local_device` **(** **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_command_begin_label` **(** :ref:`String` name, :ref:`Color` color **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_command_end_label` **(** **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_command_insert_label` **(** :ref:`String` name, :ref:`Color` color **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`draw_list_begin` **(** :ref:`RID` framebuffer, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`Array` storage_textures=[] **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`draw_list_begin_for_screen` **(** :ref:`int` screen=0, :ref:`Color` clear_color=Color(0, 0, 0, 1) **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt64Array` | :ref:`draw_list_begin_split` **(** :ref:`RID` framebuffer, :ref:`int` splits, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`RID[]` storage_textures=[] **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_bind_index_array` **(** :ref:`int` draw_list, :ref:`RID` index_array **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_bind_render_pipeline` **(** :ref:`int` draw_list, :ref:`RID` render_pipeline **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_bind_uniform_set` **(** :ref:`int` draw_list, :ref:`RID` uniform_set, :ref:`int` set_index **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_bind_vertex_array` **(** :ref:`int` draw_list, :ref:`RID` vertex_array **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_disable_scissor` **(** :ref:`int` draw_list **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_draw` **(** :ref:`int` draw_list, :ref:`bool` use_indices, :ref:`int` instances, :ref:`int` procedural_vertex_count=0 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_enable_scissor` **(** :ref:`int` draw_list, :ref:`Rect2` rect=Rect2(0, 0, 0, 0) **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_end` **(** :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_set_blend_constants` **(** :ref:`int` draw_list, :ref:`Color` color **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_list_set_push_constant` **(** :ref:`int` draw_list, :ref:`PackedByteArray` buffer, :ref:`int` size_bytes **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`draw_list_switch_to_next_pass` **(** **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt64Array` | :ref:`draw_list_switch_to_next_pass_split` **(** :ref:`int` splits **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`framebuffer_create` **(** :ref:`RID[]` textures, :ref:`int` validate_with_format=-1, :ref:`int` view_count=1 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`framebuffer_create_empty` **(** :ref:`Vector2i` size, :ref:`TextureSamples` samples=0, :ref:`int` validate_with_format=-1 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`framebuffer_create_multipass` **(** :ref:`RID[]` textures, :ref:`RDFramebufferPass[]` passes, :ref:`int` validate_with_format=-1, :ref:`int` view_count=1 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`framebuffer_format_create` **(** :ref:`RDAttachmentFormat[]` attachments, :ref:`int` view_count=1 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`framebuffer_format_create_empty` **(** :ref:`TextureSamples` samples=0 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`framebuffer_format_create_multipass` **(** :ref:`RDAttachmentFormat[]` attachments, :ref:`RDFramebufferPass[]` passes, :ref:`int` view_count=1 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`TextureSamples` | :ref:`framebuffer_format_get_texture_samples` **(** :ref:`int` format, :ref:`int` render_pass=0 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`framebuffer_get_format` **(** :ref:`RID` framebuffer **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`framebuffer_is_valid` **(** :ref:`RID` framebuffer **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`free_rid` **(** :ref:`RID` rid **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`full_barrier` **(** **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_captured_timestamp_cpu_time` **(** :ref:`int` index **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_captured_timestamp_gpu_time` **(** :ref:`int` index **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_captured_timestamp_name` **(** :ref:`int` index **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_captured_timestamps_count` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_captured_timestamps_frame` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_device_name` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_device_pipeline_cache_uuid` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_device_vendor_name` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_driver_resource` **(** :ref:`DriverResource` resource, :ref:`RID` rid, :ref:`int` index **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_frame_delay` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_memory_usage` **(** :ref:`MemoryType` type **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`index_array_create` **(** :ref:`RID` index_buffer, :ref:`int` index_offset, :ref:`int` index_count **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`index_buffer_create` **(** :ref:`int` size_indices, :ref:`IndexBufferFormat` format, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`bool` use_restart_indices=false **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`limit_get` **(** :ref:`Limit` limit **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`render_pipeline_create` **(** :ref:`RID` shader, :ref:`int` framebuffer_format, :ref:`int` vertex_format, :ref:`RenderPrimitive` primitive, :ref:`RDPipelineRasterizationState` rasterization_state, :ref:`RDPipelineMultisampleState` multisample_state, :ref:`RDPipelineDepthStencilState` stencil_state, :ref:`RDPipelineColorBlendState` color_blend_state, :ref:`PipelineDynamicStateFlags` dynamic_state_flags=0, :ref:`int` for_render_pass=0, :ref:`RDPipelineSpecializationConstant[]` specialization_constants=[] **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`render_pipeline_is_valid` **(** :ref:`RID` render_pipeline **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`sampler_create` **(** :ref:`RDSamplerState` state **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`screen_get_framebuffer_format` **(** **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`screen_get_height` **(** :ref:`int` screen=0 **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`screen_get_width` **(** :ref:`int` screen=0 **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_resource_name` **(** :ref:`RID` id, :ref:`String` name **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`shader_compile_binary_from_spirv` **(** :ref:`RDShaderSPIRV` spirv_data, :ref:`String` name="" **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RDShaderSPIRV` | :ref:`shader_compile_spirv_from_source` **(** :ref:`RDShaderSource` shader_source, :ref:`bool` allow_cache=true **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`shader_create_from_bytecode` **(** :ref:`PackedByteArray` binary_data **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`shader_create_from_spirv` **(** :ref:`RDShaderSPIRV` spirv_data, :ref:`String` name="" **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`shader_get_vertex_input_attribute_mask` **(** :ref:`RID` shader **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`storage_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`StorageBufferUsage` usage=0 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`submit` **(** **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`sync` **(** **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`texture_buffer_create` **(** :ref:`int` size_bytes, :ref:`DataFormat` format, :ref:`PackedByteArray` data=PackedByteArray() **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`texture_clear` **(** :ref:`RID` texture, :ref:`Color` color, :ref:`int` base_mipmap, :ref:`int` mipmap_count, :ref:`int` base_layer, :ref:`int` layer_count, :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`texture_copy` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`Vector3` from_pos, :ref:`Vector3` to_pos, :ref:`Vector3` size, :ref:`int` src_mipmap, :ref:`int` dst_mipmap, :ref:`int` src_layer, :ref:`int` dst_layer, :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`texture_create` **(** :ref:`RDTextureFormat` format, :ref:`RDTextureView` view, :ref:`PackedByteArray[]` data=[] **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`texture_create_shared` **(** :ref:`RDTextureView` view, :ref:`RID` with_texture **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`texture_create_shared_from_slice` **(** :ref:`RDTextureView` view, :ref:`RID` with_texture, :ref:`int` layer, :ref:`int` mipmap, :ref:`int` mipmaps=1, :ref:`TextureSliceType` slice_type=0 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`texture_get_data` **(** :ref:`RID` texture, :ref:`int` layer **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`texture_is_format_supported_for_usage` **(** :ref:`DataFormat` format, :ref:`TextureUsageBits` usage_flags **)** |const| | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`texture_is_shared` **(** :ref:`RID` texture **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`texture_is_valid` **(** :ref:`RID` texture **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`texture_resolve_multisample` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`texture_update` **(** :ref:`RID` texture, :ref:`int` layer, :ref:`PackedByteArray` data, :ref:`BarrierMask` post_barrier=7 **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`uniform_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray() **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`uniform_set_create` **(** :ref:`RDUniform[]` uniforms, :ref:`RID` shader, :ref:`int` shader_set **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`uniform_set_is_valid` **(** :ref:`RID` uniform_set **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`vertex_array_create` **(** :ref:`int` vertex_count, :ref:`int` vertex_format, :ref:`RID[]` src_buffers, :ref:`PackedInt64Array` offsets=PackedInt64Array() **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`vertex_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`bool` use_as_storage=false **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`vertex_format_create` **(** :ref:`RDVertexAttribute[]` vertex_descriptions **)** | + +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -2753,7 +2753,7 @@ enum **IndexBufferFormat**: .. rst-class:: classref-enumeration -enum **StorageBufferUsage**: +flags **StorageBufferUsage**: .. _class_RenderingDevice_constant_STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT: @@ -3573,7 +3573,7 @@ enum **BlendOperation**: .. rst-class:: classref-enumeration -enum **PipelineDynamicStateFlags**: +flags **PipelineDynamicStateFlags**: .. _class_RenderingDevice_constant_DYNAMIC_STATE_LINE_WIDTH: @@ -5085,7 +5085,7 @@ void **full_barrier** **(** **)** .. rst-class:: classref-method -:ref:`RID` **render_pipeline_create** **(** :ref:`RID` shader, :ref:`int` framebuffer_format, :ref:`int` vertex_format, :ref:`RenderPrimitive` primitive, :ref:`RDPipelineRasterizationState` rasterization_state, :ref:`RDPipelineMultisampleState` multisample_state, :ref:`RDPipelineDepthStencilState` stencil_state, :ref:`RDPipelineColorBlendState` color_blend_state, :ref:`int` dynamic_state_flags=0, :ref:`int` for_render_pass=0, :ref:`RDPipelineSpecializationConstant[]` specialization_constants=[] **)** +:ref:`RID` **render_pipeline_create** **(** :ref:`RID` shader, :ref:`int` framebuffer_format, :ref:`int` vertex_format, :ref:`RenderPrimitive` primitive, :ref:`RDPipelineRasterizationState` rasterization_state, :ref:`RDPipelineMultisampleState` multisample_state, :ref:`RDPipelineDepthStencilState` stencil_state, :ref:`RDPipelineColorBlendState` color_blend_state, :ref:`PipelineDynamicStateFlags` dynamic_state_flags=0, :ref:`int` for_render_pass=0, :ref:`RDPipelineSpecializationConstant[]` specialization_constants=[] **)** .. container:: contribute @@ -5253,7 +5253,7 @@ void **set_resource_name** **(** :ref:`RID` id, :ref:`String` **storage_buffer_create** **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`int` usage=0 **)** +:ref:`RID` **storage_buffer_create** **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray(), :ref:`StorageBufferUsage` usage=0 **)** .. container:: contribute diff --git a/classes/class_renderingserver.rst b/classes/class_renderingserver.rst index 54720a296..1b0d07ba1 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -113,7 +113,7 @@ Methods +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`canvas_item_add_mesh` **(** :ref:`RID` item, :ref:`RID` mesh, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`RID` texture **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`canvas_item_add_msdf_texture_rect_region` **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`int` outline_size=0, :ref:`float` px_range=1.0 **)** | + | void | :ref:`canvas_item_add_msdf_texture_rect_region` **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`int` outline_size=0, :ref:`float` px_range=1.0, :ref:`float` scale=1.0 **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`canvas_item_add_multimesh` **(** :ref:`RID` item, :ref:`RID` mesh, :ref:`RID` texture **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -297,8 +297,6 @@ Methods +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`environment_glow_set_use_bicubic_upscale` **(** :ref:`bool` enable **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`environment_glow_set_use_high_quality` **(** :ref:`bool` enable **)** | - +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`environment_set_adjustment` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` brightness, :ref:`float` contrast, :ref:`float` saturation, :ref:`bool` use_1d_color_correction, :ref:`RID` color_correction **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`environment_set_ambient_light` **(** :ref:`RID` env, :ref:`Color` color, :ref:`EnvironmentAmbientSource` ambient=0, :ref:`float` energy=1.0, :ref:`float` sky_contibution=0.0, :ref:`EnvironmentReflectionSource` reflection_source=0 **)** | @@ -5558,7 +5556,7 @@ void **canvas_item_add_mesh** **(** :ref:`RID` item, :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`int` outline_size=0, :ref:`float` px_range=1.0 **)** +void **canvas_item_add_msdf_texture_rect_region** **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`int` outline_size=0, :ref:`float` px_range=1.0, :ref:`float` scale=1.0 **)** .. container:: contribute @@ -6774,20 +6772,6 @@ void **environment_glow_set_use_bicubic_upscale** **(** :ref:`bool` ---- -.. _class_RenderingServer_method_environment_glow_set_use_high_quality: - -.. rst-class:: classref-method - -void **environment_glow_set_use_high_quality** **(** :ref:`bool` enable **)** - -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! - -.. rst-class:: classref-item-separator - ----- - .. _class_RenderingServer_method_environment_set_adjustment: .. rst-class:: classref-method @@ -7242,7 +7226,7 @@ Returns the parameters of a shader. :ref:`RID` **get_test_cube** **(** **)** -Returns the id of the test cube. Creates one if none exists. +Returns the ID of the test cube. Creates one if none exists. .. rst-class:: classref-item-separator @@ -7254,7 +7238,7 @@ Returns the id of the test cube. Creates one if none exists. :ref:`RID` **get_test_texture** **(** **)** -Returns the id of the test texture. Creates one if none exists. +Returns the ID of the test texture. Creates one if none exists. .. rst-class:: classref-item-separator @@ -7322,7 +7306,7 @@ Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). :ref:`RID` **get_white_texture** **(** **)** -Returns the id of a white texture. Creates one if none exists. +Returns the ID of a white texture. Creates one if none exists. .. rst-class:: classref-item-separator @@ -7720,7 +7704,7 @@ Sets the weight for a given blend shape associated with this instance. void **instance_set_custom_aabb** **(** :ref:`RID` instance, :ref:`AABB` aabb **)** -Sets a custom AABB to use when culling objects from the view frustum. Equivalent to :ref:`GeometryInstance3D.set_custom_aabb`. +Sets a custom AABB to use when culling objects from the view frustum. Equivalent to setting :ref:`GeometryInstance3D.custom_aabb`. .. rst-class:: classref-item-separator diff --git a/classes/class_resource.rst b/classes/class_resource.rst index 1ac0b088a..7ab912902 100644 --- a/classes/class_resource.rst +++ b/classes/class_resource.rst @@ -12,7 +12,7 @@ Resource **Inherits:** :ref:`RefCounted` **<** :ref:`Object` -**Inherited By:** :ref:`Animation`, :ref:`AnimationLibrary`, :ref:`AnimationNode`, :ref:`AnimationNodeStateMachinePlayback`, :ref:`AnimationNodeStateMachineTransition`, :ref:`AudioBusLayout`, :ref:`AudioEffect`, :ref:`AudioStream`, :ref:`BitMap`, :ref:`BoneMap`, :ref:`ButtonGroup`, :ref:`CameraAttributes`, :ref:`CryptoKey`, :ref:`Curve`, :ref:`Curve2D`, :ref:`Curve3D`, :ref:`EditorNode3DGizmoPlugin`, :ref:`EditorSettings`, :ref:`Environment`, :ref:`Font`, :ref:`GLTFAccessor`, :ref:`GLTFAnimation`, :ref:`GLTFBufferView`, :ref:`GLTFCamera`, :ref:`GLTFDocument`, :ref:`GLTFDocumentExtension`, :ref:`GLTFLight`, :ref:`GLTFMesh`, :ref:`GLTFNode`, :ref:`GLTFSkeleton`, :ref:`GLTFSkin`, :ref:`GLTFSpecGloss`, :ref:`GLTFState`, :ref:`GLTFTexture`, :ref:`GLTFTextureSampler`, :ref:`Gradient`, :ref:`Image`, :ref:`ImporterMesh`, :ref:`InputEvent`, :ref:`LabelSettings`, :ref:`LightmapGIData`, :ref:`Material`, :ref:`Mesh`, :ref:`MeshLibrary`, :ref:`MissingResource`, :ref:`MultiMesh`, :ref:`NativeExtension`, :ref:`NavigationMesh`, :ref:`NavigationPolygon`, :ref:`Noise`, :ref:`Occluder3D`, :ref:`OccluderPolygon2D`, :ref:`OggPacketSequence`, :ref:`OpenXRAction`, :ref:`OpenXRActionMap`, :ref:`OpenXRActionSet`, :ref:`OpenXRInteractionProfile`, :ref:`OpenXRIPBinding`, :ref:`PackedDataContainer`, :ref:`PackedScene`, :ref:`PhysicsMaterial`, :ref:`PolygonPathFinder`, :ref:`RDShaderFile`, :ref:`RDShaderSPIRV`, :ref:`RichTextEffect`, :ref:`SceneReplicationConfig`, :ref:`Script`, :ref:`Shader`, :ref:`ShaderInclude`, :ref:`Shape2D`, :ref:`Shape3D`, :ref:`Shortcut`, :ref:`SkeletonModification2D`, :ref:`SkeletonModification3D`, :ref:`SkeletonModificationStack2D`, :ref:`SkeletonModificationStack3D`, :ref:`SkeletonProfile`, :ref:`Skin`, :ref:`Sky`, :ref:`SpriteFrames`, :ref:`StyleBox`, :ref:`SyntaxHighlighter`, :ref:`Texture`, :ref:`Theme`, :ref:`TileMapPattern`, :ref:`TileSet`, :ref:`TileSetSource`, :ref:`Translation`, :ref:`VideoStream`, :ref:`VisualShaderNode`, :ref:`VoxelGIData`, :ref:`World2D`, :ref:`World3D`, :ref:`X509Certificate` +**Inherited By:** :ref:`Animation`, :ref:`AnimationLibrary`, :ref:`AnimationNode`, :ref:`AnimationNodeStateMachinePlayback`, :ref:`AnimationNodeStateMachineTransition`, :ref:`AudioBusLayout`, :ref:`AudioEffect`, :ref:`AudioStream`, :ref:`BitMap`, :ref:`BoneMap`, :ref:`ButtonGroup`, :ref:`CameraAttributes`, :ref:`CryptoKey`, :ref:`Curve`, :ref:`Curve2D`, :ref:`Curve3D`, :ref:`EditorNode3DGizmoPlugin`, :ref:`EditorSettings`, :ref:`Environment`, :ref:`Font`, :ref:`GDExtension`, :ref:`GLTFAccessor`, :ref:`GLTFAnimation`, :ref:`GLTFBufferView`, :ref:`GLTFCamera`, :ref:`GLTFDocument`, :ref:`GLTFDocumentExtension`, :ref:`GLTFLight`, :ref:`GLTFMesh`, :ref:`GLTFNode`, :ref:`GLTFSkeleton`, :ref:`GLTFSkin`, :ref:`GLTFSpecGloss`, :ref:`GLTFState`, :ref:`GLTFTexture`, :ref:`GLTFTextureSampler`, :ref:`Gradient`, :ref:`Image`, :ref:`ImporterMesh`, :ref:`InputEvent`, :ref:`LabelSettings`, :ref:`LightmapGIData`, :ref:`Material`, :ref:`Mesh`, :ref:`MeshLibrary`, :ref:`MissingResource`, :ref:`MultiMesh`, :ref:`NavigationMesh`, :ref:`NavigationPolygon`, :ref:`Noise`, :ref:`Occluder3D`, :ref:`OccluderPolygon2D`, :ref:`OggPacketSequence`, :ref:`OpenXRAction`, :ref:`OpenXRActionMap`, :ref:`OpenXRActionSet`, :ref:`OpenXRInteractionProfile`, :ref:`OpenXRIPBinding`, :ref:`PackedDataContainer`, :ref:`PackedScene`, :ref:`PhysicsMaterial`, :ref:`PolygonPathFinder`, :ref:`RDShaderFile`, :ref:`RDShaderSPIRV`, :ref:`RichTextEffect`, :ref:`SceneReplicationConfig`, :ref:`Script`, :ref:`Shader`, :ref:`ShaderInclude`, :ref:`Shape2D`, :ref:`Shape3D`, :ref:`Shortcut`, :ref:`SkeletonModification2D`, :ref:`SkeletonModification3D`, :ref:`SkeletonModificationStack2D`, :ref:`SkeletonModificationStack3D`, :ref:`SkeletonProfile`, :ref:`Skin`, :ref:`Sky`, :ref:`SpriteFrames`, :ref:`StyleBox`, :ref:`SyntaxHighlighter`, :ref:`Texture`, :ref:`Theme`, :ref:`TileMapPattern`, :ref:`TileSet`, :ref:`TileSetSource`, :ref:`Translation`, :ref:`VideoStream`, :ref:`VisualShaderNode`, :ref:`VoxelGIData`, :ref:`World2D`, :ref:`World3D`, :ref:`X509Certificate` Base class for all resources. diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst index e9bc97b4a..0230a6430 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -205,7 +205,7 @@ Methods +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`push_strikethrough` **(** **)** | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`push_table` **(** :ref:`int` columns, :ref:`InlineAlignment` inline_align=0 **)** | + | void | :ref:`push_table` **(** :ref:`int` columns, :ref:`InlineAlignment` inline_align=0, :ref:`int` align_to_row=-1 **)** | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`push_underline` **(** **)** | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1663,7 +1663,7 @@ Adds a ``[s]`` tag to the tag stack. .. rst-class:: classref-method -void **push_table** **(** :ref:`int` columns, :ref:`InlineAlignment` inline_align=0 **)** +void **push_table** **(** :ref:`int` columns, :ref:`InlineAlignment` inline_align=0, :ref:`int` align_to_row=-1 **)** Adds a ``[table=columns,inline_align]`` tag to the tag stack. diff --git a/classes/class_scenetree.rst b/classes/class_scenetree.rst index fb0d506dd..92529c5d3 100644 --- a/classes/class_scenetree.rst +++ b/classes/class_scenetree.rst @@ -264,6 +264,8 @@ Call a group with a one-frame delay (idle frame, not physics). Call a group only once even if the call is executed many times. +\ **Note:** Arguments are not taken into account when deciding whether the call is unique or not. Therefore when the same method is called with different arguments, only the first call will be performed. + .. rst-class:: classref-section-separator ---- diff --git a/classes/class_signal.rst b/classes/class_signal.rst index 0a31fad1a..05c5c6708 100644 --- a/classes/class_signal.rst +++ b/classes/class_signal.rst @@ -19,7 +19,7 @@ Description **Signal** is a built-in :ref:`Variant` type that represents a signal of an :ref:`Object` instance. Like all :ref:`Variant` types, it can be stored in variables and passed to functions. Signals allow all connected :ref:`Callable`\ s (and by extension their respective objects) to listen and react to events, without directly referencing one another. This keeps the code flexible and easier to manage. -In GDScript, signals can be declared with the ``signal`` keyword. In C#, you may use the ``\ **Signal**\ `` attribute on a delegate. +In GDScript, signals can be declared with the ``signal`` keyword. In C#, you may use the ``[Signal]`` attribute on a delegate. .. tabs:: @@ -34,12 +34,12 @@ In GDScript, signals can be declared with the ``signal`` keyword. In C#, you may .. code-tab:: csharp - **Signal**\ + [Signal] delegate void Attacked(); // Additional arguments may be declared. // These arguments must be passed when the signal is emitted. - **Signal**\ + [Signal] delegate void ItemDropped(itemName: string, amount: int); diff --git a/classes/class_spotlight3d.rst b/classes/class_spotlight3d.rst index 2f7136422..16fe59768 100644 --- a/classes/class_spotlight3d.rst +++ b/classes/class_spotlight3d.rst @@ -38,17 +38,19 @@ Properties .. table:: :widths: auto - +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------+ - | :ref:`float` | shadow_bias | ``0.03`` (overrides :ref:`Light3D`) | - +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------+ - | :ref:`float` | :ref:`spot_angle` | ``45.0`` | - +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------+ - | :ref:`float` | :ref:`spot_angle_attenuation` | ``1.0`` | - +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------+ - | :ref:`float` | :ref:`spot_attenuation` | ``1.0`` | - +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------+ - | :ref:`float` | :ref:`spot_range` | ``5.0`` | - +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------+ + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | shadow_bias | ``0.03`` (overrides :ref:`Light3D`) | + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | shadow_normal_bias | ``1.0`` (overrides :ref:`Light3D`) | + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`spot_angle` | ``45.0`` | + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`spot_angle_attenuation` | ``1.0`` | + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`spot_attenuation` | ``1.0`` | + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`spot_range` | ``5.0`` | + +---------------------------+----------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator diff --git a/classes/class_string.rst b/classes/class_string.rst index b5fbf67b5..f79cd0993 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -10,14 +10,18 @@ String ====== -Built-in string class. +Built-in string Variant type. .. rst-class:: classref-introduction-group Description ----------- -This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference-counted and use a copy-on-write approach, so passing them around is cheap in resources. +This is the built-in string Variant type (and the one used by GDScript). Strings may contain any number of Unicode characters, and expose methods useful for manipulating and generating strings. Strings are reference-counted and use a copy-on-write approach (every modification to a string returns a new **String**), so passing them around is cheap in resources. + +Some string methods have corresponding variations. Variations suffixed with ``n`` (:ref:`countn`, :ref:`findn`, :ref:`replacen`, etc.) are **case-insensitive** (they make no distinction between uppercase and lowercase letters). Method variations prefixed with ``r`` (:ref:`rfind`, :ref:`rsplit`, etc.) are reversed, and start from the end of the string, instead of the beginning. + +\ **Note:** In a boolean context, a string will evaluate to ``false`` if it is empty (``""``). Otherwise, a string will always evaluate to ``true``. .. rst-class:: classref-introduction-group @@ -267,6 +271,8 @@ Operators +-----------------------------+----------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`operator +` **(** :ref:`String` right **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`operator +` **(** :ref:`StringName` right **)** | + +-----------------------------+----------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator \<` **(** :ref:`String` right **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator \<=` **(** :ref:`String` right **)** | @@ -344,7 +350,7 @@ Method Descriptions :ref:`bool` **begins_with** **(** :ref:`String` text **)** |const| -Returns ``true`` if the string begins with the given string. +Returns ``true`` if the string begins with the given ``text``. See also :ref:`ends_with`. .. rst-class:: classref-item-separator @@ -356,11 +362,11 @@ Returns ``true`` if the string begins with the given string. :ref:`PackedStringArray` **bigrams** **(** **)** |const| -Returns an array containing the bigrams (pairs of consecutive letters) of this string. +Returns an array containing the bigrams (pairs of consecutive characters) of this string. :: - print("Bigrams".bigrams()) # Prints ["Bi", "ig", "gr", "ra", "am", "ms"] + print("Get up!".bigrams()) # Prints ["Ge", "et", "t ", " u", "up", "p!"] .. rst-class:: classref-item-separator @@ -372,20 +378,22 @@ Returns an array containing the bigrams (pairs of consecutive letters) of this s :ref:`int` **bin_to_int** **(** **)** |const| -Converts a string containing a binary number into an integer. Binary strings can either be prefixed with ``0b`` or not, and they can also start with a ``-`` before the optional prefix. +Converts the string representing a binary number into an :ref:`int`. The string may optionally be prefixed with ``"0b"``, and an additional ``-`` prefix for negative numbers. .. tabs:: .. code-tab:: gdscript - print("0b101".bin_to_int()) # Prints "5". - print("101".bin_to_int()) # Prints "5". + print("101".bin_to_int()) # Prints 5 + print("0b101".bin_to_int()) # Prints 5 + print("-0b10".bin_to_int()) # Prints -2 .. code-tab:: csharp - GD.Print("0b101".BinToInt()); // Prints "5". - GD.Print("101".BinToInt()); // Prints "5". + GD.Print("101".BinToInt()); // Prints 5 + GD.Print("0b101".BinToInt()); // Prints 5 + GD.Print("-0b10".BinToInt()); // Prints -2 @@ -425,7 +433,24 @@ Returns a copy of the string with escaped characters replaced by their meanings. :ref:`String` **capitalize** **(** **)** |const| -Changes the case of some letters. Replaces underscores with spaces, adds spaces before in-word uppercase characters, converts all letters to lowercase, then capitalizes the first letter and every letter following a space character. For ``capitalize camelCase mixed_with_underscores``, it will return ``Capitalize Camel Case Mixed With Underscores``. +Changes the appearance of the string: replaces underscores (``_``) with spaces, adds spaces before uppercase letters in the middle of a word, converts all letters to lowercase, then converts the first one and each one following a space to uppercase. + + +.. tabs:: + + .. code-tab:: gdscript + + "move_local_x".capitalize() # Returns "Move Local X" + "sceneFile_path".capitalize() # Returns "Scene File Path" + + .. code-tab:: csharp + + "move_local_x".Capitalize(); // Returns "Move Local X" + "sceneFile_path".Capitalize(); // Returns "Scene File Path" + + + +\ **Note:** This method not the same as the default appearance of properties in the Inspector dock, as it does not capitalize acronyms (``"2D"``, ``"FPS"``, ``"PNG"``, etc.) as you may expect. .. rst-class:: classref-item-separator @@ -437,13 +462,11 @@ Changes the case of some letters. Replaces underscores with spaces, adds spaces :ref:`int` **casecmp_to** **(** :ref:`String` to **)** |const| -Performs a case-sensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. +Performs a case-sensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "Less than" and "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. -\ **Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. +With different string lengths, returns ``1`` if this string is longer than the ``to`` string, or ``-1`` if shorter. Note that the length of empty strings is *always* ``0``. -\ **Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. - -To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`naturalnocasecmp_to`. +To get a :ref:`bool` result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`naturalnocasecmp_to`. .. rst-class:: classref-item-separator @@ -455,11 +478,11 @@ To get a boolean result from a string comparison, use the ``==`` operator instea :ref:`String` **chr** **(** :ref:`int` char **)** |static| -Directly converts an decimal integer to a unicode character. Tables of these characters can be found in various locations, for example `here. `__\ +Returns a single Unicode character from the decimal ``char``. You may use `unicodelookup.com `__ or `unicode.org `__ as points of reference. :: - print(String.chr(65)) # Prints "A" + print(String.chr(65)) # Prints "A" print(String.chr(129302)) # Prints "🤖" (robot face emoji) .. rst-class:: classref-item-separator @@ -472,7 +495,25 @@ Directly converts an decimal integer to a unicode character. Tables of these cha :ref:`bool` **contains** **(** :ref:`String` what **)** |const| -Returns ``true`` if the string contains the given string. +Returns ``true`` if the string contains ``what``. In GDScript, this corresponds to the ``in`` operator. + + +.. tabs:: + + .. code-tab:: gdscript + + print("Node".contains("de")) # Prints true + print("team".contains("I")) # Prints false + print("I" in "team") # Prints false + + .. code-tab:: csharp + + GD.Print("Node".Contains("de")); // Prints true + GD.Print("team".Contains("I")); // Prints false + + + +If you need to know where ``what`` is within the string, use :ref:`find`. .. rst-class:: classref-item-separator @@ -484,7 +525,7 @@ Returns ``true`` if the string contains the given string. :ref:`int` **count** **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| -Returns the number of occurrences of substring ``what`` between ``from`` and ``to`` positions. If ``from`` and ``to`` equals 0 the whole string will be used. If only ``to`` equals 0 the remained substring will be used. +Returns the number of occurrences of the substring ``what`` between ``from`` and ``to`` positions. If ``to`` is 0, the search continues until the end of the string. .. rst-class:: classref-item-separator @@ -496,7 +537,7 @@ Returns the number of occurrences of substring ``what`` between ``from`` and ``t :ref:`int` **countn** **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| -Returns the number of occurrences of substring ``what`` (ignoring case) between ``from`` and ``to`` positions. If ``from`` and ``to`` equals 0 the whole string will be used. If only ``to`` equals 0 the remained substring will be used. +Returns the number of occurrences of the substring ``what`` between ``from`` and ``to`` positions, **ignoring case**. If ``to`` is 0, the search continues until the end of the string. .. rst-class:: classref-item-separator @@ -520,7 +561,7 @@ Returns a copy of the string with indentation (leading tabs and spaces) removed. :ref:`bool` **ends_with** **(** :ref:`String` text **)** |const| -Returns ``true`` if the string ends with the given string. +Returns ``true`` if the string ends with the given ``text``. See also :ref:`begins_with`. .. rst-class:: classref-item-separator @@ -532,24 +573,31 @@ Returns ``true`` if the string ends with the given string. :ref:`int` **find** **(** :ref:`String` what, :ref:`int` from=0 **)** |const| -Returns the index of the **first** case-sensitive occurrence of the specified string in this instance, or ``-1``. Optionally, the starting search index can be specified, continuing to the end of the string. - -\ **Note:** If you just want to know whether a string contains a substring, use the ``in`` operator as follows: +Returns the index of the **first** occurrence of ``what`` in this string, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the end of the string. .. tabs:: .. code-tab:: gdscript - print("i" in "team") # Will print `false`. + print("Team".find("I")) # Prints -1 + + print("Potato".find("t")) # Prints 2 + print("Potato".find("t", 3)) # Prints 4 + print("Potato".find("t", 5)) # Prints -1 .. code-tab:: csharp - // C# has no in operator, but we can use `Contains()`. - GD.Print("team".Contains("i")); // Will print `false`. + GD.Print("Team".Find("I")); // Prints -1 + + GD.Print("Potato".Find("t")); // Prints 2 + GD.print("Potato".Find("t", 3)); // Prints 4 + GD.print("Potato".Find("t", 5)); // Prints -1 +\ **Note:** If you just want to know whether the string contains ``what``, use :ref:`contains`. In GDScript, you may also use the ``in`` operator. + .. rst-class:: classref-item-separator ---- @@ -560,7 +608,7 @@ Returns the index of the **first** case-sensitive occurrence of the specified st :ref:`int` **findn** **(** :ref:`String` what, :ref:`int` from=0 **)** |const| -Returns the index of the **first** case-insensitive occurrence of the specified string in this instance, or ``-1``. Optionally, the starting search index can be specified, continuing to the end of the string. +Returns the index of the **first** **case-insensitive** occurrence of ``what`` in this string, or ``-1`` if there are none. The starting search index can be specified with ``from``, continuing to the end of the string. .. rst-class:: classref-item-separator @@ -578,21 +626,23 @@ Formats the string by replacing all occurrences of ``placeholder`` with the elem :: - # Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is named after it. + # Prints "Waiting for Godot is a play by Samuel Beckett, and Godot Engine is named after it." var use_array_values = "Waiting for {0} is a play by {1}, and {0} Engine is named after it." print(use_array_values.format(["Godot", "Samuel Beckett"])) - # Prints: User 42 is Godot. + # Prints "User 42 is Godot." print("User {id} is {name}.".format({"id": 42, "name": "Godot"})) -Some additional handling is performed when ``values`` is an array. If ``placeholder`` does not contain an underscore, the elements of the array will be used to replace one occurrence of the placeholder in turn; If an array element is another 2-element array, it'll be interpreted as a key-value pair. +Some additional handling is performed when ``values`` is an :ref:`Array`. If ``placeholder`` does not contain an underscore, the elements of the ``values`` array will be used to replace one occurrence of the placeholder in order; If an element of ``values`` is another 2-element array, it'll be interpreted as a key-value pair. :: - # Prints: User 42 is Godot. + # Prints "User 42 is Godot." print("User {} is {}.".format([42, "Godot"], "{}")) print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]])) +See also the :doc:`GDScript format string <../tutorials/scripting/gdscript/gdscript_format_string>` tutorial. + .. rst-class:: classref-item-separator ---- @@ -605,6 +655,10 @@ Some additional handling is performed when ``values`` is an array. If ``placehol If the string is a valid file path, returns the base directory name. +:: + + var dir_path = "/path/to/file.txt".get_base_dir() # dir_path is "/path/to" + .. rst-class:: classref-item-separator ---- @@ -615,7 +669,11 @@ If the string is a valid file path, returns the base directory name. :ref:`String` **get_basename** **(** **)** |const| -If the string is a valid file path, returns the full file path without the extension. +If the string is a valid file path, returns the full file path, without the extension. + +:: + + var base = "/path/to/file.txt".get_basename() # base is "/path/to/file" .. rst-class:: classref-item-separator @@ -627,18 +685,19 @@ If the string is a valid file path, returns the full file path without the exten :ref:`String` **get_extension** **(** **)** |const| -Returns the extension without the leading period character (``.``) if the string is a valid file name or path. If the string does not contain an extension, returns an empty string instead. +If the string is a valid file name or path, returns the file extension without the leading period (``.``). Otherwise, returns an empty string. :: - print("/path/to/file.txt".get_extension()) # "txt" - print("file.txt".get_extension()) # "txt" - print("file.sample.txt".get_extension()) # "txt" - print(".txt".get_extension()) # "txt" - print("file.txt.".get_extension()) # "" (empty string) - print("file.txt..".get_extension()) # "" (empty string) - print("txt".get_extension()) # "" (empty string) - print("".get_extension()) # "" (empty string) + var a = "/path/to/file.txt".get_extension() # a is "txt" + var b = "cool.txt".get_extension() # b is "txt" + var c = "cool.font.tres".get_extension() # c is "tres" + var d = ".pack1".get_extension() # d is "pack1" + + var e = "file.txt.".get_extension() # e is "" + var f = "file.txt..".get_extension() # f is "" + var g = "txt".get_extension() # g is "" + var h = "".get_extension() # h is "" .. rst-class:: classref-item-separator @@ -650,7 +709,11 @@ Returns the extension without the leading period character (``.``) if the string :ref:`String` **get_file** **(** **)** |const| -If the string is a valid file path, returns the filename. +If the string is a valid file path, returns the file name, including the extension. + +:: + + var file = "/path/to/icon.png".get_file() # file is "icon.png" .. rst-class:: classref-item-separator @@ -662,15 +725,15 @@ If the string is a valid file path, returns the filename. :ref:`String` **get_slice** **(** :ref:`String` delimiter, :ref:`int` slice **)** |const| -Splits a string using a ``delimiter`` and returns a substring at index ``slice``. Returns an empty string if the index doesn't exist. +Splits the string using a ``delimiter`` and returns the substring at index ``slice``. Returns an empty string if the ``slice`` does not exist. -This is a more performant alternative to :ref:`split` for cases when you need only one element from the array at a fixed index. +This is faster than :ref:`split`, if you only need one substring. \ **Example:**\ :: - print("i/am/example/string".get_slice("/", 2)) # Prints 'example'. + print("i/am/example/hi".get_slice("/", 2)) # Prints "example" .. rst-class:: classref-item-separator @@ -682,7 +745,7 @@ This is a more performant alternative to :ref:`split` :ref:`int` **get_slice_count** **(** :ref:`String` delimiter **)** |const| -Splits a string using a ``delimiter`` and returns a number of slices. +Returns the total number of slices when the string is split with the given ``delimiter`` (see :ref:`split`). .. rst-class:: classref-item-separator @@ -694,9 +757,9 @@ Splits a string using a ``delimiter`` and returns a number of slices. :ref:`String` **get_slicec** **(** :ref:`int` delimiter, :ref:`int` slice **)** |const| -Splits a string using a Unicode character with code ``delimiter`` and returns a substring at index ``slice``. Returns an empty string if the index doesn't exist. +Splits the string using a Unicode character with code ``delimiter`` and returns the substring at index ``slice``. Returns an empty string if the ``slice`` does not exist. -This is a more performant alternative to :ref:`split` for cases when you need only one element from the array at a fixed index. +This is faster than :ref:`split`, if you only need one substring. .. rst-class:: classref-item-separator @@ -710,7 +773,7 @@ This is a more performant alternative to :ref:`split` Returns the 32-bit hash value representing the string's contents. -\ **Note:** **String**\ s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the strings are equal, because different strings can have identical hash values due to hash collisions. +\ **Note:** Strings with equal hash values are *not* guaranteed to be the same, as a result of hash collisions. On the countrary, strings with different hash values are guaranteed to be different. .. rst-class:: classref-item-separator @@ -722,20 +785,20 @@ Returns the 32-bit hash value representing the string's contents. :ref:`int` **hex_to_int** **(** **)** |const| -Converts a string containing a hexadecimal number into an integer. Hexadecimal strings can either be prefixed with ``0x`` or not, and they can also start with a ``-`` before the optional prefix. +Converts the string representing a hexadecimal number into an :ref:`int`. The string may be optionally prefixed with ``"0x"``, and an additional ``-`` prefix for negative numbers. .. tabs:: .. code-tab:: gdscript - print("0xff".hex_to_int()) # Prints "255". - print("ab".hex_to_int()) # Prints "171". + print("0xff".hex_to_int()) # Prints 255 + print("ab".hex_to_int()) # Prints 171 .. code-tab:: csharp - GD.Print("0xff".HexToInt()); // Prints "255". - GD.Print("ab".HexToInt()); // Prints "171". + GD.Print("0xff".HexToInt()); // Prints 255 + GD.Print("ab".HexToInt()); // Prints 171 @@ -749,9 +812,9 @@ Converts a string containing a hexadecimal number into an integer. Hexadecimal s :ref:`String` **humanize_size** **(** :ref:`int` size **)** |static| -Converts an integer representing a number of bytes into a human-readable form. +Converts ``size`` which represents a number of bytes into a human-readable form. -Note that this output is in `IEC prefix format `__, and includes ``B``, ``KiB``, ``MiB``, ``GiB``, ``TiB``, ``PiB``, and ``EiB``. +The result is in `IEC prefix format `__, which may end in either ``"B"``, ``"KiB"``, ``"MiB"``, ``"GiB"``, ``"TiB"``, ``"PiB"``, or ``"EiB"``. .. rst-class:: classref-item-separator @@ -763,11 +826,9 @@ Note that this output is in `IEC prefix format ` **indent** **(** :ref:`String` prefix **)** |const| -Returns a copy of the string with lines indented with ``prefix``. +Indents every line of the string with the given ``prefix``. Empty lines are not indented. See also :ref:`dedent` to remove indentation. -For example, the string can be indented with two tabs using ``"\t\t"``, or four spaces using ``" "``. The prefix can be any string so it can also be used to comment out strings with e.g. ``"# "``. See also :ref:`dedent` to remove indentation. - -\ **Note:** Empty lines are kept empty. +For example, the string can be indented with two tabulations using ``"\t\t"``, or four spaces using ``" "``. .. rst-class:: classref-item-separator @@ -779,7 +840,7 @@ For example, the string can be indented with two tabs using ``"\t\t"``, or four :ref:`String` **insert** **(** :ref:`int` position, :ref:`String` what **)** |const| -Returns a copy of the string with the substring ``what`` inserted at the given ``position``. +Inserts ``what`` at the given ``position`` in the string. .. rst-class:: classref-item-separator @@ -791,7 +852,9 @@ Returns a copy of the string with the substring ``what`` inserted at the given ` :ref:`bool` **is_absolute_path** **(** **)** |const| -Returns ``true`` if the string is a path to a file or directory and its starting point is explicitly defined. This includes ``res://``, ``user://``, ``C:\``, ``/``, etc. +Returns ``true`` if the string is a path to a file or directory, and its starting point is explicitly defined. This method is the opposite of :ref:`is_relative_path`. + +This includes all paths starting with ``"res://"``, ``"user://"``, ``"C:\"``, ``"/"``, etc. .. rst-class:: classref-item-separator @@ -803,7 +866,7 @@ Returns ``true`` if the string is a path to a file or directory and its starting :ref:`bool` **is_empty** **(** **)** |const| -Returns ``true`` if the length of the string equals ``0``. +Returns ``true`` if the string's length is ``0`` (``""``). See also :ref:`length`. .. rst-class:: classref-item-separator @@ -815,7 +878,7 @@ Returns ``true`` if the length of the string equals ``0``. :ref:`bool` **is_relative_path** **(** **)** |const| -Returns ``true`` if the string is a path to a file or directory and its starting point is implicitly defined within the context it is being used. The starting point may refer to the current directory (``./``), or the current :ref:`Node`. +Returns ``true`` if the string is a path, and its starting point is dependent on context. The path could begin from the current directory, or the current :ref:`Node` (if the string is derived from a :ref:`NodePath`), and may sometimes be prefixed with ``"./"``. This method is the opposite of :ref:`is_absolute_path`. .. rst-class:: classref-item-separator @@ -827,7 +890,16 @@ Returns ``true`` if the string is a path to a file or directory and its starting :ref:`bool` **is_subsequence_of** **(** :ref:`String` text **)** |const| -Returns ``true`` if this string is a subsequence of the given string. +Returns ``true`` if all characters of this string can be found in ``text`` in their original order. + +:: + + var text = "Wow, incredible!" + + print("inedible".is_subsequence_of(text)) # Prints true + print("Word!".is_subsequence_of(text)) # Prints true + print("Window".is_subsequence_of(text)) # Prints false + print("".is_subsequence_of(text)) # Prints true .. rst-class:: classref-item-separator @@ -839,7 +911,7 @@ Returns ``true`` if this string is a subsequence of the given string. :ref:`bool` **is_subsequence_ofn** **(** :ref:`String` text **)** |const| -Returns ``true`` if this string is a subsequence of the given string, without considering case. +Returns ``true`` if all characters of this string can be found in ``text`` in their original order, **ignoring case**. .. rst-class:: classref-item-separator @@ -851,9 +923,7 @@ Returns ``true`` if this string is a subsequence of the given string, without co :ref:`bool` **is_valid_filename** **(** **)** |const| -Returns ``true`` if this string is free from characters that aren't allowed in file names, those being: - -\ ``: / \ ? * " | % < >`` +Returns ``true`` if this string does not contain characters that are not allowed in file names (``:`` ``/`` ``\`` ``?`` ``*`` ``"`` ``|`` ``%`` ``<`` ``>``). .. rst-class:: classref-item-separator @@ -865,14 +935,14 @@ Returns ``true`` if this string is free from characters that aren't allowed in f :ref:`bool` **is_valid_float** **(** **)** |const| -Returns ``true`` if this string contains a valid float. This is inclusive of integers, and also supports exponents: +Returns ``true`` if this string represents a valid floating-point number. A valid float may contain only digits, one decimal point (``.``), and the exponent letter (``e``). It may also be prefixed with a positive (``+``) or negative (``-``) sign. Any valid integer is also a valid float (see :ref:`is_valid_int`). See also :ref:`to_float`. :: - print("1.7".is_valid_float()) # Prints "true" - print("24".is_valid_float()) # Prints "true" - print("7e3".is_valid_float()) # Prints "true" - print("Hello".is_valid_float()) # Prints "false" + print("1.7".is_valid_float()) # Prints true + print("24".is_valid_float()) # Prints true + print("7e3".is_valid_float()) # Prints true + print("Hello".is_valid_float()) # Prints false .. rst-class:: classref-item-separator @@ -884,7 +954,17 @@ Returns ``true`` if this string contains a valid float. This is inclusive of int :ref:`bool` **is_valid_hex_number** **(** :ref:`bool` with_prefix=false **)** |const| -Returns ``true`` if this string contains a valid hexadecimal number. If ``with_prefix`` is ``true``, then a validity of the hexadecimal number is determined by the ``0x`` prefix, for example: ``0xDEADC0DE``. +Returns ``true`` if this string is a valid hexadecimal number. A valid hexadecimal number only contains digits or letters ``A`` to ``F`` (either uppercase or lowercase), and may be prefixed with a positive (``+``) or negative (``-``) sign. + +If ``with_prefix`` is ``true``, the hexadecimal number needs to prefixed by ``"0x"`` to be considered valid. + +:: + + print("A08E".is_valid_hex_number()) # Prints true + print("-AbCdEf".is_valid_hex_number()) # Prints true + print("2.5".is_valid_hex_number()) # Prints false + + print("0xDEADC0DE".is_valid_hex_number(true)) # Prints true .. rst-class:: classref-item-separator @@ -896,7 +976,7 @@ Returns ``true`` if this string contains a valid hexadecimal number. If ``with_p :ref:`bool` **is_valid_html_color** **(** **)** |const| -Returns ``true`` if this string contains a valid color in hexadecimal HTML notation. Other HTML notations such as named colors or ``hsl()`` colors aren't considered valid by this method and will return ``false``. +Returns ``true`` if this string is a valid color in hexadecimal HTML notation. The string must be a hexadecimal value (see :ref:`is_valid_hex_number`) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign (``#``). Other HTML notations for colors, such as names or ``hsl()``, are not considered valid. See also :ref:`Color.html`. .. rst-class:: classref-item-separator @@ -908,13 +988,14 @@ Returns ``true`` if this string contains a valid color in hexadecimal HTML notat :ref:`bool` **is_valid_identifier** **(** **)** |const| -Returns ``true`` if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (``_``) and the first character may not be a digit. +Returns ``true`` if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (``_``), and the first character may not be a digit. :: - print("good_ident_1".is_valid_identifier()) # Prints "true" - print("1st_bad_ident".is_valid_identifier()) # Prints "false" - print("bad_ident_#2".is_valid_identifier()) # Prints "false" + print("node_2d".is_valid_identifier()) # Prints true + print("TYPE_FLOAT".is_valid_identifier()) # Prints true + print("1st_method".is_valid_identifier()) # Prints false + print("MyMethod#2".is_valid_identifier()) # Prints false .. rst-class:: classref-item-separator @@ -926,15 +1007,15 @@ Returns ``true`` if this string is a valid identifier. A valid identifier may co :ref:`bool` **is_valid_int** **(** **)** |const| -Returns ``true`` if this string contains a valid integer. +Returns ``true`` if this string represents a valid integer. A valid integer only contains digits, and may be prefixed with a positive (``+``) or negative (``-``) sign. See also :ref:`to_int`. :: - print("7".is_valid_int()) # Prints "true" - print("14.6".is_valid_int()) # Prints "false" - print("L".is_valid_int()) # Prints "false" - print("+3".is_valid_int()) # Prints "true" - print("-12".is_valid_int()) # Prints "true" + print("7".is_valid_int()) # Prints true + print("1.65".is_valid_int()) # Prints false + print("Hi".is_valid_int()) # Prints false + print("+3".is_valid_int()) # Prints true + print("-12".is_valid_int()) # Prints true .. rst-class:: classref-item-separator @@ -946,7 +1027,7 @@ Returns ``true`` if this string contains a valid integer. :ref:`bool` **is_valid_ip_address** **(** **)** |const| -Returns ``true`` if this string contains only a well-formatted IPv4 or IPv6 address. This method considers `reserved IP addresses `__ such as ``0.0.0.0`` as valid. +Returns ``true`` if this string represents a well-formatted IPv4 or IPv6 address. This method considers `reserved IP addresses `__ such as ``"0.0.0.0"`` and ``"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"`` as valid. .. rst-class:: classref-item-separator @@ -958,7 +1039,7 @@ Returns ``true`` if this string contains only a well-formatted IPv4 or IPv6 addr :ref:`String` **join** **(** :ref:`PackedStringArray` parts **)** |const| -Returns a **String** which is the concatenation of the ``parts``. The separator between elements is the string providing this method. +Returns the concatenation of ``parts``' elements, with each element separated by the string calling this method. This method is the opposite of :ref:`split`. \ **Example:**\ @@ -967,11 +1048,18 @@ Returns a **String** which is the concatenation of the ``parts``. The separator .. code-tab:: gdscript - print(", ".join(["One", "Two", "Three", "Four"])) + var fruits = ["Apple", "Orange", "Pear", "Kiwi"] + + print(", ".join(fruits)) # Prints "Apple, Orange, Pear, Kiwi" + print("---".join(fruits)) # Prints "Apple---Orange---Pear---Kiwi" .. code-tab:: csharp - GD.Print(String.Join(",", new string[] {"One", "Two", "Three", "Four"})); + var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"}; + + // In C#, this method is static. + GD.Print(string.Join(", ", fruits); // Prints "Apple, Orange, Pear, Kiwi" + GD.Print(string.Join("---", fruits)); // Prints "Apple---Orange---Pear---Kiwi" @@ -985,7 +1073,7 @@ Returns a **String** which is the concatenation of the ``parts``. The separator :ref:`String` **json_escape** **(** **)** |const| -Returns a copy of the string with special characters escaped using the JSON standard. +Returns a copy of the string with special characters escaped using the JSON standard. Because it closely matches the C standard, it is possible to use :ref:`c_unescape` to unescape the string, if necessary. .. rst-class:: classref-item-separator @@ -997,14 +1085,12 @@ Returns a copy of the string with special characters escaped using the JSON stan :ref:`String` **left** **(** :ref:`int` length **)** |const| -Returns a number of characters from the left of the string. If negative ``length`` is used, the characters are counted downwards from **String**'s length. - -\ **Example:**\ +Returns the first ``length`` characters from the beginning of the string. If ``length`` is negative, strips the last ``length`` characters from the string's end. :: - print("sample text".left(3)) #prints "sam" - print("sample text".left(-3)) #prints "sample t" + print("Hello World!".left(3)) # Prints "Hel" + print("Hello World!".left(-4)) # Prints "Hello Wo" .. rst-class:: classref-item-separator @@ -1016,7 +1102,7 @@ Returns a number of characters from the left of the string. If negative ``length :ref:`int` **length** **(** **)** |const| -Returns the number of characters in the string. +Returns the number of characters in the string. Empty strings (``""``) always return ``0``. See also :ref:`is_empty`. .. rst-class:: classref-item-separator @@ -1028,7 +1114,7 @@ Returns the number of characters in the string. :ref:`String` **lpad** **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| -Formats a string to be at least ``min_length`` long by adding ``character``\ s to the left of the string. +Formats the string to be at least ``min_length`` long by adding ``character``\ s to the left of the string, if necessary. See also :ref:`rpad`. .. rst-class:: classref-item-separator @@ -1040,9 +1126,9 @@ Formats a string to be at least ``min_length`` long by adding ``character``\ s t :ref:`String` **lstrip** **(** :ref:`String` chars **)** |const| -Returns a copy of the string with characters removed from the left. The ``chars`` argument is a string specifying the set of characters to be removed. +Removes a set of characters defined in ``chars`` from the string's beginning. See also :ref:`rstrip`. -\ **Note:** The ``chars`` is not a prefix. See :ref:`trim_prefix` method that will remove a single prefix string rather than a set of characters. +\ **Note:** ``chars`` is not a prefix. Use :ref:`trim_prefix` to remove a single prefix, rather than a set of characters. .. rst-class:: classref-item-separator @@ -1054,7 +1140,7 @@ Returns a copy of the string with characters removed from the left. The ``chars` :ref:`bool` **match** **(** :ref:`String` expr **)** |const| -Does a simple case-sensitive expression match, where ``"*"`` matches zero or more arbitrary characters and ``"?"`` matches any single character except a period (``"."``). An empty string or empty expression always evaluates to ``false``. +Does a simple expression match, where ``*`` matches zero or more arbitrary characters and ``?`` matches any single character except a period (``.``). An empty string or empty expression always evaluates to ``false``. .. rst-class:: classref-item-separator @@ -1066,7 +1152,7 @@ Does a simple case-sensitive expression match, where ``"*"`` matches zero or mor :ref:`bool` **matchn** **(** :ref:`String` expr **)** |const| -Does a simple case-insensitive expression match, where ``"*"`` matches zero or more arbitrary characters and ``"?"`` matches any single character except a period (``"."``). An empty string or empty expression always evaluates to ``false``. +Does a simple **case-insensitive** expression match, where ``*`` matches zero or more arbitrary characters and ``?`` matches any single character except a period (``.``). An empty string or empty expression always evaluates to ``false``. .. rst-class:: classref-item-separator @@ -1078,7 +1164,7 @@ Does a simple case-insensitive expression match, where ``"*"`` matches zero or m :ref:`PackedByteArray` **md5_buffer** **(** **)** |const| -Returns the MD5 hash of the string as an array of bytes. +Returns the `MD5 hash `__ of the string as a :ref:`PackedByteArray`. .. rst-class:: classref-item-separator @@ -1090,7 +1176,7 @@ Returns the MD5 hash of the string as an array of bytes. :ref:`String` **md5_text** **(** **)** |const| -Returns the MD5 hash of the string as a string. +Returns the `MD5 hash `__ of the string as another **String**. .. rst-class:: classref-item-separator @@ -1102,15 +1188,13 @@ Returns the MD5 hash of the string as a string. :ref:`int` **naturalnocasecmp_to** **(** :ref:`String` to **)** |const| -Performs a case-insensitive *natural order* comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. +Performs a **case-insensitive**, *natural order* comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "Less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. -When used for sorting, natural order comparison will order suites of numbers as expected by most people. If you sort the numbers from 1 to 10 using natural order, you will get ``[1, 2, 3, ...]`` instead of ``[1, 10, 2, 3, ...]``. +When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be ``["1", "2", "3", ...]``, not ``["1", "10", "2", "3", ...]``. -\ **Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. +With different string lengths, returns ``1`` if this string is longer than the ``to`` string, or ``-1`` if shorter. Note that the length of empty strings is *always* ``0``. -\ **Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. - -To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`casecmp_to`. +To get a :ref:`bool` result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`casecmp_to`. .. rst-class:: classref-item-separator @@ -1122,13 +1206,11 @@ To get a boolean result from a string comparison, use the ``==`` operator instea :ref:`int` **nocasecmp_to** **(** :ref:`String` to **)** |const| -Performs a case-insensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. +Performs a **case-insensitive** comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "Less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. -\ **Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. +With different string lengths, returns ``1`` if this string is longer than the ``to`` string, or ``-1`` if shorter. Note that the length of empty strings is *always* ``0``. -\ **Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. - -To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`casecmp_to` and :ref:`naturalnocasecmp_to`. +To get a :ref:`bool` result from a string comparison, use the ``==`` operator instead. See also :ref:`casecmp_to` and :ref:`naturalnocasecmp_to`. .. rst-class:: classref-item-separator @@ -1140,25 +1222,27 @@ To get a boolean result from a string comparison, use the ``==`` operator instea :ref:`String` **num** **(** :ref:`float` number, :ref:`int` decimals=-1 **)** |static| -Converts a :ref:`float` to a string representation of a decimal number. +Converts a :ref:`float` to a string representation of a decimal number, with the number of decimal places specified in ``decimals``. -The number of decimal places can be specified with ``decimals``. If ``decimals`` is ``-1`` (default), decimal places will be automatically adjusted so that the string representation has 14 significant digits (counting both digits to the left and the right of the decimal point). +If ``decimals`` is ``-1`` as by default, the string representation may only have up to 14 significant digits, with digits before the decimal point having priority over digits after. -Trailing zeros are not included in the string. The last digit will be rounded and not truncated. +Trailing zeros are not included in the string. The last digit is rounded, not truncated. \ **Example:**\ :: - String.num(3.141593) # "3.141593" - String.num(3.141593, 3) # "3.142" - String.num(3.14159300) # "3.141593", no trailing zeros. - # Last digit will be rounded up here, which reduces total digit count since - # trailing zeros are removed: - String.num(42.129999, 5) # "42.13" - # If `decimals` is not specified, the total number of significant digits is 14: - String.num(-0.0000012345432123454321) # "-0.00000123454321" - String.num(-10000.0000012345432123454321) # "-10000.0000012345" + String.num(3.141593) # Returns "3.141593" + String.num(3.141593, 3) # Returns "3.142" + String.num(3.14159300) # Returns "3.141593" + + # Here, the last digit will be rounded up, + # which reduces the total digit count, since trailing zeros are removed: + String.num(42.129999, 5) # Returns "42.13" + + # If `decimals` is not specified, the maximum number of significant digits is 14: + String.num(-0.0000012345432123454321) # Returns "-0.00000123454321" + String.num(-10000.0000012345432123454321) # Returns "-10000.0000012345" .. rst-class:: classref-item-separator @@ -1170,7 +1254,11 @@ Trailing zeros are not included in the string. The last digit will be rounded an :ref:`String` **num_int64** **(** :ref:`int` number, :ref:`int` base=10, :ref:`bool` capitalize_hex=false **)** |static| -Converts a signed :ref:`int` to a string representation of a number. +Converts the given ``number`` to a string representation, with the given ``base``. + +By default, ``base`` is set to decimal (``10``). Other common bases in programming include binary (``2``), `octal `__ (``8``), hexadecimal (``16``). + +If ``capitalize_hex`` is ``true``, digits higher than 9 are represented in uppercase. .. rst-class:: classref-item-separator @@ -1182,9 +1270,28 @@ Converts a signed :ref:`int` to a string representation of a number. :ref:`String` **num_scientific** **(** :ref:`float` number **)** |static| -.. container:: contribute +Converts the given ``number`` to a string representation, in scientific notation. - There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. tabs:: + + .. code-tab:: gdscript + + var n = -5.2e8 + print(n) # Prints -520000000 + print(String.NumScientific(n)) # Prints -5.2e+08 + + .. code-tab:: csharp + + // This method is not implemented in C#. + // Use `string.ToString()` with "e" to achieve similar results. + var n = -5.2e8f; + GD.Print(n); // Prints -520000000 + GD.Print(n.ToString("e1")); // Prints -5.2e+008 + + + +\ **Note:** In C#, this method is not implemented. To achieve similar results, see C#'s `Standard numeric format strings `__ .. rst-class:: classref-item-separator @@ -1196,7 +1303,11 @@ Converts a signed :ref:`int` to a string representation of a number. :ref:`String` **num_uint64** **(** :ref:`int` number, :ref:`int` base=10, :ref:`bool` capitalize_hex=false **)** |static| -Converts a unsigned :ref:`int` to a string representation of a number. +Converts the given unsigned :ref:`int` to a string representation, with the given ``base``. + +By default, ``base`` is set to decimal (``10``). Other common bases in programming include binary (``2``), `octal `__ (``8``), hexadecimal (``16``). + +If ``capitalize_hex`` is ``true``, digits higher than 9 are represented in uppercase. .. rst-class:: classref-item-separator @@ -1208,7 +1319,7 @@ Converts a unsigned :ref:`int` to a string representation of a number :ref:`String` **pad_decimals** **(** :ref:`int` digits **)** |const| -Formats a number to have an exact number of ``digits`` after the decimal point. +Formats the string representing a number to have an exact number of ``digits`` *after* the decimal point. .. rst-class:: classref-item-separator @@ -1220,7 +1331,7 @@ Formats a number to have an exact number of ``digits`` after the decimal point. :ref:`String` **pad_zeros** **(** :ref:`int` digits **)** |const| -Formats a number to have an exact number of ``digits`` before the decimal point. +Formats the string representing a number to have an exact number of ``digits`` *before* the decimal point. .. rst-class:: classref-item-separator @@ -1232,7 +1343,9 @@ Formats a number to have an exact number of ``digits`` before the decimal point. :ref:`String` **path_join** **(** :ref:`String` file **)** |const| -If the string is a path, this concatenates ``file`` at the end of the string as a subpath. E.g. ``"this/is".path_join("path") == "this/is/path"``. +Concatenates ``file`` at the end of the string as a subpath, adding ``/`` if necessary. + +\ **Example:** ``"this/is".path_join("path") == "this/is/path"``. .. rst-class:: classref-item-separator @@ -1244,7 +1357,7 @@ If the string is a path, this concatenates ``file`` at the end of the string as :ref:`String` **repeat** **(** :ref:`int` count **)** |const| -Returns original string repeated a number of times. The number of repetitions is given by the argument. +Repeats this string a number of times. ``count`` needs to be greater than ``0``. Otherwise, returns an empty string. .. rst-class:: classref-item-separator @@ -1256,7 +1369,7 @@ Returns original string repeated a number of times. The number of repetitions is :ref:`String` **replace** **(** :ref:`String` what, :ref:`String` forwhat **)** |const| -Replaces occurrences of a case-sensitive substring with the given one inside the string. +Replaces all occurrences of ``what`` inside the string with the given ``forwhat``. .. rst-class:: classref-item-separator @@ -1268,7 +1381,7 @@ Replaces occurrences of a case-sensitive substring with the given one inside the :ref:`String` **replacen** **(** :ref:`String` what, :ref:`String` forwhat **)** |const| -Replaces occurrences of a case-insensitive substring with the given one inside the string. +Replaces all **case-insensitive** occurrences of ``what`` inside the string with the given ``forwhat``. .. rst-class:: classref-item-separator @@ -1280,7 +1393,7 @@ Replaces occurrences of a case-insensitive substring with the given one inside t :ref:`int` **rfind** **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| -Returns the index of the **last** case-sensitive occurrence of the specified string in this instance, or ``-1``. Optionally, the starting search index can be specified, continuing to the beginning of the string. +Returns the index of the **last** occurrence of ``what`` in this string, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the string. This method is the reverse of :ref:`find`. .. rst-class:: classref-item-separator @@ -1292,7 +1405,7 @@ Returns the index of the **last** case-sensitive occurrence of the specified str :ref:`int` **rfindn** **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| -Returns the index of the **last** case-insensitive occurrence of the specified string in this instance, or ``-1``. Optionally, the starting search index can be specified, continuing to the beginning of the string. +Returns the index of the **last** **case-insensitive** occurrence of ``what`` in this string, or ``-1`` if there are none. The starting search index can be specified with ``from``, continuing to the beginning of the string. This method is the reverse of :ref:`findn`. .. rst-class:: classref-item-separator @@ -1304,14 +1417,12 @@ Returns the index of the **last** case-insensitive occurrence of the specified s :ref:`String` **right** **(** :ref:`int` length **)** |const| -Returns a number of characters from the right of the string. If negative ``length`` is used, the characters are counted downwards from **String**'s length. - -\ **Example:**\ +Returns the last ``length`` characters from the end of the string. If ``length`` is negative, strips the first ``length`` characters from the string's beginning. :: - print("sample text".right(3)) #prints "ext" - print("sample text".right(-3)) #prints "ple text" + print("Hello World!".right(3)) # Prints "ld!" + print("Hello World!".right(-4)) # Prints "o World!" .. rst-class:: classref-item-separator @@ -1323,7 +1434,7 @@ Returns a number of characters from the right of the string. If negative ``lengt :ref:`String` **rpad** **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| -Formats a string to be at least ``min_length`` long by adding ``character``\ s to the right of the string. +Formats the string to be at least ``min_length`` long, by adding ``character``\ s to the right of the string, if necessary. See also :ref:`lpad`. .. rst-class:: classref-item-separator @@ -1335,13 +1446,11 @@ Formats a string to be at least ``min_length`` long by adding ``character``\ s t :ref:`PackedStringArray` **rsplit** **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| -Splits the string by a ``delimiter`` string and returns an array of the substrings, starting from right. If ``delimiter`` is an empty string, each substring will be a single character. +Splits the string using a ``delimiter`` and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string. If ``delimiter`` is an empty string, each substring will be a single character. -The splits in the returned array are sorted in the same order as the original string, from left to right. +If ``allow_empty`` is ``false``, empty strings between adjacent delimiters are excluded from the array. -If ``allow_empty`` is ``true``, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. - -If ``maxsplit`` is specified, it defines the number of splits to do from the right up to ``maxsplit``. The default value of 0 means that all items are split, thus giving the same result as :ref:`split`. +If ``maxsplit`` is greater than ``0``, the number of splits may not exceed ``maxsplit``. By default, the entire string is split, which is mostly identical to :ref:`split`. \ **Example:**\ @@ -1352,13 +1461,14 @@ If ``maxsplit`` is specified, it defines the number of splits to do from the rig var some_string = "One,Two,Three,Four" var some_array = some_string.rsplit(",", true, 1) + print(some_array.size()) # Prints 2 - print(some_array[0]) # Prints "One,Two,Three" - print(some_array[1]) # Prints "Four" + print(some_array[0]) # Prints "One,Two,Three" + print(some_array[1]) # Prints "Four" .. code-tab:: csharp - // There is no Rsplit. + // In C#, there is no String.RSplit() method. @@ -1372,9 +1482,9 @@ If ``maxsplit`` is specified, it defines the number of splits to do from the rig :ref:`String` **rstrip** **(** :ref:`String` chars **)** |const| -Returns a copy of the string with characters removed from the right. The ``chars`` argument is a string specifying the set of characters to be removed. +Removes a set of characters defined in ``chars`` from the string's end. See also :ref:`lstrip`. -\ **Note:** The ``chars`` is not a suffix. See :ref:`trim_suffix` method that will remove a single suffix string rather than a set of characters. +\ **Note:** ``chars`` is not a suffix. Use :ref:`trim_suffix` to remove a single suffix, rather than a set of characters. .. rst-class:: classref-item-separator @@ -1386,7 +1496,7 @@ Returns a copy of the string with characters removed from the right. The ``chars :ref:`PackedByteArray` **sha1_buffer** **(** **)** |const| -Returns the SHA-1 hash of the string as an array of bytes. +Returns the `SHA-1 `__ hash of the string as a :ref:`PackedByteArray`. .. rst-class:: classref-item-separator @@ -1398,7 +1508,7 @@ Returns the SHA-1 hash of the string as an array of bytes. :ref:`String` **sha1_text** **(** **)** |const| -Returns the SHA-1 hash of the string as a string. +Returns the `SHA-1 `__ hash of the string as another **String**. .. rst-class:: classref-item-separator @@ -1410,7 +1520,7 @@ Returns the SHA-1 hash of the string as a string. :ref:`PackedByteArray` **sha256_buffer** **(** **)** |const| -Returns the SHA-256 hash of the string as an array of bytes. +Returns the `SHA-256 `__ hash of the string as a :ref:`PackedByteArray`. .. rst-class:: classref-item-separator @@ -1422,7 +1532,7 @@ Returns the SHA-256 hash of the string as an array of bytes. :ref:`String` **sha256_text** **(** **)** |const| -Returns the SHA-256 hash of the string as a string. +Returns the `SHA-256 `__ hash of the string as another **String**. .. rst-class:: classref-item-separator @@ -1434,14 +1544,14 @@ Returns the SHA-256 hash of the string as a string. :ref:`float` **similarity** **(** :ref:`String` text **)** |const| -Returns the similarity index (`Sorensen-Dice coefficient `__) of this string compared to another. A result of 1.0 means totally similar, while 0.0 means totally dissimilar. +Returns the similarity index (`Sorensen-Dice coefficient `__) of this string compared to another. A result of ``1.0`` means totally similar, while ``0.0`` means totally dissimilar. :: - print("ABC123".similarity("ABC123")) # Prints "1" - print("ABC123".similarity("XYZ456")) # Prints "0" - print("ABC123".similarity("123ABC")) # Prints "0.8" - print("ABC123".similarity("abc123")) # Prints "0.4" + print("ABC123".similarity("ABC123")) # Prints 1.0 + print("ABC123".similarity("XYZ456")) # Prints 0.0 + print("ABC123".similarity("123ABC")) # Prints 0.8 + print("ABC123".similarity("abc123")) # Prints 0.4 .. rst-class:: classref-item-separator @@ -1453,7 +1563,12 @@ Returns the similarity index (`Sorensen-Dice coefficient ` **simplify_path** **(** **)** |const| -Returns a simplified canonical path. +If the string is a valid file path, converts the string into a canonical path. This is the shortest possible path, without ``"./"``, and all the unnecessary ``".."`` and ``"/"``. + +:: + + var simple_path = "./path/to///../file".simplify_path() + print(simple_path) # Prints "path/file" .. rst-class:: classref-item-separator @@ -1465,13 +1580,11 @@ Returns a simplified canonical path. :ref:`PackedStringArray` **split** **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| -Splits the string by a ``delimiter`` string and returns an array of the substrings. The ``delimiter`` can be of any length. If ``delimiter`` is an empty string, each substring will be a single character. +Splits the string using a ``delimiter`` and returns an array of the substrings. If ``delimiter`` is an empty string, each substring will be a single character. This method is the opposite of :ref:`join`. -If ``allow_empty`` is ``true``, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. +If ``allow_empty`` is ``false``, empty strings between adjacent delimiters are excluded from the array. -If ``maxsplit`` is specified, it defines the number of splits to do from the left up to ``maxsplit``. The default value of ``0`` means that all items are split. - -If you need only one element from the array at a specific index, :ref:`get_slice` is a more performant option. +If ``maxsplit`` is greater than ``0``, the number of splits may not exceed ``maxsplit``. By default, the entire string is split. \ **Example:**\ @@ -1480,22 +1593,25 @@ If you need only one element from the array at a specific index, :ref:`get_slice .. code-tab:: gdscript - var some_string = "One,Two,Three,Four" - var some_array = some_string.split(",", true, 1) - print(some_array.size()) # Prints 2 - print(some_array[0]) # Prints "Four" - print(some_array[1]) # Prints "Three,Two,One" + var some_array = "One,Two,Three,Four".split(",", true, 2) + + print(some_array.size()) # Prints 3 + print(some_array[0]) # Prints "One" + print(some_array[1]) # Prints "Two" + print(some_array[2]) # Prints "Three,Four" .. code-tab:: csharp - var someString = "One,Two,Three,Four"; - var someArray = someString.Split(",", true); // This is as close as it gets to Godots API. - GD.Print(someArray[0]); // Prints "Four" - GD.Print(someArray[1]); // Prints "Three,Two,One" + // C#'s `Split()` does not support the `maxsplit` parameter. + var someArray = "One,Two,Three".Split(","); + + GD.Print(someArray[0]); // Prints "One" + GD.Print(someArray[1]); // Prints "Two" + GD.Print(someArray[2]); // Prints "Three" -If you need to split strings with more complex rules, use the :ref:`RegEx` class instead. +\ **Note:** If you only need one substring from the array, consider using :ref:`get_slice` which is faster. If you need to split strings with more complex rules, use the :ref:`RegEx` class instead. .. rst-class:: classref-item-separator @@ -1507,11 +1623,15 @@ If you need to split strings with more complex rules, use the :ref:`RegEx` **split_floats** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** |const| -Splits the string in floats by using a delimiter string and returns an array of the substrings. +Splits the string into floats by using a ``delimiter`` and returns a :ref:`PackedFloat64Array`. -For example, ``"1,2.5,3"`` will return ``[1,2.5,3]`` if split by ``","``. +If ``allow_empty`` is ``false``, empty or invalid :ref:`float` conversions between adjacent delimiters are excluded. -If ``allow_empty`` is ``true``, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. +:: + + var a = "1,2,4.5".split_floats(",") # a is [1.0, 2.0, 4.5] + var c = "1| ||4.5".split_floats("|") # c is [1.0, 0.0, 0.0, 4.5] + var b = "1| ||4.5".split_floats("|", false) # b is [1.0, 4.5] .. rst-class:: classref-item-separator @@ -1523,7 +1643,9 @@ If ``allow_empty`` is ``true``, and there are two adjacent delimiters in the str :ref:`String` **strip_edges** **(** :ref:`bool` left=true, :ref:`bool` right=true **)** |const| -Returns a copy of the string stripped of any non-printable character (including tabulations, spaces and line breaks) at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. +Strips all non-printable characters from the beginning and the end of the string. These include spaces, tabulations (``\t``), and newlines (``\n`` ``\r``). + +If ``left`` is ``false``, ignores the string's beginning. Likewise, if ``right`` is ``false``, ignores the string's end. .. rst-class:: classref-item-separator @@ -1535,7 +1657,7 @@ Returns a copy of the string stripped of any non-printable character (including :ref:`String` **strip_escapes** **(** **)** |const| -Returns a copy of the string stripped of any escape character. These include all non-printable control characters of the first page of the ASCII table (< 32), such as tabulation (``\t`` in C) and newline (``\n`` and ``\r``) characters, but not spaces. +Strips all escape characters from the string. These include all non-printable control characters of the first page of the ASCII table (values from 0 to 31), such as tabulation (``\t``) and newline (``\n``, ``\r``) characters, but *not* spaces. .. rst-class:: classref-item-separator @@ -1547,7 +1669,7 @@ Returns a copy of the string stripped of any escape character. These include all :ref:`String` **substr** **(** :ref:`int` from, :ref:`int` len=-1 **)** |const| -Returns part of the string from the position ``from`` with length ``len``. Argument ``len`` is optional and using ``-1`` will return remaining characters from given position. +Returns part of the string from the position ``from`` with length ``len``. If ``len`` is ``-1`` (as by default), returns the rest of the string starting from the given position. .. rst-class:: classref-item-separator @@ -1559,7 +1681,7 @@ Returns part of the string from the position ``from`` with length ``len``. Argum :ref:`PackedByteArray` **to_ascii_buffer** **(** **)** |const| -Converts the String (which is a character array) to ASCII/Latin-1 encoded :ref:`PackedByteArray` (which is an array of bytes). The conversion is faster compared to :ref:`to_utf8_buffer`, as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces. +Converts the string to an `ASCII `__/Latin-1 encoded :ref:`PackedByteArray`. This method is slightly faster than :ref:`to_utf8_buffer`, but replaces all unsupported characters with spaces. .. rst-class:: classref-item-separator @@ -1583,14 +1705,15 @@ Returns the string converted to ``camelCase``. :ref:`float` **to_float** **(** **)** |const| -Converts a string containing a decimal number into a ``float``. The method will stop on the first non-number character except the first ``.`` (decimal point), and ``e`` which is used for exponential. +Converts the string representing a decimal number into a :ref:`float`. This method stops on the first non-number character, except the first decimal point (``.``) and the exponent letter (``e``). See also :ref:`is_valid_float`. :: - print("12.3".to_float()) # 12.3 - print("1.2.3".to_float()) # 1.2 - print("12ab3".to_float()) # 12 - print("1e3".to_float()) # 1000 + var a = "12.35".to_float() # a is 12.35 + var b = "1.2.3".to_float() # b is 1.2 + var c = "12xy3".to_float() # c is 12.0 + var d = "1e3".to_float() # d is 1000.0 + var e = "Hello!".to_int() # e is 0.0 .. rst-class:: classref-item-separator @@ -1602,13 +1725,14 @@ Converts a string containing a decimal number into a ``float``. The method will :ref:`int` **to_int** **(** **)** |const| -Converts a string containing an integer number into an ``int``. The method will remove any non-number character and stop if it encounters a ``.``. +Converts the string representing an integer number into an :ref:`int`. This method removes any non-number character and stops at the first decimal point (``.``). See also :ref:`is_valid_int`. :: - print("123".to_int()) # 123 - print("a1b2c3".to_int()) # 123 - print("1.2.3".to_int()) # 1 + var a = "123".to_int() # a is 123 + var b = "x1y2z3".to_int() # b is 123 + var c = "-1.2.3".to_int() # c is -1 + var d = "Hello!".to_int() # d is 0 .. rst-class:: classref-item-separator @@ -1668,7 +1792,7 @@ Returns the string converted to uppercase. :ref:`PackedByteArray` **to_utf16_buffer** **(** **)** |const| -Converts the String (which is an array of characters) to UTF-16 encoded :ref:`PackedByteArray` (which is an array of bytes). +Converts the string to a `UTF-16 `__ encoded :ref:`PackedByteArray`. .. rst-class:: classref-item-separator @@ -1680,7 +1804,7 @@ Converts the String (which is an array of characters) to UTF-16 encoded :ref:`Pa :ref:`PackedByteArray` **to_utf32_buffer** **(** **)** |const| -Converts the String (which is an array of characters) to UTF-32 encoded :ref:`PackedByteArray` (which is an array of bytes). +Converts the string to a `UTF-32 `__ encoded :ref:`PackedByteArray`. .. rst-class:: classref-item-separator @@ -1692,7 +1816,7 @@ Converts the String (which is an array of characters) to UTF-32 encoded :ref:`Pa :ref:`PackedByteArray` **to_utf8_buffer** **(** **)** |const| -Converts the String (which is an array of characters) to UTF-8 encode :ref:`PackedByteArray` (which is an array of bytes). The conversion is a bit slower than :ref:`to_ascii_buffer`, but supports all UTF-8 characters. Therefore, you should prefer this function over :ref:`to_ascii_buffer`. +Converts the string to a `UTF-8 `__ encoded :ref:`PackedByteArray`. This method is slightly slower than :ref:`to_ascii_buffer`, but supports all UTF-8 characters. For most cases, prefer using this method. .. rst-class:: classref-item-separator @@ -1704,7 +1828,7 @@ Converts the String (which is an array of characters) to UTF-8 encode :ref:`Pack :ref:`String` **trim_prefix** **(** :ref:`String` prefix **)** |const| -Removes a given string from the start if it starts with it or leaves the string unchanged. +Removes the given ``prefix`` from the start of the string, or returns the string unchanged. .. rst-class:: classref-item-separator @@ -1716,7 +1840,7 @@ Removes a given string from the start if it starts with it or leaves the string :ref:`String` **trim_suffix** **(** :ref:`String` suffix **)** |const| -Removes a given string from the end if it ends with it or leaves the string unchanged. +Removes the given ``suffix`` from the end of the string, or returns the string unchanged. .. rst-class:: classref-item-separator @@ -1740,18 +1864,20 @@ Returns the character code at position ``at``. :ref:`String` **uri_decode** **(** **)** |const| -Decodes a string in URL encoded format. This is meant to decode parameters in a URL when receiving an HTTP request. +Decodes the string from its URL-encoded format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request. .. tabs:: .. code-tab:: gdscript - print("https://example.org/?escaped=" + "Godot%20Engine%3A%27docs%27".uri_decode()) + var url = "$DOCS_URL/?highlight=Godot%20Engine%3%docs" + print(url.uri_decode()) # Prints "$DOCS_URL/?highlight=Godot Engine:docs" .. code-tab:: csharp - GD.Print("https://example.org/?escaped=" + "Godot%20Engine%3a%27Docs%27".URIDecode()); + var url = "$DOCS_URL/?highlight=Godot%20Engine%3%docs" + GD.Print(url.URIDecode()) // Prints "$DOCS_URL/?highlight=Godot Engine:docs" @@ -1765,18 +1891,24 @@ Decodes a string in URL encoded format. This is meant to decode parameters in a :ref:`String` **uri_encode** **(** **)** |const| -Encodes a string to URL friendly format. This is meant to encode parameters in a URL when sending an HTTP request. +Encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request. .. tabs:: .. code-tab:: gdscript - print("https://example.org/?escaped=" + "Godot Engine:'docs'".uri_encode()) + var prefix = "$DOCS_URL/?highlight=" + var url = prefix + "Godot Engine:docs".uri_encode() + + print(url) # Prints "$DOCS_URL/?highlight=Godot%20Engine%3%docs" .. code-tab:: csharp - GD.Print("https://example.org/?escaped=" + "Godot Engine:'docs'".URIEncode()); + var prefix = "$DOCS_URL/?highlight="; + var url = prefix + "Godot Engine:docs".URIEncode(); + + GD.Print(url); // Prints "$DOCS_URL/?highlight=Godot%20Engine%3%docs" @@ -1790,7 +1922,7 @@ Encodes a string to URL friendly format. This is meant to encode parameters in a :ref:`String` **validate_node_name** **(** **)** |const| -Removes any characters from the string that are prohibited in :ref:`Node` names (``.`` ``:`` ``@`` ``/`` ``"``). +Removes all characters that are not allowed in :ref:`Node.name` from the string (``.`` ``:`` ``@`` ``/`` ``"`` ``%``). .. rst-class:: classref-item-separator @@ -1888,6 +2020,20 @@ Appends ``right`` at the end of this **String**, also known as a string concaten ---- +.. _class_String_operator_sum_StringName: + +.. rst-class:: classref-operator + +:ref:`String` **operator +** **(** :ref:`StringName` right **)** + +.. container:: contribute + + There is currently no description for this operator. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_String_operator_lt_String: .. rst-class:: classref-operator diff --git a/classes/class_stringname.rst b/classes/class_stringname.rst index 949dfb9a0..ad0d2575c 100644 --- a/classes/class_stringname.rst +++ b/classes/class_stringname.rst @@ -23,6 +23,10 @@ You will usually just pass a :ref:`String` to methods expecting a See also :ref:`NodePath`, which is a similar concept specifically designed to store pre-parsed node paths. +Some string methods have corresponding variations. Variations suffixed with ``n`` (:ref:`countn`, :ref:`findn`, :ref:`replacen`, etc.) are **case-insensitive** (they make no distinction between uppercase and lowercase letters). Method variations prefixed with ``r`` (:ref:`rfind`, :ref:`rsplit`, etc.) are reversed, and start from the end of the string, instead of the beginning. + +\ **Note:** In a boolean context, a **StringName** will evaluate to ``false`` if it is empty (``StringName("")``). Otherwise, a **StringName** will always evaluate to ``true``. + .. rst-class:: classref-reftable-group Constructors @@ -47,9 +51,191 @@ Methods .. table:: :widths: auto - +-----------------------+---------------------------------------------------------------+ - | :ref:`int` | :ref:`hash` **(** **)** |const| | - +-----------------------+---------------------------------------------------------------+ + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`begins_with` **(** :ref:`String` text **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`bigrams` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`bin_to_int` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`c_escape` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`c_unescape` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`capitalize` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`casecmp_to` **(** :ref:`String` to **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`contains` **(** :ref:`String` what **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`count` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`countn` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`dedent` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`ends_with` **(** :ref:`String` text **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`find` **(** :ref:`String` what, :ref:`int` from=0 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`findn` **(** :ref:`String` what, :ref:`int` from=0 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`format` **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_base_dir` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_basename` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_extension` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_file` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_slice` **(** :ref:`String` delimiter, :ref:`int` slice **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_slice_count` **(** :ref:`String` delimiter **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_slicec` **(** :ref:`int` delimiter, :ref:`int` slice **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`hash` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`hex_to_int` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`indent` **(** :ref:`String` prefix **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`insert` **(** :ref:`int` position, :ref:`String` what **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_absolute_path` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_empty` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_relative_path` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_subsequence_of` **(** :ref:`String` text **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_subsequence_ofn` **(** :ref:`String` text **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_filename` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_float` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_hex_number` **(** :ref:`bool` with_prefix=false **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_html_color` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_identifier` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_int` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_ip_address` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`join` **(** :ref:`PackedStringArray` parts **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`json_escape` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`left` **(** :ref:`int` length **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`length` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`lpad` **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`lstrip` **(** :ref:`String` chars **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`match` **(** :ref:`String` expr **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`matchn` **(** :ref:`String` expr **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`md5_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`md5_text` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`naturalnocasecmp_to` **(** :ref:`String` to **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`nocasecmp_to` **(** :ref:`String` to **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`pad_decimals` **(** :ref:`int` digits **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`pad_zeros` **(** :ref:`int` digits **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`path_join` **(** :ref:`String` file **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`repeat` **(** :ref:`int` count **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`replace` **(** :ref:`String` what, :ref:`String` forwhat **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`replacen` **(** :ref:`String` what, :ref:`String` forwhat **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rfind` **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rfindn` **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`right` **(** :ref:`int` length **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`rpad` **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`rsplit` **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`rstrip` **(** :ref:`String` chars **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`sha1_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`sha1_text` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`sha256_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`sha256_text` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`similarity` **(** :ref:`String` text **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`simplify_path` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`split` **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedFloat64Array` | :ref:`split_floats` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`strip_edges` **(** :ref:`bool` left=true, :ref:`bool` right=true **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`strip_escapes` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`substr` **(** :ref:`int` from, :ref:`int` len=-1 **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`to_ascii_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`to_camel_case` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`to_float` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`to_int` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`to_lower` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`to_pascal_case` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`to_snake_case` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`to_upper` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`to_utf16_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`to_utf32_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`to_utf8_buffer` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`trim_prefix` **(** :ref:`String` prefix **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`trim_suffix` **(** :ref:`String` suffix **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`unicode_at` **(** :ref:`int` at **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`uri_decode` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`uri_encode` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`validate_node_name` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`xml_escape` **(** :ref:`bool` escape_quotes=false **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`xml_unescape` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -59,23 +245,29 @@ Operators .. table:: :widths: auto - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator !=` **(** :ref:`String` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator !=` **(** :ref:`StringName` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator \<` **(** :ref:`StringName` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator \<=` **(** :ref:`StringName` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator ==` **(** :ref:`String` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator ==` **(** :ref:`StringName` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator >` **(** :ref:`StringName` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator >=` **(** :ref:`StringName` right **)** | - +-------------------------+---------------------------------------------------------------------------------------------------------------------+ + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator !=` **(** :ref:`String` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator !=` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`operator %` **(** :ref:`Variant` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`operator +` **(** :ref:`String` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`operator +` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator \<` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator \<=` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator ==` **(** :ref:`String` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator ==` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator >` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator >=` **(** :ref:`StringName` right **)** | + +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -123,13 +315,1481 @@ Creates a new **StringName** from the given :ref:`String`. In GDSc Method Descriptions ------------------- +.. _class_StringName_method_begins_with: + +.. rst-class:: classref-method + +:ref:`bool` **begins_with** **(** :ref:`String` text **)** |const| + +Returns ``true`` if the string begins with the given ``text``. See also :ref:`ends_with`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_bigrams: + +.. rst-class:: classref-method + +:ref:`PackedStringArray` **bigrams** **(** **)** |const| + +Returns an array containing the bigrams (pairs of consecutive characters) of this string. + +:: + + print("Get up!".bigrams()) # Prints ["Ge", "et", "t ", " u", "up", "p!"] + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_bin_to_int: + +.. rst-class:: classref-method + +:ref:`int` **bin_to_int** **(** **)** |const| + +Converts the string representing a binary number into an :ref:`int`. The string may optionally be prefixed with ``"0b"``, and an additional ``-`` prefix for negative numbers. + + +.. tabs:: + + .. code-tab:: gdscript + + print("101".bin_to_int()) # Prints 5 + print("0b101".bin_to_int()) # Prints 5 + print("-0b10".bin_to_int()) # Prints -2 + + .. code-tab:: csharp + + GD.Print("101".BinToInt()); // Prints 5 + GD.Print("0b101".BinToInt()); // Prints 5 + GD.Print("-0b10".BinToInt()); // Prints -2 + + + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_c_escape: + +.. rst-class:: classref-method + +:ref:`String` **c_escape** **(** **)** |const| + +Returns a copy of the string with special characters escaped using the C language standard. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_c_unescape: + +.. rst-class:: classref-method + +:ref:`String` **c_unescape** **(** **)** |const| + +Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are ``\'``, ``\"``, ``\\``, ``\a``, ``\b``, ``\f``, ``\n``, ``\r``, ``\t``, ``\v``. + +\ **Note:** Unlike the GDScript parser, this method doesn't support the ``\uXXXX`` escape sequence. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_capitalize: + +.. rst-class:: classref-method + +:ref:`String` **capitalize** **(** **)** |const| + +Changes the appearance of the string: replaces underscores (``_``) with spaces, adds spaces before uppercase letters in the middle of a word, converts all letters to lowercase, then converts the first one and each one following a space to uppercase. + + +.. tabs:: + + .. code-tab:: gdscript + + "move_local_x".capitalize() # Returns "Move Local X" + "sceneFile_path".capitalize() # Returns "Scene File Path" + + .. code-tab:: csharp + + "move_local_x".Capitalize(); // Returns "Move Local X" + "sceneFile_path".Capitalize(); // Returns "Scene File Path" + + + +\ **Note:** This method not the same as the default appearance of properties in the Inspector dock, as it does not capitalize acronyms (``"2D"``, ``"FPS"``, ``"PNG"``, etc.) as you may expect. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_casecmp_to: + +.. rst-class:: classref-method + +:ref:`int` **casecmp_to** **(** :ref:`String` to **)** |const| + +Performs a case-sensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "Less than" and "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. + +With different string lengths, returns ``1`` if this string is longer than the ``to`` string, or ``-1`` if shorter. Note that the length of empty strings is *always* ``0``. + +To get a :ref:`bool` result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`naturalnocasecmp_to`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_contains: + +.. rst-class:: classref-method + +:ref:`bool` **contains** **(** :ref:`String` what **)** |const| + +Returns ``true`` if the string contains ``what``. In GDScript, this corresponds to the ``in`` operator. + + +.. tabs:: + + .. code-tab:: gdscript + + print("Node".contains("de")) # Prints true + print("team".contains("I")) # Prints false + print("I" in "team") # Prints false + + .. code-tab:: csharp + + GD.Print("Node".Contains("de")); // Prints true + GD.Print("team".Contains("I")); // Prints false + + + +If you need to know where ``what`` is within the string, use :ref:`find`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_count: + +.. rst-class:: classref-method + +:ref:`int` **count** **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| + +Returns the number of occurrences of the substring ``what`` between ``from`` and ``to`` positions. If ``to`` is 0, the search continues until the end of the string. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_countn: + +.. rst-class:: classref-method + +:ref:`int` **countn** **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| + +Returns the number of occurrences of the substring ``what`` between ``from`` and ``to`` positions, **ignoring case**. If ``to`` is 0, the search continues until the end of the string. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_dedent: + +.. rst-class:: classref-method + +:ref:`String` **dedent** **(** **)** |const| + +Returns a copy of the string with indentation (leading tabs and spaces) removed. See also :ref:`indent` to add indentation. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_ends_with: + +.. rst-class:: classref-method + +:ref:`bool` **ends_with** **(** :ref:`String` text **)** |const| + +Returns ``true`` if the string ends with the given ``text``. See also :ref:`begins_with`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_find: + +.. rst-class:: classref-method + +:ref:`int` **find** **(** :ref:`String` what, :ref:`int` from=0 **)** |const| + +Returns the index of the **first** occurrence of ``what`` in this string, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the end of the string. + + +.. tabs:: + + .. code-tab:: gdscript + + print("Team".find("I")) # Prints -1 + + print("Potato".find("t")) # Prints 2 + print("Potato".find("t", 3)) # Prints 4 + print("Potato".find("t", 5)) # Prints -1 + + .. code-tab:: csharp + + GD.Print("Team".Find("I")); // Prints -1 + + GD.Print("Potato".Find("t")); // Prints 2 + GD.print("Potato".Find("t", 3)); // Prints 4 + GD.print("Potato".Find("t", 5)); // Prints -1 + + + +\ **Note:** If you just want to know whether the string contains ``what``, use :ref:`contains`. In GDScript, you may also use the ``in`` operator. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_findn: + +.. rst-class:: classref-method + +:ref:`int` **findn** **(** :ref:`String` what, :ref:`int` from=0 **)** |const| + +Returns the index of the **first** **case-insensitive** occurrence of ``what`` in this string, or ``-1`` if there are none. The starting search index can be specified with ``from``, continuing to the end of the string. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_format: + +.. rst-class:: classref-method + +:ref:`String` **format** **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** |const| + +Formats the string by replacing all occurrences of ``placeholder`` with the elements of ``values``. + +\ ``values`` can be a :ref:`Dictionary` or an :ref:`Array`. Any underscores in ``placeholder`` will be replaced with the corresponding keys in advance. Array elements use their index as keys. + +:: + + # Prints "Waiting for Godot is a play by Samuel Beckett, and Godot Engine is named after it." + var use_array_values = "Waiting for {0} is a play by {1}, and {0} Engine is named after it." + print(use_array_values.format(["Godot", "Samuel Beckett"])) + + # Prints "User 42 is Godot." + print("User {id} is {name}.".format({"id": 42, "name": "Godot"})) + +Some additional handling is performed when ``values`` is an :ref:`Array`. If ``placeholder`` does not contain an underscore, the elements of the ``values`` array will be used to replace one occurrence of the placeholder in order; If an element of ``values`` is another 2-element array, it'll be interpreted as a key-value pair. + +:: + + # Prints "User 42 is Godot." + print("User {} is {}.".format([42, "Godot"], "{}")) + print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]])) + +See also the :doc:`GDScript format string <../tutorials/scripting/gdscript/gdscript_format_string>` tutorial. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_base_dir: + +.. rst-class:: classref-method + +:ref:`String` **get_base_dir** **(** **)** |const| + +If the string is a valid file path, returns the base directory name. + +:: + + var dir_path = "/path/to/file.txt".get_base_dir() # dir_path is "/path/to" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_basename: + +.. rst-class:: classref-method + +:ref:`String` **get_basename** **(** **)** |const| + +If the string is a valid file path, returns the full file path, without the extension. + +:: + + var base = "/path/to/file.txt".get_basename() # base is "/path/to/file" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_extension: + +.. rst-class:: classref-method + +:ref:`String` **get_extension** **(** **)** |const| + +If the string is a valid file name or path, returns the file extension without the leading period (``.``). Otherwise, returns an empty string. + +:: + + var a = "/path/to/file.txt".get_extension() # a is "txt" + var b = "cool.txt".get_extension() # b is "txt" + var c = "cool.font.tres".get_extension() # c is "tres" + var d = ".pack1".get_extension() # d is "pack1" + + var e = "file.txt.".get_extension() # e is "" + var f = "file.txt..".get_extension() # f is "" + var g = "txt".get_extension() # g is "" + var h = "".get_extension() # h is "" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_file: + +.. rst-class:: classref-method + +:ref:`String` **get_file** **(** **)** |const| + +If the string is a valid file path, returns the file name, including the extension. + +:: + + var file = "/path/to/icon.png".get_file() # file is "icon.png" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_slice: + +.. rst-class:: classref-method + +:ref:`String` **get_slice** **(** :ref:`String` delimiter, :ref:`int` slice **)** |const| + +Splits the string using a ``delimiter`` and returns the substring at index ``slice``. Returns an empty string if the ``slice`` does not exist. + +This is faster than :ref:`split`, if you only need one substring. + +\ **Example:**\ + +:: + + print("i/am/example/hi".get_slice("/", 2)) # Prints "example" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_slice_count: + +.. rst-class:: classref-method + +:ref:`int` **get_slice_count** **(** :ref:`String` delimiter **)** |const| + +Returns the total number of slices when the string is split with the given ``delimiter`` (see :ref:`split`). + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_get_slicec: + +.. rst-class:: classref-method + +:ref:`String` **get_slicec** **(** :ref:`int` delimiter, :ref:`int` slice **)** |const| + +Splits the string using a Unicode character with code ``delimiter`` and returns the substring at index ``slice``. Returns an empty string if the ``slice`` does not exist. + +This is faster than :ref:`split`, if you only need one substring. + +.. rst-class:: classref-item-separator + +---- + .. _class_StringName_method_hash: .. rst-class:: classref-method :ref:`int` **hash** **(** **)** |const| -Returns the 32-bit hash value representing the **StringName**'s contents. +Returns the 32-bit hash value representing the string's contents. + +\ **Note:** Strings with equal hash values are *not* guaranteed to be the same, as a result of hash collisions. On the countrary, strings with different hash values are guaranteed to be different. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_hex_to_int: + +.. rst-class:: classref-method + +:ref:`int` **hex_to_int** **(** **)** |const| + +Converts the string representing a hexadecimal number into an :ref:`int`. The string may be optionally prefixed with ``"0x"``, and an additional ``-`` prefix for negative numbers. + + +.. tabs:: + + .. code-tab:: gdscript + + print("0xff".hex_to_int()) # Prints 255 + print("ab".hex_to_int()) # Prints 171 + + .. code-tab:: csharp + + GD.Print("0xff".HexToInt()); // Prints 255 + GD.Print("ab".HexToInt()); // Prints 171 + + + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_indent: + +.. rst-class:: classref-method + +:ref:`String` **indent** **(** :ref:`String` prefix **)** |const| + +Indents every line of the string with the given ``prefix``. Empty lines are not indented. See also :ref:`dedent` to remove indentation. + +For example, the string can be indented with two tabulations using ``"\t\t"``, or four spaces using ``" "``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_insert: + +.. rst-class:: classref-method + +:ref:`String` **insert** **(** :ref:`int` position, :ref:`String` what **)** |const| + +Inserts ``what`` at the given ``position`` in the string. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_absolute_path: + +.. rst-class:: classref-method + +:ref:`bool` **is_absolute_path** **(** **)** |const| + +Returns ``true`` if the string is a path to a file or directory, and its starting point is explicitly defined. This method is the opposite of :ref:`is_relative_path`. + +This includes all paths starting with ``"res://"``, ``"user://"``, ``"C:\"``, ``"/"``, etc. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_empty: + +.. rst-class:: classref-method + +:ref:`bool` **is_empty** **(** **)** |const| + +Returns ``true`` if the string's length is ``0`` (``""``). See also :ref:`length`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_relative_path: + +.. rst-class:: classref-method + +:ref:`bool` **is_relative_path** **(** **)** |const| + +Returns ``true`` if the string is a path, and its starting point is dependent on context. The path could begin from the current directory, or the current :ref:`Node` (if the string is derived from a :ref:`NodePath`), and may sometimes be prefixed with ``"./"``. This method is the opposite of :ref:`is_absolute_path`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_subsequence_of: + +.. rst-class:: classref-method + +:ref:`bool` **is_subsequence_of** **(** :ref:`String` text **)** |const| + +Returns ``true`` if all characters of this string can be found in ``text`` in their original order. + +:: + + var text = "Wow, incredible!" + + print("inedible".is_subsequence_of(text)) # Prints true + print("Word!".is_subsequence_of(text)) # Prints true + print("Window".is_subsequence_of(text)) # Prints false + print("".is_subsequence_of(text)) # Prints true + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_subsequence_ofn: + +.. rst-class:: classref-method + +:ref:`bool` **is_subsequence_ofn** **(** :ref:`String` text **)** |const| + +Returns ``true`` if all characters of this string can be found in ``text`` in their original order, **ignoring case**. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_filename: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_filename** **(** **)** |const| + +Returns ``true`` if this string does not contain characters that are not allowed in file names (``:`` ``/`` ``\`` ``?`` ``*`` ``"`` ``|`` ``%`` ``<`` ``>``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_float: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_float** **(** **)** |const| + +Returns ``true`` if this string represents a valid floating-point number. A valid float may contain only digits, one decimal point (``.``), and the exponent letter (``e``). It may also be prefixed with a positive (``+``) or negative (``-``) sign. Any valid integer is also a valid float (see :ref:`is_valid_int`). See also :ref:`to_float`. + +:: + + print("1.7".is_valid_float()) # Prints true + print("24".is_valid_float()) # Prints true + print("7e3".is_valid_float()) # Prints true + print("Hello".is_valid_float()) # Prints false + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_hex_number: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_hex_number** **(** :ref:`bool` with_prefix=false **)** |const| + +Returns ``true`` if this string is a valid hexadecimal number. A valid hexadecimal number only contains digits or letters ``A`` to ``F`` (either uppercase or lowercase), and may be prefixed with a positive (``+``) or negative (``-``) sign. + +If ``with_prefix`` is ``true``, the hexadecimal number needs to prefixed by ``"0x"`` to be considered valid. + +:: + + print("A08E".is_valid_hex_number()) # Prints true + print("-AbCdEf".is_valid_hex_number()) # Prints true + print("2.5".is_valid_hex_number()) # Prints false + + print("0xDEADC0DE".is_valid_hex_number(true)) # Prints true + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_html_color: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_html_color** **(** **)** |const| + +Returns ``true`` if this string is a valid color in hexadecimal HTML notation. The string must be a hexadecimal value (see :ref:`is_valid_hex_number`) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign (``#``). Other HTML notations for colors, such as names or ``hsl()``, are not considered valid. See also :ref:`Color.html`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_identifier: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_identifier** **(** **)** |const| + +Returns ``true`` if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (``_``), and the first character may not be a digit. + +:: + + print("node_2d".is_valid_identifier()) # Prints true + print("TYPE_FLOAT".is_valid_identifier()) # Prints true + print("1st_method".is_valid_identifier()) # Prints false + print("MyMethod#2".is_valid_identifier()) # Prints false + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_int: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_int** **(** **)** |const| + +Returns ``true`` if this string represents a valid integer. A valid integer only contains digits, and may be prefixed with a positive (``+``) or negative (``-``) sign. See also :ref:`to_int`. + +:: + + print("7".is_valid_int()) # Prints true + print("1.65".is_valid_int()) # Prints false + print("Hi".is_valid_int()) # Prints false + print("+3".is_valid_int()) # Prints true + print("-12".is_valid_int()) # Prints true + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_is_valid_ip_address: + +.. rst-class:: classref-method + +:ref:`bool` **is_valid_ip_address** **(** **)** |const| + +Returns ``true`` if this string represents a well-formatted IPv4 or IPv6 address. This method considers `reserved IP addresses `__ such as ``"0.0.0.0"`` and ``"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"`` as valid. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_join: + +.. rst-class:: classref-method + +:ref:`String` **join** **(** :ref:`PackedStringArray` parts **)** |const| + +Returns the concatenation of ``parts``' elements, with each element separated by the string calling this method. This method is the opposite of :ref:`split`. + +\ **Example:**\ + + +.. tabs:: + + .. code-tab:: gdscript + + var fruits = ["Apple", "Orange", "Pear", "Kiwi"] + + print(", ".join(fruits)) # Prints "Apple, Orange, Pear, Kiwi" + print("---".join(fruits)) # Prints "Apple---Orange---Pear---Kiwi" + + .. code-tab:: csharp + + var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"}; + + // In C#, this method is static. + GD.Print(string.Join(", ", fruits); // Prints "Apple, Orange, Pear, Kiwi" + GD.Print(string.Join("---", fruits)); // Prints "Apple---Orange---Pear---Kiwi" + + + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_json_escape: + +.. rst-class:: classref-method + +:ref:`String` **json_escape** **(** **)** |const| + +Returns a copy of the string with special characters escaped using the JSON standard. Because it closely matches the C standard, it is possible to use :ref:`c_unescape` to unescape the string, if necessary. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_left: + +.. rst-class:: classref-method + +:ref:`String` **left** **(** :ref:`int` length **)** |const| + +Returns the first ``length`` characters from the beginning of the string. If ``length`` is negative, strips the last ``length`` characters from the string's end. + +:: + + print("Hello World!".left(3)) # Prints "Hel" + print("Hello World!".left(-4)) # Prints "Hello Wo" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_length: + +.. rst-class:: classref-method + +:ref:`int` **length** **(** **)** |const| + +Returns the number of characters in the string. Empty strings (``""``) always return ``0``. See also :ref:`is_empty`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_lpad: + +.. rst-class:: classref-method + +:ref:`String` **lpad** **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| + +Formats the string to be at least ``min_length`` long by adding ``character``\ s to the left of the string, if necessary. See also :ref:`rpad`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_lstrip: + +.. rst-class:: classref-method + +:ref:`String` **lstrip** **(** :ref:`String` chars **)** |const| + +Removes a set of characters defined in ``chars`` from the string's beginning. See also :ref:`rstrip`. + +\ **Note:** ``chars`` is not a prefix. Use :ref:`trim_prefix` to remove a single prefix, rather than a set of characters. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_match: + +.. rst-class:: classref-method + +:ref:`bool` **match** **(** :ref:`String` expr **)** |const| + +Does a simple expression match, where ``*`` matches zero or more arbitrary characters and ``?`` matches any single character except a period (``.``). An empty string or empty expression always evaluates to ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_matchn: + +.. rst-class:: classref-method + +:ref:`bool` **matchn** **(** :ref:`String` expr **)** |const| + +Does a simple **case-insensitive** expression match, where ``*`` matches zero or more arbitrary characters and ``?`` matches any single character except a period (``.``). An empty string or empty expression always evaluates to ``false``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_md5_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **md5_buffer** **(** **)** |const| + +Returns the `MD5 hash `__ of the string as a :ref:`PackedByteArray`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_md5_text: + +.. rst-class:: classref-method + +:ref:`String` **md5_text** **(** **)** |const| + +Returns the `MD5 hash `__ of the string as another :ref:`String`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_naturalnocasecmp_to: + +.. rst-class:: classref-method + +:ref:`int` **naturalnocasecmp_to** **(** :ref:`String` to **)** |const| + +Performs a **case-insensitive**, *natural order* comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "Less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. + +When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be ``["1", "2", "3", ...]``, not ``["1", "10", "2", "3", ...]``. + +With different string lengths, returns ``1`` if this string is longer than the ``to`` string, or ``-1`` if shorter. Note that the length of empty strings is *always* ``0``. + +To get a :ref:`bool` result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`casecmp_to`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_nocasecmp_to: + +.. rst-class:: classref-method + +:ref:`int` **nocasecmp_to** **(** :ref:`String` to **)** |const| + +Performs a **case-insensitive** comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "Less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. + +With different string lengths, returns ``1`` if this string is longer than the ``to`` string, or ``-1`` if shorter. Note that the length of empty strings is *always* ``0``. + +To get a :ref:`bool` result from a string comparison, use the ``==`` operator instead. See also :ref:`casecmp_to` and :ref:`naturalnocasecmp_to`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_pad_decimals: + +.. rst-class:: classref-method + +:ref:`String` **pad_decimals** **(** :ref:`int` digits **)** |const| + +Formats the string representing a number to have an exact number of ``digits`` *after* the decimal point. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_pad_zeros: + +.. rst-class:: classref-method + +:ref:`String` **pad_zeros** **(** :ref:`int` digits **)** |const| + +Formats the string representing a number to have an exact number of ``digits`` *before* the decimal point. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_path_join: + +.. rst-class:: classref-method + +:ref:`String` **path_join** **(** :ref:`String` file **)** |const| + +Concatenates ``file`` at the end of the string as a subpath, adding ``/`` if necessary. + +\ **Example:** ``"this/is".path_join("path") == "this/is/path"``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_repeat: + +.. rst-class:: classref-method + +:ref:`String` **repeat** **(** :ref:`int` count **)** |const| + +Repeats this string a number of times. ``count`` needs to be greater than ``0``. Otherwise, returns an empty string. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_replace: + +.. rst-class:: classref-method + +:ref:`String` **replace** **(** :ref:`String` what, :ref:`String` forwhat **)** |const| + +Replaces all occurrences of ``what`` inside the string with the given ``forwhat``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_replacen: + +.. rst-class:: classref-method + +:ref:`String` **replacen** **(** :ref:`String` what, :ref:`String` forwhat **)** |const| + +Replaces all **case-insensitive** occurrences of ``what`` inside the string with the given ``forwhat``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_rfind: + +.. rst-class:: classref-method + +:ref:`int` **rfind** **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| + +Returns the index of the **last** occurrence of ``what`` in this string, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the string. This method is the reverse of :ref:`find`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_rfindn: + +.. rst-class:: classref-method + +:ref:`int` **rfindn** **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| + +Returns the index of the **last** **case-insensitive** occurrence of ``what`` in this string, or ``-1`` if there are none. The starting search index can be specified with ``from``, continuing to the beginning of the string. This method is the reverse of :ref:`findn`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_right: + +.. rst-class:: classref-method + +:ref:`String` **right** **(** :ref:`int` length **)** |const| + +Returns the last ``length`` characters from the end of the string. If ``length`` is negative, strips the first ``length`` characters from the string's beginning. + +:: + + print("Hello World!".right(3)) # Prints "ld!" + print("Hello World!".right(-4)) # Prints "o World!" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_rpad: + +.. rst-class:: classref-method + +:ref:`String` **rpad** **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| + +Formats the string to be at least ``min_length`` long, by adding ``character``\ s to the right of the string, if necessary. See also :ref:`lpad`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_rsplit: + +.. rst-class:: classref-method + +:ref:`PackedStringArray` **rsplit** **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| + +Splits the string using a ``delimiter`` and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string. If ``delimiter`` is an empty string, each substring will be a single character. + +If ``allow_empty`` is ``false``, empty strings between adjacent delimiters are excluded from the array. + +If ``maxsplit`` is greater than ``0``, the number of splits may not exceed ``maxsplit``. By default, the entire string is split, which is mostly identical to :ref:`split`. + +\ **Example:**\ + + +.. tabs:: + + .. code-tab:: gdscript + + var some_string = "One,Two,Three,Four" + var some_array = some_string.rsplit(",", true, 1) + + print(some_array.size()) # Prints 2 + print(some_array[0]) # Prints "One,Two,Three" + print(some_array[1]) # Prints "Four" + + .. code-tab:: csharp + + // In C#, there is no String.RSplit() method. + + + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_rstrip: + +.. rst-class:: classref-method + +:ref:`String` **rstrip** **(** :ref:`String` chars **)** |const| + +Removes a set of characters defined in ``chars`` from the string's end. See also :ref:`lstrip`. + +\ **Note:** ``chars`` is not a suffix. Use :ref:`trim_suffix` to remove a single suffix, rather than a set of characters. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_sha1_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **sha1_buffer** **(** **)** |const| + +Returns the `SHA-1 `__ hash of the string as a :ref:`PackedByteArray`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_sha1_text: + +.. rst-class:: classref-method + +:ref:`String` **sha1_text** **(** **)** |const| + +Returns the `SHA-1 `__ hash of the string as another :ref:`String`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_sha256_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **sha256_buffer** **(** **)** |const| + +Returns the `SHA-256 `__ hash of the string as a :ref:`PackedByteArray`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_sha256_text: + +.. rst-class:: classref-method + +:ref:`String` **sha256_text** **(** **)** |const| + +Returns the `SHA-256 `__ hash of the string as another :ref:`String`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_similarity: + +.. rst-class:: classref-method + +:ref:`float` **similarity** **(** :ref:`String` text **)** |const| + +Returns the similarity index (`Sorensen-Dice coefficient `__) of this string compared to another. A result of ``1.0`` means totally similar, while ``0.0`` means totally dissimilar. + +:: + + print("ABC123".similarity("ABC123")) # Prints 1.0 + print("ABC123".similarity("XYZ456")) # Prints 0.0 + print("ABC123".similarity("123ABC")) # Prints 0.8 + print("ABC123".similarity("abc123")) # Prints 0.4 + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_simplify_path: + +.. rst-class:: classref-method + +:ref:`String` **simplify_path** **(** **)** |const| + +If the string is a valid file path, converts the string into a canonical path. This is the shortest possible path, without ``"./"``, and all the unnecessary ``".."`` and ``"/"``. + +:: + + var simple_path = "./path/to///../file".simplify_path() + print(simple_path) # Prints "path/file" + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_split: + +.. rst-class:: classref-method + +:ref:`PackedStringArray` **split** **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| + +Splits the string using a ``delimiter`` and returns an array of the substrings. If ``delimiter`` is an empty string, each substring will be a single character. This method is the opposite of :ref:`join`. + +If ``allow_empty`` is ``false``, empty strings between adjacent delimiters are excluded from the array. + +If ``maxsplit`` is greater than ``0``, the number of splits may not exceed ``maxsplit``. By default, the entire string is split. + +\ **Example:**\ + + +.. tabs:: + + .. code-tab:: gdscript + + var some_array = "One,Two,Three,Four".split(",", true, 2) + + print(some_array.size()) # Prints 3 + print(some_array[0]) # Prints "One" + print(some_array[1]) # Prints "Two" + print(some_array[2]) # Prints "Three,Four" + + .. code-tab:: csharp + + // C#'s `Split()` does not support the `maxsplit` parameter. + var someArray = "One,Two,Three".Split(","); + + GD.Print(someArray[0]); // Prints "One" + GD.Print(someArray[1]); // Prints "Two" + GD.Print(someArray[2]); // Prints "Three" + + + +\ **Note:** If you only need one substring from the array, consider using :ref:`get_slice` which is faster. If you need to split strings with more complex rules, use the :ref:`RegEx` class instead. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_split_floats: + +.. rst-class:: classref-method + +:ref:`PackedFloat64Array` **split_floats** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** |const| + +Splits the string into floats by using a ``delimiter`` and returns a :ref:`PackedFloat64Array`. + +If ``allow_empty`` is ``false``, empty or invalid :ref:`float` conversions between adjacent delimiters are excluded. + +:: + + var a = "1,2,4.5".split_floats(",") # a is [1.0, 2.0, 4.5] + var c = "1| ||4.5".split_floats("|") # c is [1.0, 0.0, 0.0, 4.5] + var b = "1| ||4.5".split_floats("|", false) # b is [1.0, 4.5] + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_strip_edges: + +.. rst-class:: classref-method + +:ref:`String` **strip_edges** **(** :ref:`bool` left=true, :ref:`bool` right=true **)** |const| + +Strips all non-printable characters from the beginning and the end of the string. These include spaces, tabulations (``\t``), and newlines (``\n`` ``\r``). + +If ``left`` is ``false``, ignores the string's beginning. Likewise, if ``right`` is ``false``, ignores the string's end. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_strip_escapes: + +.. rst-class:: classref-method + +:ref:`String` **strip_escapes** **(** **)** |const| + +Strips all escape characters from the string. These include all non-printable control characters of the first page of the ASCII table (values from 0 to 31), such as tabulation (``\t``) and newline (``\n``, ``\r``) characters, but *not* spaces. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_substr: + +.. rst-class:: classref-method + +:ref:`String` **substr** **(** :ref:`int` from, :ref:`int` len=-1 **)** |const| + +Returns part of the string from the position ``from`` with length ``len``. If ``len`` is ``-1`` (as by default), returns the rest of the string starting from the given position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_ascii_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **to_ascii_buffer** **(** **)** |const| + +Converts the string to an `ASCII `__/Latin-1 encoded :ref:`PackedByteArray`. This method is slightly faster than :ref:`to_utf8_buffer`, but replaces all unsupported characters with spaces. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_camel_case: + +.. rst-class:: classref-method + +:ref:`String` **to_camel_case** **(** **)** |const| + +Returns the string converted to ``camelCase``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_float: + +.. rst-class:: classref-method + +:ref:`float` **to_float** **(** **)** |const| + +Converts the string representing a decimal number into a :ref:`float`. This method stops on the first non-number character, except the first decimal point (``.``) and the exponent letter (``e``). See also :ref:`is_valid_float`. + +:: + + var a = "12.35".to_float() # a is 12.35 + var b = "1.2.3".to_float() # b is 1.2 + var c = "12xy3".to_float() # c is 12.0 + var d = "1e3".to_float() # d is 1000.0 + var e = "Hello!".to_int() # e is 0.0 + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_int: + +.. rst-class:: classref-method + +:ref:`int` **to_int** **(** **)** |const| + +Converts the string representing an integer number into an :ref:`int`. This method removes any non-number character and stops at the first decimal point (``.``). See also :ref:`is_valid_int`. + +:: + + var a = "123".to_int() # a is 123 + var b = "x1y2z3".to_int() # b is 123 + var c = "-1.2.3".to_int() # c is -1 + var d = "Hello!".to_int() # d is 0 + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_lower: + +.. rst-class:: classref-method + +:ref:`String` **to_lower** **(** **)** |const| + +Returns the string converted to lowercase. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_pascal_case: + +.. rst-class:: classref-method + +:ref:`String` **to_pascal_case** **(** **)** |const| + +Returns the string converted to ``PascalCase``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_snake_case: + +.. rst-class:: classref-method + +:ref:`String` **to_snake_case** **(** **)** |const| + +Returns the string converted to ``snake_case``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_upper: + +.. rst-class:: classref-method + +:ref:`String` **to_upper** **(** **)** |const| + +Returns the string converted to uppercase. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_utf16_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **to_utf16_buffer** **(** **)** |const| + +Converts the string to a `UTF-16 `__ encoded :ref:`PackedByteArray`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_utf32_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **to_utf32_buffer** **(** **)** |const| + +Converts the string to a `UTF-32 `__ encoded :ref:`PackedByteArray`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_to_utf8_buffer: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **to_utf8_buffer** **(** **)** |const| + +Converts the string to a `UTF-8 `__ encoded :ref:`PackedByteArray`. This method is slightly slower than :ref:`to_ascii_buffer`, but supports all UTF-8 characters. For most cases, prefer using this method. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_trim_prefix: + +.. rst-class:: classref-method + +:ref:`String` **trim_prefix** **(** :ref:`String` prefix **)** |const| + +Removes the given ``prefix`` from the start of the string, or returns the string unchanged. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_trim_suffix: + +.. rst-class:: classref-method + +:ref:`String` **trim_suffix** **(** :ref:`String` suffix **)** |const| + +Removes the given ``suffix`` from the end of the string, or returns the string unchanged. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_unicode_at: + +.. rst-class:: classref-method + +:ref:`int` **unicode_at** **(** :ref:`int` at **)** |const| + +Returns the character code at position ``at``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_uri_decode: + +.. rst-class:: classref-method + +:ref:`String` **uri_decode** **(** **)** |const| + +Decodes the string from its URL-encoded format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request. + + +.. tabs:: + + .. code-tab:: gdscript + + var url = "$DOCS_URL/?highlight=Godot%20Engine%3%docs" + print(url.uri_decode()) # Prints "$DOCS_URL/?highlight=Godot Engine:docs" + + .. code-tab:: csharp + + var url = "$DOCS_URL/?highlight=Godot%20Engine%3%docs" + GD.Print(url.URIDecode()) // Prints "$DOCS_URL/?highlight=Godot Engine:docs" + + + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_uri_encode: + +.. rst-class:: classref-method + +:ref:`String` **uri_encode** **(** **)** |const| + +Encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request. + + +.. tabs:: + + .. code-tab:: gdscript + + var prefix = "$DOCS_URL/?highlight=" + var url = prefix + "Godot Engine:docs".uri_encode() + + print(url) # Prints "$DOCS_URL/?highlight=Godot%20Engine%3%docs" + + .. code-tab:: csharp + + var prefix = "$DOCS_URL/?highlight="; + var url = prefix + "Godot Engine:docs".URIEncode(); + + GD.Print(url); // Prints "$DOCS_URL/?highlight=Godot%20Engine%3%docs" + + + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_validate_node_name: + +.. rst-class:: classref-method + +:ref:`String` **validate_node_name** **(** **)** |const| + +Removes all characters that are not allowed in :ref:`Node.name` from the string (``.`` ``:`` ``@`` ``/`` ``"`` ``%``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_xml_escape: + +.. rst-class:: classref-method + +:ref:`String` **xml_escape** **(** :ref:`bool` escape_quotes=false **)** |const| + +Returns a copy of the string with special characters escaped using the XML standard. If ``escape_quotes`` is ``true``, the single quote (``'``) and double quote (``"``) characters are also escaped. + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_method_xml_unescape: + +.. rst-class:: classref-method + +:ref:`String` **xml_unescape** **(** **)** |const| + +Returns a copy of the string with escaped characters replaced by their meanings according to the XML standard. .. rst-class:: classref-section-separator @@ -164,6 +1824,48 @@ Returns ``true`` if the **StringName** and ``right`` do not refer to the same na ---- +.. _class_StringName_operator_mod_Variant: + +.. rst-class:: classref-operator + +:ref:`String` **operator %** **(** :ref:`Variant` right **)** + +.. container:: contribute + + There is currently no description for this operator. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_operator_sum_String: + +.. rst-class:: classref-operator + +:ref:`String` **operator +** **(** :ref:`String` right **)** + +.. container:: contribute + + There is currently no description for this operator. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + +.. _class_StringName_operator_sum_StringName: + +.. rst-class:: classref-operator + +:ref:`String` **operator +** **(** :ref:`StringName` right **)** + +.. container:: contribute + + There is currently no description for this operator. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_StringName_operator_lt_StringName: .. rst-class:: classref-operator diff --git a/classes/class_textline.rst b/classes/class_textline.rst index 147e08146..0a6acca82 100644 --- a/classes/class_textline.rst +++ b/classes/class_textline.rst @@ -55,43 +55,43 @@ Methods .. table:: :widths: auto - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`add_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1 **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`add_string` **(** :ref:`String` text, :ref:`Font` font, :ref:`int` font_size, :ref:`String` language="", :ref:`Variant` meta=null **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear` **(** **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw` **(** :ref:`RID` canvas, :ref:`Vector2` pos, :ref:`Color` color=Color(1, 1, 1, 1) **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_outline` **(** :ref:`RID` canvas, :ref:`Vector2` pos, :ref:`int` outline_size=1, :ref:`Color` color=Color(1, 1, 1, 1) **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_line_ascent` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_line_descent` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_line_underline_position` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_line_underline_thickness` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_line_width` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Rect2` | :ref:`get_object_rect` **(** :ref:`Variant` key **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Array` | :ref:`get_objects` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2` | :ref:`get_size` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`hit_test` **(** :ref:`float` coords **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`resize_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5 **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_bidi_override` **(** :ref:`Array` override **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tab_align` **(** :ref:`PackedFloat32Array` tab_stops **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`add_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1, :ref:`float` baseline=0.0 **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`add_string` **(** :ref:`String` text, :ref:`Font` font, :ref:`int` font_size, :ref:`String` language="", :ref:`Variant` meta=null **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear` **(** **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw` **(** :ref:`RID` canvas, :ref:`Vector2` pos, :ref:`Color` color=Color(1, 1, 1, 1) **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`draw_outline` **(** :ref:`RID` canvas, :ref:`Vector2` pos, :ref:`int` outline_size=1, :ref:`Color` color=Color(1, 1, 1, 1) **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_line_ascent` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_line_descent` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_line_underline_position` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_line_underline_thickness` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_line_width` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2` | :ref:`get_object_rect` **(** :ref:`Variant` key **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Array` | :ref:`get_objects` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_size` **(** **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`hit_test` **(** :ref:`float` coords **)** |const| | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`resize_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`float` baseline=0.0 **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_bidi_override` **(** :ref:`Array` override **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tab_align` **(** :ref:`PackedFloat32Array` tab_stops **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -247,7 +247,7 @@ Method Descriptions .. rst-class:: classref-method -:ref:`bool` **add_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1 **)** +:ref:`bool` **add_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1, :ref:`float` baseline=0.0 **)** Adds inline object to the text buffer, ``key`` must be unique. In the text, object is represented as ``length`` object replacement characters. @@ -427,7 +427,7 @@ Returns caret character offset at the specified pixel offset at the baseline. Th .. rst-class:: classref-method -:ref:`bool` **resize_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5 **)** +:ref:`bool` **resize_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`float` baseline=0.0 **)** Sets new size and alignment of embedded object. diff --git a/classes/class_textparagraph.rst b/classes/class_textparagraph.rst index 6038875d7..224907043 100644 --- a/classes/class_textparagraph.rst +++ b/classes/class_textparagraph.rst @@ -62,7 +62,7 @@ Methods :widths: auto +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`add_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1 **)** | + | :ref:`bool` | :ref:`add_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1, :ref:`float` baseline=0.0 **)** | +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`add_string` **(** :ref:`String` text, :ref:`Font` font, :ref:`int` font_size, :ref:`String` language="", :ref:`Variant` meta=null **)** | +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -118,7 +118,7 @@ Methods +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`hit_test` **(** :ref:`Vector2` coords **)** |const| | +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`resize_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5 **)** | + | :ref:`bool` | :ref:`resize_object` **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`float` baseline=0.0 **)** | +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_bidi_override` **(** :ref:`Array` override **)** | +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -332,7 +332,7 @@ Method Descriptions .. rst-class:: classref-method -:ref:`bool` **add_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1 **)** +:ref:`bool` **add_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1, :ref:`float` baseline=0.0 **)** Adds inline object to the text buffer, ``key`` must be unique. In the text, object is represented as ``length`` object replacement characters. @@ -668,7 +668,7 @@ Returns caret character offset at the specified coordinates. This function alway .. rst-class:: classref-method -:ref:`bool` **resize_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5 **)** +:ref:`bool` **resize_object** **(** :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`float` baseline=0.0 **)** Sets new size and alignment of embedded object. diff --git a/classes/class_textserver.rst b/classes/class_textserver.rst index b71a5d7ad..00705b4fe 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -292,7 +292,7 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shaped_set_span_update_font` **(** :ref:`RID` shaped, :ref:`int` index, :ref:`RID[]` fonts, :ref:`int` size, :ref:`Dictionary` opentype_features={} **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`shaped_text_add_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1 **)** | + | :ref:`bool` | :ref:`shaped_text_add_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1, :ref:`float` baseline=0.0 **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`shaped_text_add_string` **(** :ref:`RID` shaped, :ref:`String` text, :ref:`RID[]` fonts, :ref:`int` size, :ref:`Dictionary` opentype_features={}, :ref:`String` language="", :ref:`Variant` meta=null **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -376,7 +376,7 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`shaped_text_prev_grapheme_pos` **(** :ref:`RID` shaped, :ref:`int` pos **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`shaped_text_resize_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5 **)** | + | :ref:`bool` | :ref:`shaped_text_resize_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`float` baseline=0.0 **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shaped_text_set_bidi_override` **(** :ref:`RID` shaped, :ref:`Array` override **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -402,7 +402,7 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`spoof_check` **(** :ref:`String` string **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedInt32Array` | :ref:`string_get_word_breaks` **(** :ref:`String` string, :ref:`String` language="" **)** |const| | + | :ref:`PackedInt32Array` | :ref:`string_get_word_breaks` **(** :ref:`String` string, :ref:`String` language="", :ref:`int` chars_per_line=0 **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`string_to_lower` **(** :ref:`String` string, :ref:`String` language="" **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1753,7 +1753,7 @@ Returns index of the cache texture containing the glyph. :ref:`RID` **font_get_glyph_texture_rid** **(** :ref:`RID` font_rid, :ref:`Vector2i` size, :ref:`int` glyph **)** |const| -Returns resource id of the cache texture containing the glyph. +Returns resource ID of the cache texture containing the glyph. \ **Note:** If there are pending glyphs to render, calling this function might trigger the texture cache update. @@ -2785,6 +2785,8 @@ Returns the dictionary of the supported OpenType variation coordinates. Converts a number from the Western Arabic (0..9) to the numeral systems used in ``language``. +If ``language`` is omitted, the active locale will be used. + .. rst-class:: classref-item-separator ---- @@ -3057,7 +3059,7 @@ Changes text span font, font size and OpenType features, without changing the te .. rst-class:: classref-method -:ref:`bool` **shaped_text_add_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1 **)** +:ref:`bool` **shaped_text_add_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`int` length=1, :ref:`float` baseline=0.0 **)** Adds inline object to the text buffer, ``key`` must be unique. In the text, object is represented as ``length`` object replacement characters. @@ -3567,7 +3569,7 @@ Returns composite character start position closest to the ``pos``. .. rst-class:: classref-method -:ref:`bool` **shaped_text_resize_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5 **)** +:ref:`bool` **shaped_text_resize_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align=5, :ref:`float` baseline=0.0 **)** Sets new size and alignment of embedded object. @@ -3733,9 +3735,17 @@ Returns ``true`` if ``string`` is likely to be an attempt at confusing the reade .. rst-class:: classref-method -:ref:`PackedInt32Array` **string_get_word_breaks** **(** :ref:`String` string, :ref:`String` language="" **)** |const| +:ref:`PackedInt32Array` **string_get_word_breaks** **(** :ref:`String` string, :ref:`String` language="", :ref:`int` chars_per_line=0 **)** |const| -Returns array of the word break character offsets. +Returns an array of the word break boundaries. Elements in the returned array are the offsets of the start and end of words. Therefore the length of the array is always even. + +When ``chars_per_line`` is greater than zero, line break boundaries are returned instead. + +:: + + 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] .. rst-class:: classref-item-separator diff --git a/classes/class_textserverextension.rst b/classes/class_textserverextension.rst index 4b33a307e..ce018cbdc 100644 --- a/classes/class_textserverextension.rst +++ b/classes/class_textserverextension.rst @@ -296,7 +296,7 @@ Methods +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_shaped_set_span_update_font` **(** :ref:`RID` shaped, :ref:`int` index, :ref:`RID[]` fonts, :ref:`int` size, :ref:`Dictionary` opentype_features **)** |virtual| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`_shaped_text_add_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align, :ref:`int` length **)** |virtual| | + | :ref:`bool` | :ref:`_shaped_text_add_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align, :ref:`int` length, :ref:`float` baseline **)** |virtual| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_shaped_text_add_string` **(** :ref:`RID` shaped, :ref:`String` text, :ref:`RID[]` fonts, :ref:`int` size, :ref:`Dictionary` opentype_features, :ref:`String` language, :ref:`Variant` meta **)** |virtual| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -380,7 +380,7 @@ Methods +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_shaped_text_prev_grapheme_pos` **(** :ref:`RID` shaped, :ref:`int` pos **)** |virtual| |const| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`_shaped_text_resize_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align **)** |virtual| | + | :ref:`bool` | :ref:`_shaped_text_resize_object` **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align, :ref:`float` baseline **)** |virtual| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_shaped_text_set_bidi_override` **(** :ref:`RID` shaped, :ref:`Array` override **)** |virtual| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -410,7 +410,7 @@ Methods +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_spoof_check` **(** :ref:`String` string **)** |virtual| |const| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedInt32Array` | :ref:`_string_get_word_breaks` **(** :ref:`String` string, :ref:`String` language **)** |virtual| |const| | + | :ref:`PackedInt32Array` | :ref:`_string_get_word_breaks` **(** :ref:`String` string, :ref:`String` language, :ref:`int` chars_per_line **)** |virtual| |const| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_string_to_lower` **(** :ref:`String` string, :ref:`String` language **)** |virtual| |const| | +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2282,7 +2282,7 @@ void **_shaped_set_span_update_font** **(** :ref:`RID` shaped, :ref:` .. rst-class:: classref-method -:ref:`bool` **_shaped_text_add_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align, :ref:`int` length **)** |virtual| +:ref:`bool` **_shaped_text_add_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align, :ref:`int` length, :ref:`float` baseline **)** |virtual| .. container:: contribute @@ -2870,7 +2870,7 @@ void **_shaped_text_overrun_trim_to_width** **(** :ref:`RID` shaped, .. rst-class:: classref-method -:ref:`bool` **_shaped_text_resize_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align **)** |virtual| +:ref:`bool` **_shaped_text_resize_object** **(** :ref:`RID` shaped, :ref:`Variant` key, :ref:`Vector2` size, :ref:`InlineAlignment` inline_align, :ref:`float` baseline **)** |virtual| .. container:: contribute @@ -3080,7 +3080,7 @@ const Glyph* **_shaped_text_sort_logical** **(** :ref:`RID` shaped ** .. rst-class:: classref-method -:ref:`PackedInt32Array` **_string_get_word_breaks** **(** :ref:`String` string, :ref:`String` language **)** |virtual| |const| +:ref:`PackedInt32Array` **_string_get_word_breaks** **(** :ref:`String` string, :ref:`String` language, :ref:`int` chars_per_line **)** |virtual| |const| .. container:: contribute diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst index 891d9e0ce..9e441ddd9 100644 --- a/classes/class_tilemap.rst +++ b/classes/class_tilemap.rst @@ -109,7 +109,7 @@ Methods +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TileMapPattern` | :ref:`get_pattern` **(** :ref:`int` layer, :ref:`Vector2i[]` coords_array **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i[]` | :ref:`get_surrounding_tiles` **(** :ref:`Vector2i` coords **)** | + | :ref:`Vector2i[]` | :ref:`get_surrounding_cells` **(** :ref:`Vector2i` coords **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i[]` | :ref:`get_used_cells` **(** :ref:`int` layer **)** |const| | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -561,11 +561,11 @@ Creates a new :ref:`TileMapPattern` from the given layer a ---- -.. _class_TileMap_method_get_surrounding_tiles: +.. _class_TileMap_method_get_surrounding_cells: .. rst-class:: classref-method -:ref:`Vector2i[]` **get_surrounding_tiles** **(** :ref:`Vector2i` coords **)** +:ref:`Vector2i[]` **get_surrounding_cells** **(** :ref:`Vector2i` coords **)** Returns the list of all neighbourings cells to the one at ``coords`` @@ -693,10 +693,12 @@ Sets the tile indentifiers for the cell on layer ``layer`` at coordinates ``coor - The source identifier ``source_id`` identifies a :ref:`TileSetSource` identifier. See :ref:`TileSet.set_source_id`, -- The atlas coordinates identifier ``atlas_coords`` identifies a tile coordinates in the atlas (if the source is a :ref:`TileSetAtlasSource`. For :ref:`TileSetScenesCollectionSource` it should be 0), +- The atlas coordinates identifier ``atlas_coords`` identifies a tile coordinates in the atlas (if the source is a :ref:`TileSetAtlasSource`. For :ref:`TileSetScenesCollectionSource` it should always be ``Vector2i(0, 0)``), - The alternative tile identifier ``alternative_tile`` identifies a tile alternative the source is a :ref:`TileSetAtlasSource`, and the scene for a :ref:`TileSetScenesCollectionSource`. +If ``source_id`` is set to ``-1``, ``atlas_coords`` to ``Vector2i(-1, -1)`` or ``alternative_tile`` to ``-1``, the cell will be erased. An erased cell gets **all** its identifiers automatically set to their respective invalid values, namely ``-1``, ``Vector2i(-1, -1)`` and ``-1``. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst index 049fd2d09..c2d5d1f04 100644 --- a/classes/class_tileset.rst +++ b/classes/class_tileset.rst @@ -259,6 +259,8 @@ Rectangular tile shape. Diamond tile shape (for isometric look). +\ **Note:** Isometric **TileSet** works best if :ref:`TileMap` and all its layers have Y-sort enabled. + .. _class_TileSet_constant_TILE_SHAPE_HALF_OFFSET_SQUARE: .. rst-class:: classref-enumeration-constant diff --git a/classes/class_tree.rst b/classes/class_tree.rst index 13b9a36da..3ccc9c190 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -821,7 +821,7 @@ This will scroll the tree if necessary. In :ref:`SELECT_ROW` **get_button_id_at_position** **(** :ref:`Vector2` position **)** |const| -Returns the button id at ``position``, or -1 if no button is there. +Returns the button ID at ``position``, or -1 if no button is there. .. rst-class:: classref-item-separator diff --git a/classes/class_treeitem.rst b/classes/class_treeitem.rst index 51c7671a0..143c79ad4 100644 --- a/classes/class_treeitem.rst +++ b/classes/class_treeitem.rst @@ -472,7 +472,7 @@ Returns the :ref:`Texture2D` of the button at index ``button_id :ref:`int` **get_button_by_id** **(** :ref:`int` column, :ref:`int` id **)** |const| -Returns the button index if there is a button with id ``id`` in column ``column``, otherwise returns -1. +Returns the button index if there is a button with ID ``id`` in column ``column``, otherwise returns -1. .. rst-class:: classref-item-separator @@ -496,7 +496,7 @@ Returns the number of buttons in column ``column``. :ref:`int` **get_button_id** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| -Returns the id for the button at index ``button_idx`` in column ``column``. +Returns the ID for the button at index ``button_idx`` in column ``column``. .. rst-class:: classref-item-separator diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index 9b5b04852..f9318884d 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -19,7 +19,7 @@ Description 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. -It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike :ref:`float` which is always 64-bit. If double precision is needed, compile the engine with the option ``float=64``. +It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike :ref:`float` which is always 64-bit. If double precision is needed, compile the engine with the option ``precision=double``. See :ref:`Vector2i` for its integer counterpart. diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 6f682d962..597dc8eef 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -19,7 +19,7 @@ Description 3-element structure that can be used to represent positions in 3D space or any other triplet of numeric values. -It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike :ref:`float` which is always 64-bit. If double precision is needed, compile the engine with the option ``float=64``. +It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike :ref:`float` which is always 64-bit. If double precision is needed, compile the engine with the option ``precision=double``. See :ref:`Vector3i` for its integer counterpart. diff --git a/classes/class_vector4.rst b/classes/class_vector4.rst index a8338e966..fe4bae2e1 100644 --- a/classes/class_vector4.rst +++ b/classes/class_vector4.rst @@ -19,7 +19,7 @@ Description 4-element structure that can be used to represent any quadruplet of numeric values. -It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike :ref:`float` which is always 64-bit. If double precision is needed, compile the engine with the option ``float=64``. +It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike :ref:`float` which is always 64-bit. If double precision is needed, compile the engine with the option ``precision=double``. See :ref:`Vector4i` for its integer counterpart. diff --git a/classes/class_webrtcdatachannel.rst b/classes/class_webrtcdatachannel.rst index 11255e755..05654c2b3 100644 --- a/classes/class_webrtcdatachannel.rst +++ b/classes/class_webrtcdatachannel.rst @@ -198,9 +198,9 @@ Returns the number of bytes currently queued to be sent over this channel. :ref:`int` **get_id** **(** **)** |const| -Returns the id assigned to this channel during creation (or auto-assigned during negotiation). +Returns the ID assigned to this channel during creation (or auto-assigned during negotiation). -If the channel is not negotiated out-of-band the id will only be available after the connection is established (will return ``65535`` until then). +If the channel is not negotiated out-of-band the ID will only be available after the connection is established (will return ``65535`` until then). .. rst-class:: classref-item-separator diff --git a/classes/class_window.rst b/classes/class_window.rst index f23ef6ba8..aa1a5c469 100644 --- a/classes/class_window.rst +++ b/classes/class_window.rst @@ -93,18 +93,36 @@ Methods .. table:: :widths: auto + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_theme_color_override` **(** :ref:`StringName` name, :ref:`Color` color **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_theme_constant_override` **(** :ref:`StringName` name, :ref:`int` constant **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_theme_font_override` **(** :ref:`StringName` name, :ref:`Font` font **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_theme_font_size_override` **(** :ref:`StringName` name, :ref:`int` font_size **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_theme_icon_override` **(** :ref:`StringName` name, :ref:`Texture2D` texture **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_theme_stylebox_override` **(** :ref:`StringName` name, :ref:`StyleBox` stylebox **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`begin_bulk_theme_override` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`can_draw` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`child_controls_changed` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`end_bulk_theme_override` **(** **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_contents_minimum_size` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_flag` **(** :ref:`Flags` flag **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`LayoutDirection` | :ref:`get_layout_direction` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`get_real_size` **(** **)** |const| | + | :ref:`Vector2i` | :ref:`get_position_with_decorations` **(** **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`get_size_with_decorations` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_theme_color` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -130,16 +148,28 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_color` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_theme_color_override` **(** :ref:`StringName` name **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_constant` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_theme_constant_override` **(** :ref:`StringName` name **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_font` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_theme_font_override` **(** :ref:`StringName` name **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_font_size` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_theme_font_size_override` **(** :ref:`StringName` name **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_icon` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_theme_icon_override` **(** :ref:`StringName` name **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_stylebox` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_theme_stylebox_override` **(** :ref:`StringName` name **)** |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`hide` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_embedded` **(** **)** |const| | @@ -162,6 +192,18 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`popup_on_parent` **(** :ref:`Rect2i` parent_rect **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_theme_color_override` **(** :ref:`StringName` name **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_theme_constant_override` **(** :ref:`StringName` name **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_theme_font_override` **(** :ref:`StringName` name **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_theme_font_size_override` **(** :ref:`StringName` name **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_theme_icon_override` **(** :ref:`StringName` name **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_theme_stylebox_override` **(** :ref:`StringName` name **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`request_attention` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`reset_size` **(** **)** | @@ -974,9 +1016,9 @@ The window's size in pixels. - void **set_theme** **(** :ref:`Theme` value **)** - :ref:`Theme` **get_theme** **(** **)** -The :ref:`Theme` resource that determines the style of the underlying :ref:`Control` nodes. +The :ref:`Theme` resource this node and all its :ref:`Control` and **Window** children use. If a child node has its own :ref:`Theme` resource set, theme items are merged with child's definitions having higher priority. -\ **Window** styles will have no effect unless the window is embedded. +\ **Note:** **Window** styles will have no effect unless the window is embedded. .. rst-class:: classref-item-separator @@ -1131,6 +1173,102 @@ If ``false``, you need to call :ref:`child_controls_changed` name, :ref:`Color` color **)** + +Creates a local override for a theme :ref:`Color` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_color_override`. + +See also :ref:`get_theme_color` and :ref:`Control.add_theme_color_override` for more details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_add_theme_constant_override: + +.. rst-class:: classref-method + +void **add_theme_constant_override** **(** :ref:`StringName` name, :ref:`int` constant **)** + +Creates a local override for a theme constant with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_constant_override`. + +See also :ref:`get_theme_constant`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_add_theme_font_override: + +.. rst-class:: classref-method + +void **add_theme_font_override** **(** :ref:`StringName` name, :ref:`Font` font **)** + +Creates a local override for a theme :ref:`Font` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_override`. + +See also :ref:`get_theme_font`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_add_theme_font_size_override: + +.. rst-class:: classref-method + +void **add_theme_font_size_override** **(** :ref:`StringName` name, :ref:`int` font_size **)** + +Creates a local override for a theme font size with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_size_override`. + +See also :ref:`get_theme_font_size`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_add_theme_icon_override: + +.. rst-class:: classref-method + +void **add_theme_icon_override** **(** :ref:`StringName` name, :ref:`Texture2D` texture **)** + +Creates a local override for a theme icon with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_icon_override`. + +See also :ref:`get_theme_icon`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_add_theme_stylebox_override: + +.. rst-class:: classref-method + +void **add_theme_stylebox_override** **(** :ref:`StringName` name, :ref:`StyleBox` stylebox **)** + +Creates a local override for a theme :ref:`StyleBox` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_stylebox_override`. + +See also :ref:`get_theme_stylebox` and :ref:`Control.add_theme_stylebox_override` for more details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_begin_bulk_theme_override: + +.. rst-class:: classref-method + +void **begin_bulk_theme_override** **(** **)** + +Prevents ``*_theme_*_override`` methods from emitting :ref:`NOTIFICATION_THEME_CHANGED` until :ref:`end_bulk_theme_override` is called. + +.. rst-class:: classref-item-separator + +---- + .. _class_Window_method_can_draw: .. rst-class:: classref-method @@ -1155,6 +1293,18 @@ Requests an update of the **Window** size to fit underlying :ref:`Control`. + +.. rst-class:: classref-item-separator + +---- + .. _class_Window_method_get_contents_minimum_size: .. rst-class:: classref-method @@ -1191,11 +1341,23 @@ Returns layout direction and text writing direction. ---- -.. _class_Window_method_get_real_size: +.. _class_Window_method_get_position_with_decorations: .. rst-class:: classref-method -:ref:`Vector2i` **get_real_size** **(** **)** |const| +:ref:`Vector2i` **get_position_with_decorations** **(** **)** |const| + +Returns the window's position including its border. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_get_size_with_decorations: + +.. rst-class:: classref-method + +:ref:`Vector2i` **get_size_with_decorations** **(** **)** |const| Returns the window's size including its border. @@ -1209,7 +1371,7 @@ Returns the window's size including its border. :ref:`Color` **get_theme_color** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns the :ref:`Color` at ``name`` if the theme has ``theme_type``. +Returns a :ref:`Color` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a color item with the specified ``name`` and ``theme_type``. See :ref:`Control.get_theme_color` for more details. @@ -1223,7 +1385,7 @@ See :ref:`Control.get_theme_color` for mor :ref:`int` **get_theme_constant** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns the constant at ``name`` if the theme has ``theme_type``. +Returns a constant from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a constant item with the specified ``name`` and ``theme_type``. See :ref:`Control.get_theme_color` for more details. @@ -1237,9 +1399,9 @@ See :ref:`Control.get_theme_color` for mor :ref:`float` **get_theme_default_base_scale** **(** **)** |const| -Returns the default base scale defined in the attached :ref:`Theme`. +Returns the default base scale value from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_base_scale` value. -See :ref:`Theme.default_base_scale` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1251,9 +1413,9 @@ See :ref:`Theme.default_base_scale` for :ref:`Font` **get_theme_default_font** **(** **)** |const| -Returns the default :ref:`Font` defined in the attached :ref:`Theme`. +Returns the default font from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_font` value. -See :ref:`Theme.default_font` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1265,9 +1427,9 @@ See :ref:`Theme.default_font` for more detail :ref:`int` **get_theme_default_font_size** **(** **)** |const| -Returns the default font size defined in the attached :ref:`Theme`. +Returns the default font size value from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_font_size` value. -See :ref:`Theme.default_font_size` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1279,9 +1441,9 @@ See :ref:`Theme.default_font_size` for m :ref:`Font` **get_theme_font** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns the :ref:`Font` at ``name`` if the theme has ``theme_type``. +Returns a :ref:`Font` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a font item with the specified ``name`` and ``theme_type``. -See :ref:`Control.get_theme_color` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1293,9 +1455,9 @@ See :ref:`Control.get_theme_color` for mor :ref:`int` **get_theme_font_size** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns the font size at ``name`` if the theme has ``theme_type``. +Returns a font size from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a font size item with the specified ``name`` and ``theme_type``. -See :ref:`Control.get_theme_color` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1307,9 +1469,9 @@ See :ref:`Control.get_theme_color` for mor :ref:`Texture2D` **get_theme_icon** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns the icon at ``name`` if the theme has ``theme_type``. +Returns an icon from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has an icon item with the specified ``name`` and ``theme_type``. -See :ref:`Control.get_theme_color` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1321,9 +1483,9 @@ See :ref:`Control.get_theme_color` for mor :ref:`StyleBox` **get_theme_stylebox** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns the :ref:`StyleBox` at ``name`` if the theme has ``theme_type``. +Returns a :ref:`StyleBox` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a stylebox item with the specified ``name`` and ``theme_type``. -See :ref:`Control.get_theme_color` for more details. +See :ref:`Control.get_theme_color` for details. .. rst-class:: classref-item-separator @@ -1359,7 +1521,23 @@ Returns ``true`` if the window is focused. :ref:`bool` **has_theme_color** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns ``true`` if :ref:`Color` with ``name`` is in ``theme_type``. +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a color item with the specified ``name`` and ``theme_type``. + +See :ref:`Control.get_theme_color` for details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_has_theme_color_override: + +.. rst-class:: classref-method + +:ref:`bool` **has_theme_color_override** **(** :ref:`StringName` name **)** |const| + +Returns ``true`` if there is a local override for a theme :ref:`Color` with the specified ``name`` in this :ref:`Control` node. + +See :ref:`add_theme_color_override`. .. rst-class:: classref-item-separator @@ -1371,7 +1549,23 @@ Returns ``true`` if :ref:`Color` with ``name`` is in ``theme_type`` :ref:`bool` **has_theme_constant** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns ``true`` if constant with ``name`` is in ``theme_type``. +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a constant item with the specified ``name`` and ``theme_type``. + +See :ref:`Control.get_theme_color` for details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_has_theme_constant_override: + +.. rst-class:: classref-method + +:ref:`bool` **has_theme_constant_override** **(** :ref:`StringName` name **)** |const| + +Returns ``true`` if there is a local override for a theme constant with the specified ``name`` in this :ref:`Control` node. + +See :ref:`add_theme_constant_override`. .. rst-class:: classref-item-separator @@ -1383,7 +1577,23 @@ Returns ``true`` if constant with ``name`` is in ``theme_type``. :ref:`bool` **has_theme_font** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns ``true`` if :ref:`Font` with ``name`` is in ``theme_type``. +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a font item with the specified ``name`` and ``theme_type``. + +See :ref:`Control.get_theme_color` for details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_has_theme_font_override: + +.. rst-class:: classref-method + +:ref:`bool` **has_theme_font_override** **(** :ref:`StringName` name **)** |const| + +Returns ``true`` if there is a local override for a theme :ref:`Font` with the specified ``name`` in this :ref:`Control` node. + +See :ref:`add_theme_font_override`. .. rst-class:: classref-item-separator @@ -1395,7 +1605,23 @@ Returns ``true`` if :ref:`Font` with ``name`` is in ``theme_type``. :ref:`bool` **has_theme_font_size** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns ``true`` if font size with ``name`` is in ``theme_type``. +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a font size item with the specified ``name`` and ``theme_type``. + +See :ref:`Control.get_theme_color` for details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_has_theme_font_size_override: + +.. rst-class:: classref-method + +:ref:`bool` **has_theme_font_size_override** **(** :ref:`StringName` name **)** |const| + +Returns ``true`` if there is a local override for a theme font size with the specified ``name`` in this :ref:`Control` node. + +See :ref:`add_theme_font_size_override`. .. rst-class:: classref-item-separator @@ -1407,7 +1633,23 @@ Returns ``true`` if font size with ``name`` is in ``theme_type``. :ref:`bool` **has_theme_icon** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns ``true`` if icon with ``name`` is in ``theme_type``. +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has an icon item with the specified ``name`` and ``theme_type``. + +See :ref:`Control.get_theme_color` for details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_has_theme_icon_override: + +.. rst-class:: classref-method + +:ref:`bool` **has_theme_icon_override** **(** :ref:`StringName` name **)** |const| + +Returns ``true`` if there is a local override for a theme icon with the specified ``name`` in this :ref:`Control` node. + +See :ref:`add_theme_icon_override`. .. rst-class:: classref-item-separator @@ -1419,7 +1661,23 @@ Returns ``true`` if icon with ``name`` is in ``theme_type``. :ref:`bool` **has_theme_stylebox** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| -Returns ``true`` if :ref:`StyleBox` with ``name`` is in ``theme_type``. +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a stylebox item with the specified ``name`` and ``theme_type``. + +See :ref:`Control.get_theme_color` for details. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_has_theme_stylebox_override: + +.. rst-class:: classref-method + +:ref:`bool` **has_theme_stylebox_override** **(** :ref:`StringName` name **)** |const| + +Returns ``true`` if there is a local override for a theme :ref:`StyleBox` with the specified ``name`` in this :ref:`Control` node. + +See :ref:`add_theme_stylebox_override`. .. rst-class:: classref-item-separator @@ -1565,6 +1823,78 @@ If the **Window** is embedded, has the same effect as :ref:`popup` name **)** + +Removes a local override for a theme :ref:`Color` with the specified ``name`` previously added by :ref:`add_theme_color_override` or via the Inspector dock. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_remove_theme_constant_override: + +.. rst-class:: classref-method + +void **remove_theme_constant_override** **(** :ref:`StringName` name **)** + +Removes a local override for a theme constant with the specified ``name`` previously added by :ref:`add_theme_constant_override` or via the Inspector dock. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_remove_theme_font_override: + +.. rst-class:: classref-method + +void **remove_theme_font_override** **(** :ref:`StringName` name **)** + +Removes a local override for a theme :ref:`Font` with the specified ``name`` previously added by :ref:`add_theme_font_override` or via the Inspector dock. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_remove_theme_font_size_override: + +.. rst-class:: classref-method + +void **remove_theme_font_size_override** **(** :ref:`StringName` name **)** + +Removes a local override for a theme font size with the specified ``name`` previously added by :ref:`add_theme_font_size_override` or via the Inspector dock. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_remove_theme_icon_override: + +.. rst-class:: classref-method + +void **remove_theme_icon_override** **(** :ref:`StringName` name **)** + +Removes a local override for a theme icon with the specified ``name`` previously added by :ref:`add_theme_icon_override` or via the Inspector dock. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Window_method_remove_theme_stylebox_override: + +.. rst-class:: classref-method + +void **remove_theme_stylebox_override** **(** :ref:`StringName` name **)** + +Removes a local override for a theme :ref:`StyleBox` with the specified ``name`` previously added by :ref:`add_theme_stylebox_override` or via the Inspector dock. + +.. rst-class:: classref-item-separator + +---- + .. _class_Window_method_request_attention: .. rst-class:: classref-method diff --git a/classes/class_xrinterfaceextension.rst b/classes/class_xrinterfaceextension.rst index f3ea98663..7e35afe28 100644 --- a/classes/class_xrinterfaceextension.rst +++ b/classes/class_xrinterfaceextension.rst @@ -140,7 +140,7 @@ Return ``true`` if anchor detection is enabled for this interface. :ref:`int` **_get_camera_feed_id** **(** **)** |virtual| |const| -Returns the camera feed id for the :ref:`CameraFeed` registered with the :ref:`CameraServer` that should be presented as the background on an AR capable device (if applicable). +Returns the camera feed ID for the :ref:`CameraFeed` registered with the :ref:`CameraServer` that should be presented as the background on an AR capable device (if applicable). .. rst-class:: classref-item-separator diff --git a/classes/index.rst b/classes/index.rst index e51ec5a47..7dc6106ef 100644 --- a/classes/index.rst +++ b/classes/index.rst @@ -379,6 +379,7 @@ Resources class_font class_fontfile class_fontvariation + class_gdextension class_gdscript class_gltfaccessor class_gltfanimation @@ -431,7 +432,6 @@ Resources class_meshtexture class_missingresource class_multimesh - class_nativeextension class_navigationmesh class_navigationpolygon class_noise @@ -711,6 +711,7 @@ Other objects class_engineprofiler class_expression class_fileaccess + class_gdextensionmanager class_geometry2d class_geometry3d class_godotsharp @@ -745,7 +746,6 @@ Other objects class_multiplayerpeer class_multiplayerpeerextension class_mutex - class_nativeextensionmanager class_navigationmeshgenerator class_navigationpathqueryparameters2d class_navigationpathqueryparameters3d