From 95ae1de7d11489fdc7c1ba510001d1ed665d8f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 1 Jun 2022 00:41:12 +0200 Subject: [PATCH] classref: Sync with current 3.5 branch (af8a02dd) --- classes/class_@gdscript.rst | 41 +- classes/class_@globalscope.rst | 6 +- classes/class_animatedsprite.rst | 10 +- classes/class_animationplayer.rst | 2 + classes/class_array.rst | 4 +- classes/class_arraymesh.rst | 2 +- classes/class_aspectratiocontainer.rst | 5 + classes/class_astar.rst | 2 +- classes/class_astar2d.rst | 2 +- classes/class_basis.rst | 12 +- classes/class_boxcontainer.rst | 5 + classes/class_camera.rst | 4 +- classes/class_canvasitem.rst | 26 +- classes/class_centercontainer.rst | 5 + classes/class_collisionpolygon2d.rst | 2 + classes/class_collisionshape2d.rst | 2 + classes/class_container.rst | 5 + classes/class_control.rst | 4 +- classes/class_cryptokey.rst | 2 - classes/class_dictionary.rst | 2 +- classes/class_editorfilesystem.rst | 2 +- classes/class_editorspinslider.rst | 36 +- classes/class_environment.rst | 12 +- classes/class_filedialog.rst | 40 +- classes/class_font.rst | 131 ++++- classes/class_geometry.rst | 4 +- classes/class_geometryinstance.rst | 2 +- classes/class_gradient.rst | 47 +- classes/class_graphedit.rst | 4 +- classes/class_gridcontainer.rst | 2 + classes/class_hashingcontext.rst | 2 - classes/class_hboxcontainer.rst | 5 + classes/class_hsplitcontainer.rst | 5 + classes/class_httprequest.rst | 16 +- classes/class_input.rst | 4 +- classes/class_inputmap.rst | 2 + classes/class_label3d.rst | 544 ++++++++++++++++++++ classes/class_line2d.rst | 8 +- classes/class_margincontainer.rst | 5 + classes/class_navigation2dserver.rst | 40 ++ classes/class_navigationagent.rst | 58 ++- classes/class_navigationagent2d.rst | 20 +- classes/class_navigationmesh.rst | 24 +- classes/class_navigationmeshgenerator.rst | 14 +- classes/class_navigationmeshinstance.rst | 20 +- classes/class_navigationobstacle.rst | 10 + classes/class_navigationobstacle2d.rst | 10 + classes/class_navigationpolygoninstance.rst | 16 + classes/class_navigationserver.rst | 40 ++ classes/class_networkedmultiplayerenet.rst | 2 +- classes/class_node.rst | 10 +- classes/class_object.rst | 4 +- classes/class_optionbutton.rst | 4 +- classes/class_os.rst | 52 +- classes/class_panelcontainer.rst | 2 + classes/class_polygon2d.rst | 4 +- classes/class_poolbytearray.rst | 60 ++- classes/class_poolcolorarray.rst | 62 ++- classes/class_poolintarray.rst | 60 ++- classes/class_poolrealarray.rst | 112 +++- classes/class_poolstringarray.rst | 62 ++- classes/class_poolvector2array.rst | 62 ++- classes/class_poolvector3array.rst | 60 ++- classes/class_popupmenu.rst | 12 +- classes/class_primitivemesh.rst | 2 +- classes/class_propertytweener.rst | 4 +- classes/class_proximitygroup.rst | 60 ++- classes/class_richtextlabel.rst | 10 +- classes/class_rigidbody.rst | 4 +- classes/class_rigidbody2d.rst | 4 +- classes/class_scenetree.rst | 64 ++- classes/class_scenetreetween.rst | 4 + classes/class_scrollcontainer.rst | 5 + classes/class_shape2d.rst | 12 +- classes/class_spatialmaterial.rst | 24 +- classes/class_splitcontainer.rst | 5 + classes/class_spritebase3d.rst | 122 ++++- classes/class_tabcontainer.rst | 5 + classes/class_textmesh.rst | 176 +++++++ classes/class_time.rst | 94 ++-- classes/class_transform.rst | 10 +- classes/class_transform2d.rst | 10 +- classes/class_tree.rst | 2 +- classes/class_tween.rst | 2 +- classes/class_vboxcontainer.rst | 2 + classes/class_vector2.rst | 6 +- classes/class_vector3.rst | 6 +- classes/class_videostreamgdnative.rst | 4 +- classes/class_visualserver.rst | 14 +- classes/class_vsplitcontainer.rst | 5 + classes/class_webxrinterface.rst | 2 +- classes/class_x509certificate.rst | 2 - 92 files changed, 2119 insertions(+), 375 deletions(-) create mode 100644 classes/class_label3d.rst create mode 100644 classes/class_textmesh.rst diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 7a8c85d6e..68815d086 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -834,6 +834,8 @@ Similar to :ref:`lerp`, but interpolates correctly rotation = lerp_angle(min_angle, max_angle, elapsed) elapsed += delta +\ **Note:** This method lerps through the shortest path between ``from`` and ``to``. However, when these two angles are approximately ``PI + k * TAU`` apart for any integer ``k``, it's not obvious which way they lerp due to floating-point precision errors. For example, ``lerp_angle(0, PI, weight)`` lerps counter-clockwise, while ``lerp_angle(0, PI + 5 * TAU, weight)`` lerps clockwise. + ---- .. _class_@GDScript_method_linear2db: @@ -1178,12 +1180,14 @@ Converts an angle expressed in radians to degrees. - :ref:`float` **rand_range** **(** :ref:`float` from, :ref:`float` to **)** -Random range, any floating point value between ``from`` and ``to``. +Returns a random floating point value between ``from`` and ``to`` (both endpoints inclusive). :: prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263 +\ **Note:** This is equivalent to ``randf() * (to - from) + from``. + ---- .. _class_@GDScript_method_rand_seed: @@ -1238,33 +1242,34 @@ Randomizes the seed (or the internal state) of the random number generator. Curr - :ref:`Array` **range** **(** ... **)** |vararg| -Returns an array with the given range. Range can be 1 argument ``N`` (0 to ``N`` - 1), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). Returns an empty array if the range isn't valid (e.g. ``range(2, 5, -1)`` or ``range(5, 5, 1)``). +Returns an array with the given range. :ref:`range` can be called in three ways: -Returns an array with the given range. ``range()`` can have 1 argument N (``0`` to ``N - 1``), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). ``increment`` can be negative. If ``increment`` is negative, ``final - 1`` will become ``final + 1``. Also, the initial value must be greater than the final value for the loop to run. +\ ``range(n: int)``: Starts from 0, increases by steps of 1, and stops *before* ``n``. The argument ``n`` is **exclusive**. + +\ ``range(b: int, n: int)``: Starts from ``b``, increases by steps of 1, and stops *before* ``n``. The arguments ``b`` and ``n`` are **inclusive** and **exclusive**, respectively. + +\ ``range(b: int, n: int, s: int)``: Starts from ``b``, increases/decreases by steps of ``s``, and stops *before* ``n``. The arguments ``b`` and ``n`` are **inclusive** and **exclusive**, respectively. The argument ``s`` **can** be negative, but not ``0``. If ``s`` is ``0``, an error message is printed. + +\ :ref:`range` converts all arguments to :ref:`int` before processing. + +\ **Note:** Returns an empty array if no value meets the value constraint (e.g. ``range(2, 5, -1)`` or ``range(5, 5, 1)``). + +Examples: :: - print(range(4)) - print(range(2, 5)) - print(range(0, 6, 2)) - -Output: - -:: - - [0, 1, 2, 3] - [2, 3, 4] - [0, 2, 4] + print(range(4)) # Prints [0, 1, 2, 3] + print(range(2, 5)) # Prints [2, 3, 4] + print(range(0, 6, 2)) # Prints [0, 2, 4] + print(range(4, 1, -1)) # Prints [4, 3, 2] To iterate over an :ref:`Array` backwards, use: :: var array = [3, 6, 9] - var i := array.size() - 1 - while i >= 0: - print(array[i]) - i -= 1 + for i in range(array.size(), 0, -1): + print(array[i - 1]) Output: diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index d48866d61..a4d0fe286 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -1474,11 +1474,11 @@ enum **JoystickList**: - **JOY_BUTTON_MAX** = **128** --- The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms: -- Android: Up to 36 buttons. + - Android: Up to 36 buttons. -- Linux: Up to 80 buttons. + - Linux: Up to 80 buttons. -- Windows and macOS: Up to 128 buttons. + - Windows and macOS: Up to 128 buttons. - **JOY_SONY_CIRCLE** = **1** --- DualShock circle button. diff --git a/classes/class_animatedsprite.rst b/classes/class_animatedsprite.rst index 491d57406..93d170df7 100644 --- a/classes/class_animatedsprite.rst +++ b/classes/class_animatedsprite.rst @@ -11,14 +11,14 @@ AnimatedSprite **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -Sprite node that can use multiple textures for animation. +Sprite node that contains multiple textures as frames to play for animation. Description ----------- -Animations are created using a :ref:`SpriteFrames` resource, which can be configured in the editor via the SpriteFrames panel. +``AnimatedSprite`` is similar to the :ref:`Sprite` node, except it carries multiple textures as animation frames. Animations are created using a :ref:`SpriteFrames` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames` resource can be configured in the editor via the SpriteFrames bottom panel. -\ **Note:** You can associate a set of normal maps by creating additional :ref:`SpriteFrames` resources with a ``_normal`` suffix. For example, having 2 :ref:`SpriteFrames` resources ``run`` and ``run_normal`` will make it so the ``run`` animation uses the normal map. +\ **Note:** You can associate a set of normal or specular maps by creating additional :ref:`SpriteFrames` resources with a ``_normal`` or ``_specular`` suffix. For example, having 3 :ref:`SpriteFrames` resources ``run``, ``run_normal``, and ``run_specular`` will make it so the ``run`` animation uses normal and specular maps. Tutorials --------- @@ -91,7 +91,7 @@ Property Descriptions | *Getter* | get_animation() | +-----------+----------------------+ -The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset. +The current animation from the :ref:`frames` resource. If this value changes, the ``frame`` counter is reset. ---- @@ -169,7 +169,7 @@ The displayed animation frame's index. | *Getter* | get_sprite_frames() | +----------+--------------------------+ -The :ref:`SpriteFrames` resource containing the animation(s). +The :ref:`SpriteFrames` resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the :ref:`SpriteFrames` resource. ---- diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index 5030260ca..0bdd0618d 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -531,6 +531,8 @@ Renames an existing animation with key ``name`` to ``newname``. Seeks the animation to the ``seconds`` point in time (in seconds). If ``update`` is ``true``, the animation updates too, otherwise it updates at process time. Events between the current frame and ``seconds`` are skipped. +\ **Note:** Seeking to the end of the animation doesn't emit :ref:`animation_finished`. If you want to skip animation and emit the signal, use :ref:`advance`. + ---- .. _class_AnimationPlayer_method_set_blend_time: diff --git a/classes/class_array.rst b/classes/class_array.rst index 8a4280312..6f1624fef 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -313,7 +313,7 @@ Assigns the given value to all elements in the array. This can typically be used - :ref:`int` **find** **(** :ref:`Variant` what, :ref:`int` from=0 **)** -Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. ---- @@ -474,7 +474,7 @@ Resizes the array to contain a different number of elements. If the array size i - :ref:`int` **rfind** **(** :ref:`Variant` what, :ref:`int` from=-1 **)** -Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ---- diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index 172d45129..1a1bb6c08 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -195,7 +195,7 @@ Constants .. _class_ArrayMesh_constant_ARRAY_WEIGHTS_SIZE: -- **NO_INDEX_ARRAY** = **-1** --- Default value used for index_array_len when no indices are present. +- **NO_INDEX_ARRAY** = **-1** --- Value used internally when no indices are present. - **ARRAY_WEIGHTS_SIZE** = **4** --- Amount of weights/bone indices per vertex (always 4). diff --git a/classes/class_aspectratiocontainer.rst b/classes/class_aspectratiocontainer.rst index 9a676d63f..1e3115740 100644 --- a/classes/class_aspectratiocontainer.rst +++ b/classes/class_aspectratiocontainer.rst @@ -18,6 +18,11 @@ Description Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Properties ---------- diff --git a/classes/class_astar.rst b/classes/class_astar.rst index e76176429..b84dcbe74 100644 --- a/classes/class_astar.rst +++ b/classes/class_astar.rst @@ -119,7 +119,7 @@ Note that this function is hidden in the default ``AStar`` class. - void **add_point** **(** :ref:`int` id, :ref:`Vector3` position, :ref:`float` weight_scale=1.0 **)** -Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 1 or larger. +Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst index d45d7b175..b6e48805e 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -100,7 +100,7 @@ Note that this function is hidden in the default ``AStar2D`` class. - void **add_point** **(** :ref:`int` id, :ref:`Vector2` position, :ref:`float` weight_scale=1.0 **)** -Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 1 or larger. +Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. diff --git a/classes/class_basis.rst b/classes/class_basis.rst index 3b84e5137..ac424341a 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -58,7 +58,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` from **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | +| :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` x_axis, :ref:`Vector3` y_axis, :ref:`Vector3` z_axis **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -78,7 +78,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`orthonormalized` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | +| :ref:`Basis` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`scaled` **(** :ref:`Vector3` scale **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -174,9 +174,9 @@ Consider using the :ref:`Quat` constructor instead, which uses a qua ---- -- :ref:`Basis` **Basis** **(** :ref:`Vector3` axis, :ref:`float` phi **)** +- :ref:`Basis` **Basis** **(** :ref:`Vector3` axis, :ref:`float` angle **)** -Constructs a pure rotation basis matrix, rotated around the given ``axis`` by ``phi``, in radians. The axis must be a normalized vector. +Constructs a pure rotation basis matrix, rotated around the given ``axis`` by ``angle`` (in radians). The axis must be a normalized vector. ---- @@ -258,9 +258,9 @@ Returns the orthonormalized version of the matrix (useful to call from time to t .. _class_Basis_method_rotated: -- :ref:`Basis` **rotated** **(** :ref:`Vector3` axis, :ref:`float` phi **)** +- :ref:`Basis` **rotated** **(** :ref:`Vector3` axis, :ref:`float` angle **)** -Introduce an additional rotation around the given axis by phi (radians). The axis must be a normalized vector. +Introduce an additional rotation around the given axis by ``angle`` (in radians). The axis must be a normalized vector. ---- diff --git a/classes/class_boxcontainer.rst b/classes/class_boxcontainer.rst index 4290c793c..5139e9e8a 100644 --- a/classes/class_boxcontainer.rst +++ b/classes/class_boxcontainer.rst @@ -20,6 +20,11 @@ Description Arranges child controls vertically or horizontally, and rearranges the controls automatically when their minimum size changes. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Properties ---------- diff --git a/classes/class_camera.rst b/classes/class_camera.rst index 3cebdada2..56d013e0c 100644 --- a/classes/class_camera.rst +++ b/classes/class_camera.rst @@ -444,7 +444,7 @@ Returns the 3D point in world space that maps to the given 2D coordinate in the - :ref:`Vector3` **project_ray_normal** **(** :ref:`Vector2` screen_point **)** |const| -Returns a normal vector in world space, that is the result of projecting a point on the :ref:`Viewport` rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. +Returns a normal vector in world space, that is the result of projecting a point on the :ref:`Viewport` rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. ---- @@ -452,7 +452,7 @@ Returns a normal vector in world space, that is the result of projecting a point - :ref:`Vector3` **project_ray_origin** **(** :ref:`Vector2` screen_point **)** |const| -Returns a 3D position in world space, that is the result of projecting a point on the :ref:`Viewport` rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. +Returns a 3D position in world space, that is the result of projecting a point on the :ref:`Viewport` rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. ---- diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index a5a20aaed..b1d93b6fb 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -386,6 +386,10 @@ Overridable function called by the engine (if defined) to draw the canvas item. Draws a unfilled arc between the given angles. The larger the value of ``point_count``, the smoother the curve. See also :ref:`draw_circle`. +\ **Note:** Line drawing is not accelerated by batching if ``antialiased`` is ``true``. + +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. + ---- .. _class_CanvasItem_method_draw_char: @@ -402,6 +406,8 @@ Draws a string character using a custom font. Returns the advance, depending on Draws a colored, unfilled circle. See also :ref:`draw_arc`, :ref:`draw_polyline` and :ref:`draw_polygon`. +\ **Note:** Built-in antialiasing is not provided for :ref:`draw_circle`. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. + ---- .. _class_CanvasItem_method_draw_colored_polygon: @@ -410,6 +416,8 @@ Draws a colored, unfilled circle. See also :ref:`draw_arc`, a single color must be specified for the whole polygon. +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. + ---- .. _class_CanvasItem_method_draw_line: @@ -418,6 +426,10 @@ Draws a colored polygon of any amount of points, convex or concave. Unlike :ref: Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also :ref:`draw_multiline` and :ref:`draw_polyline`. +\ **Note:** Line drawing is not accelerated by batching if ``antialiased`` is ``true``. + +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. + ---- .. _class_CanvasItem_method_draw_mesh: @@ -434,7 +446,7 @@ Draws a :ref:`Mesh` in 2D, using the provided texture. See :ref:`Mes Draws multiple disconnected lines with a uniform ``color``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline` instead. -\ **Note:** ``width`` and ``antialiased`` are currently not implemented and have no effect. +\ **Note:** ``width`` and ``antialiased`` are currently not implemented and have no effect. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ---- @@ -444,7 +456,7 @@ Draws multiple disconnected lines with a uniform ``color``. When drawing large a Draws multiple disconnected lines with a uniform ``width`` and segment-by-segment coloring. Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline_colors` instead. -\ **Note:** ``width`` and ``antialiased`` are currently not implemented and have no effect. +\ **Note:** ``width`` and ``antialiased`` are currently not implemented and have no effect. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ---- @@ -462,6 +474,8 @@ Draws a :ref:`MultiMesh` in 2D with the provided texture. See : Draws a solid polygon of any amount of points, convex or concave. Unlike :ref:`draw_colored_polygon`, each point's color can be changed individually. See also :ref:`draw_polyline` and :ref:`draw_polyline_colors`. +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. + ---- .. _class_CanvasItem_method_draw_polyline: @@ -470,6 +484,8 @@ Draws a solid polygon of any amount of points, convex or concave. Unlike :ref:`d Draws interconnected line segments with a uniform ``color`` and ``width`` and optional antialiasing. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline` instead. See also :ref:`draw_polygon`. +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. + ---- .. _class_CanvasItem_method_draw_polyline_colors: @@ -478,6 +494,8 @@ Draws interconnected line segments with a uniform ``color`` and ``width`` and op Draws interconnected line segments with a uniform ``width`` and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline_colors` instead. See also :ref:`draw_polygon`. +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. + ---- .. _class_CanvasItem_method_draw_primitive: @@ -492,10 +510,12 @@ Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for - void **draw_rect** **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** -Draws a rectangle. If ``filled`` is ``true``, the rectangle will be filled with the ``color`` specified. If ``filled`` is ``false``, the rectangle will be drawn as a stroke with the ``color`` and ``width`` specified. If ``antialiased`` is ``true``, the lines will be antialiased. +Draws a rectangle. If ``filled`` is ``true``, the rectangle will be filled with the ``color`` specified. If ``filled`` is ``false``, the rectangle will be drawn as a stroke with the ``color`` and ``width`` specified. If ``antialiased`` is ``true``, the lines will attempt to perform antialiasing using OpenGL line smoothing. \ **Note:** ``width`` and ``antialiased`` are only effective if ``filled`` is ``false``. +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. + ---- .. _class_CanvasItem_method_draw_set_transform: diff --git a/classes/class_centercontainer.rst b/classes/class_centercontainer.rst index 0d459af23..3e08e9f74 100644 --- a/classes/class_centercontainer.rst +++ b/classes/class_centercontainer.rst @@ -18,6 +18,11 @@ Description CenterContainer keeps children controls centered. This container keeps all children to their minimum size, in the center. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Properties ---------- diff --git a/classes/class_collisionpolygon2d.rst b/classes/class_collisionpolygon2d.rst index 3f2d0139c..41346fc22 100644 --- a/classes/class_collisionpolygon2d.rst +++ b/classes/class_collisionpolygon2d.rst @@ -97,6 +97,8 @@ If ``true``, no collisions will be detected. If ``true``, only edges that face up, relative to ``CollisionPolygon2D``'s rotation, will collide with other objects. +\ **Note:** This property has no effect if this ``CollisionPolygon2D`` is a child of an :ref:`Area2D` node. + ---- .. _class_CollisionPolygon2D_property_one_way_collision_margin: diff --git a/classes/class_collisionshape2d.rst b/classes/class_collisionshape2d.rst index 7e51d4510..3bc047427 100644 --- a/classes/class_collisionshape2d.rst +++ b/classes/class_collisionshape2d.rst @@ -75,6 +75,8 @@ A disabled collision shape has no effect in the world. This property should be c Sets whether this collision shape should only detect collision on one side (top or bottom). +\ **Note:** This property has no effect if this ``CollisionShape2D`` is a child of an :ref:`Area2D` node. + ---- .. _class_CollisionShape2D_property_one_way_collision_margin: diff --git a/classes/class_container.rst b/classes/class_container.rst index 1d87bc79b..fac29cc99 100644 --- a/classes/class_container.rst +++ b/classes/class_container.rst @@ -22,6 +22,11 @@ Base node for containers. A ``Container`` contains other controls and automatica A Control can inherit this to create custom container classes. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Methods ------- diff --git a/classes/class_control.rst b/classes/class_control.rst index 6460516f8..d235d942a 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -433,9 +433,9 @@ enum **CursorShape**: - **CURSOR_CROSS** = **3** --- Show the system's cross mouse cursor when the user hovers the node. -- **CURSOR_WAIT** = **4** --- Show the system's wait mouse cursor, often an hourglass, when the user hovers the node. +- **CURSOR_WAIT** = **4** --- Show the system's wait mouse cursor when the user hovers the node. Often an hourglass. -- **CURSOR_BUSY** = **5** --- Show the system's busy mouse cursor when the user hovers the node. Often an hourglass. +- **CURSOR_BUSY** = **5** --- Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass. - **CURSOR_DRAG** = **6** --- Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. diff --git a/classes/class_cryptokey.rst b/classes/class_cryptokey.rst index d246722ae..29245c499 100644 --- a/classes/class_cryptokey.rst +++ b/classes/class_cryptokey.rst @@ -20,8 +20,6 @@ The CryptoKey class represents a cryptographic key. Keys can be loaded and saved They can be used to generate a self-signed :ref:`X509Certificate` via :ref:`Crypto.generate_self_signed_certificate` and as private key in :ref:`StreamPeerSSL.accept_stream` along with the appropriate certificate. -\ **Note:** Not available in HTML5 exports. - Methods ------- diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 79ab72317..df106b0b8 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -49,7 +49,7 @@ You can access a dictionary's values by referencing the appropriate key. In the :: - export(string, "White", "Yellow", "Orange") var my_color + export(String, "White", "Yellow", "Orange") var my_color var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} func _ready(): # We can't use dot syntax here as `my_color` is a variable. diff --git a/classes/class_editorfilesystem.rst b/classes/class_editorfilesystem.rst index a48083e3c..66c6b4481 100644 --- a/classes/class_editorfilesystem.rst +++ b/classes/class_editorfilesystem.rst @@ -115,7 +115,7 @@ Returns the scan progress for 0 to 1 if the FS is being scanned. - :ref:`bool` **is_scanning** **(** **)** |const| -Returns ``true`` of the filesystem is being scanned. +Returns ``true`` if the filesystem is being scanned. ---- diff --git a/classes/class_editorspinslider.rst b/classes/class_editorspinslider.rst index 301c1f5f7..6b85e3b5f 100644 --- a/classes/class_editorspinslider.rst +++ b/classes/class_editorspinslider.rst @@ -21,15 +21,17 @@ This :ref:`Control` node is used in the editor's Inspector dock t Properties ---------- -+------------------------------------------+-------------------------------------------------------------+---------------------------------------------------------------------+ -| :ref:`bool` | :ref:`flat` | ``false`` | -+------------------------------------------+-------------------------------------------------------------+---------------------------------------------------------------------+ -| :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | -+------------------------------------------+-------------------------------------------------------------+---------------------------------------------------------------------+ -| :ref:`String` | :ref:`label` | ``""`` | -+------------------------------------------+-------------------------------------------------------------+---------------------------------------------------------------------+ -| :ref:`bool` | :ref:`read_only` | ``false`` | -+------------------------------------------+-------------------------------------------------------------+---------------------------------------------------------------------+ ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`flat` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`hide_slider` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`String` | :ref:`label` | ``""`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`read_only` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ Property Descriptions --------------------- @@ -48,6 +50,22 @@ Property Descriptions ---- +.. _class_EditorSpinSlider_property_hide_slider: + +- :ref:`bool` **hide_slider** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_hide_slider(value) | ++-----------+------------------------+ +| *Getter* | is_hiding_slider() | ++-----------+------------------------+ + +If ``true``, the slider is hidden. + +---- + .. _class_EditorSpinSlider_property_label: - :ref:`String` **label** diff --git a/classes/class_environment.rst b/classes/class_environment.rst index b92318f59..228e8bcb9 100644 --- a/classes/class_environment.rst +++ b/classes/class_environment.rst @@ -312,15 +312,17 @@ enum **GlowBlendMode**: enum **ToneMapper**: -- **TONE_MAPPER_LINEAR** = **0** --- Linear tonemapper operator. Reads the linear data and passes it on unmodified. +- **TONE_MAPPER_LINEAR** = **0** --- Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. -- **TONE_MAPPER_REINHARDT** = **1** --- Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: ``color = color / (1 + color)``. +- **TONE_MAPPER_REINHARDT** = **1** --- Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: ``color = color / (1 + color)``. This avoids clipping bright highlights, but the resulting image can look a bit dull. -- **TONE_MAPPER_FILMIC** = **2** --- Filmic tonemapper operator. +- **TONE_MAPPER_FILMIC** = **2** --- Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than :ref:`TONE_MAPPER_REINHARDT`. -- **TONE_MAPPER_ACES** = **3** --- Academy Color Encoding System tonemapper operator. Performs an approximation of the ACES tonemapping curve. +- **TONE_MAPPER_ACES** = **3** --- Use the legacy Godot version of the Academy Color Encoding System tonemapper. Unlike :ref:`TONE_MAPPER_ACES_FITTED`, this version of ACES does not handle bright lighting in a physically accurate way. ACES typically has a more contrasted output compared to :ref:`TONE_MAPPER_REINHARDT` and :ref:`TONE_MAPPER_FILMIC`. -- **TONE_MAPPER_ACES_FITTED** = **4** --- High quality Academy Color Encoding System tonemapper operator that matches the industry standard. Performs a more physically accurate curve fit which better simulates how light works in the real world. The color of lights and emissive materials will become lighter as the emissive energy increases, and will eventually become white if the light is bright enough to saturate the camera sensor. +\ **Note:** This tonemapping operator will be removed in Godot 4.0 in favor of the more accurate :ref:`TONE_MAPPER_ACES_FITTED`. + +- **TONE_MAPPER_ACES_FITTED** = **4** --- Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to :ref:`TONE_MAPPER_REINHARDT` and :ref:`TONE_MAPPER_FILMIC`. ---- diff --git a/classes/class_filedialog.rst b/classes/class_filedialog.rst index 99a579c76..32c862a1f 100644 --- a/classes/class_filedialog.rst +++ b/classes/class_filedialog.rst @@ -63,23 +63,23 @@ Methods Theme Properties ---------------- -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Color` | :ref:`file_icon_modulate` | ``Color( 1, 1, 1, 1 )`` | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Color` | :ref:`files_disabled` | ``Color( 0, 0, 0, 0.7 )`` | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Color` | :ref:`folder_icon_modulate` | ``Color( 1, 1, 1, 1 )`` | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Texture` | :ref:`file` | | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Texture` | :ref:`folder` | | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Texture` | :ref:`parent_folder` | | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Texture` | :ref:`reload` | | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ -| :ref:`Texture` | :ref:`toggle_hidden` | | -+-------------------------------+--------------------------------------------------------------------------------+---------------------------+ ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`file_icon_modulate` | ``Color( 1, 1, 1, 1 )`` | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`files_disabled` | ``Color( 1, 1, 1, 0.25 )`` | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`folder_icon_modulate` | ``Color( 1, 1, 1, 1 )`` | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`file` | | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`folder` | | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`parent_folder` | | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`reload` | | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`toggle_hidden` | | ++-------------------------------+--------------------------------------------------------------------------------+----------------------------+ Signals ------- @@ -352,9 +352,9 @@ The color modulation applied to the file icon. - :ref:`Color` **files_disabled** -+-----------+---------------------------+ -| *Default* | ``Color( 0, 0, 0, 0.7 )`` | -+-----------+---------------------------+ ++-----------+----------------------------+ +| *Default* | ``Color( 1, 1, 1, 0.25 )`` | ++-----------+----------------------------+ The color tint for disabled files (when the ``FileDialog`` is used in open folder mode). diff --git a/classes/class_font.rst b/classes/class_font.rst index 887263ec7..c7889a528 100644 --- a/classes/class_font.rst +++ b/classes/class_font.rst @@ -29,29 +29,60 @@ Font contains a Unicode-compatible character set, as well as the ability to draw Methods ------- -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`String` string, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`int` clip_w=-1, :ref:`Color` outline_modulate=Color( 1, 1, 1, 1 ) **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`draw_char` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`int` char, :ref:`int` next=-1, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` outline=false **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_ascent` **(** **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_char_size` **(** :ref:`int` char, :ref:`int` next=0 **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_descent` **(** **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_height` **(** **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_string_size` **(** :ref:`String` string **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_wordwrap_string_size` **(** :ref:`String` string, :ref:`float` width **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_outline` **(** **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_distance_field_hint` **(** **)** |const| | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`update_changes` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`String` string, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`int` clip_w=-1, :ref:`Color` outline_modulate=Color( 1, 1, 1, 1 ) **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`draw_char` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`int` char, :ref:`int` next=-1, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` outline=false **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_ascent` **(** **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_char_contours` **(** :ref:`int` char, :ref:`int` next=0 **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_char_size` **(** :ref:`int` char, :ref:`int` next=0 **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_char_texture` **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_char_texture_size` **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_char_tx_offset` **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_char_tx_size` **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_char_tx_uv_rect` **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_descent` **(** **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_height` **(** **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_string_size` **(** :ref:`String` string **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_wordwrap_string_size` **(** :ref:`String` string, :ref:`float` width **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_outline` **(** **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_distance_field_hint` **(** **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_changes` **(** **)** | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Font_ContourPointTag: + +.. _class_Font_constant_CONTOUR_CURVE_TAG_ON: + +.. _class_Font_constant_CONTOUR_CURVE_TAG_OFF_CONIC: + +.. _class_Font_constant_CONTOUR_CURVE_TAG_OFF_CUBIC: + +enum **ContourPointTag**: + +- **CONTOUR_CURVE_TAG_ON** = **1** --- Contour point is on the curve. + +- **CONTOUR_CURVE_TAG_OFF_CONIC** = **0** --- Contour point isn't on the curve, but serves as a control point for a conic (quadratic) Bézier arc. + +- **CONTOUR_CURVE_TAG_OFF_CUBIC** = **2** --- Contour point isn't on the curve, but serves as a control point for a cubic Bézier arc. Method Descriptions ------------------- @@ -82,6 +113,20 @@ Returns the font ascent (number of pixels above the baseline). ---- +.. _class_Font_method_get_char_contours: + +- :ref:`Dictionary` **get_char_contours** **(** :ref:`int` char, :ref:`int` next=0 **)** |const| + +Returns outline contours of the glyph as a ``Dictionary`` with the following contents: + +\ ``points`` - :ref:`PoolVector3Array`, containing outline points. ``x`` and ``y`` are point coordinates. ``z`` is the type of the point, using the :ref:`ContourPointTag` values. + +\ ``contours`` - :ref:`PoolIntArray`, containing indices the end points of each contour. + +\ ``orientation`` - :ref:`bool`, contour orientation. If ``true``, clockwise contours must be filled. + +---- + .. _class_Font_method_get_char_size: - :ref:`Vector2` **get_char_size** **(** :ref:`int` char, :ref:`int` next=0 **)** |const| @@ -90,6 +135,46 @@ Returns the size of a character, optionally taking kerning into account if the n ---- +.. _class_Font_method_get_char_texture: + +- :ref:`RID` **get_char_texture** **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| + +Returns resource id of the cache texture containing the char. + +---- + +.. _class_Font_method_get_char_texture_size: + +- :ref:`Vector2` **get_char_texture_size** **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| + +Returns size of the cache texture containing the char. + +---- + +.. _class_Font_method_get_char_tx_offset: + +- :ref:`Vector2` **get_char_tx_offset** **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| + +Returns char offset from the baseline. + +---- + +.. _class_Font_method_get_char_tx_size: + +- :ref:`Vector2` **get_char_tx_size** **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| + +Returns size of the char. + +---- + +.. _class_Font_method_get_char_tx_uv_rect: + +- :ref:`Rect2` **get_char_tx_uv_rect** **(** :ref:`int` char, :ref:`int` next=0, :ref:`bool` outline=false **)** |const| + +Returns rectangle in the cache texture containing the char. + +---- + .. _class_Font_method_get_descent: - :ref:`float` **get_descent** **(** **)** |const| diff --git a/classes/class_geometry.rst b/classes/class_geometry.rst index ecc9810c0..13ca9d3ac 100644 --- a/classes/class_geometry.rst +++ b/classes/class_geometry.rst @@ -333,7 +333,7 @@ Returns ``true`` if ``polygon``'s vertices are ordered in clockwise order, other - :ref:`Variant` **line_intersects_line_2d** **(** :ref:`Vector2` from_a, :ref:`Vector2` dir_a, :ref:`Vector2` from_b, :ref:`Vector2` dir_b **)** -Checks if the two lines (``from_a``, ``dir_a``) and (``from_b``, ``dir_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns an empty :ref:`Variant`. +Checks if the two lines (``from_a``, ``dir_a``) and (``from_b``, ``dir_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns ``null``. \ **Note:** The lines are specified using direction vectors, not end points. @@ -436,7 +436,7 @@ Checks if the segment (``from``, ``to``) intersects the cylinder with height ``h - :ref:`Variant` **segment_intersects_segment_2d** **(** :ref:`Vector2` from_a, :ref:`Vector2` to_a, :ref:`Vector2` from_b, :ref:`Vector2` to_b **)** -Checks if the two segments (``from_a``, ``to_a``) and (``from_b``, ``to_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns an empty :ref:`Variant`. +Checks if the two segments (``from_a``, ``to_a``) and (``from_b``, ``to_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns ``null``. ---- diff --git a/classes/class_geometryinstance.rst b/classes/class_geometryinstance.rst index 0f7d9d83e..348c685e3 100644 --- a/classes/class_geometryinstance.rst +++ b/classes/class_geometryinstance.rst @@ -11,7 +11,7 @@ GeometryInstance **Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -**Inherited By:** :ref:`CPUParticles`, :ref:`CSGShape`, :ref:`ImmediateGeometry`, :ref:`MeshInstance`, :ref:`MultiMeshInstance`, :ref:`Particles`, :ref:`SpriteBase3D` +**Inherited By:** :ref:`CPUParticles`, :ref:`CSGShape`, :ref:`ImmediateGeometry`, :ref:`Label3D`, :ref:`MeshInstance`, :ref:`MultiMeshInstance`, :ref:`Particles`, :ref:`SpriteBase3D` Base node for geometry-based visual instances. diff --git a/classes/class_gradient.rst b/classes/class_gradient.rst index 5fa7d6872..c002afe3f 100644 --- a/classes/class_gradient.rst +++ b/classes/class_gradient.rst @@ -21,11 +21,13 @@ Given a set of colors, this resource will interpolate them in order. This means Properties ---------- -+---------------------------------------------+-------------------------------------------------+----------------------------------------------+ -| :ref:`PoolColorArray` | :ref:`colors` | ``PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` | -+---------------------------------------------+-------------------------------------------------+----------------------------------------------+ -| :ref:`PoolRealArray` | :ref:`offsets` | ``PoolRealArray( 0, 1 )`` | -+---------------------------------------------+-------------------------------------------------+----------------------------------------------+ ++-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+ +| :ref:`PoolColorArray` | :ref:`colors` | ``PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` | ++-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+ +| :ref:`InterpolationMode` | :ref:`interpolation_mode` | ``0`` | ++-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`offsets` | ``PoolRealArray( 0, 1 )`` | ++-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+ Methods ------- @@ -48,6 +50,25 @@ Methods | void | :ref:`set_offset` **(** :ref:`int` point, :ref:`float` offset **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +Enumerations +------------ + +.. _enum_Gradient_InterpolationMode: + +.. _class_Gradient_constant_GRADIENT_INTERPOLATE_LINEAR: + +.. _class_Gradient_constant_GRADIENT_INTERPOLATE_CONSTANT: + +.. _class_Gradient_constant_GRADIENT_INTERPOLATE_CUBIC: + +enum **InterpolationMode**: + +- **GRADIENT_INTERPOLATE_LINEAR** = **0** --- Linear interpolation. + +- **GRADIENT_INTERPOLATE_CONSTANT** = **1** --- Constant interpolation, color changes abruptly at each point and stays uniform between. This might cause visible aliasing when used for a gradient texture in some cases. + +- **GRADIENT_INTERPOLATE_CUBIC** = **2** --- Cubic interpolation. + Property Descriptions --------------------- @@ -67,6 +88,22 @@ Gradient's colors returned as a :ref:`PoolColorArray`. ---- +.. _class_Gradient_property_interpolation_mode: + +- :ref:`InterpolationMode` **interpolation_mode** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_interpolation_mode(value) | ++-----------+-------------------------------+ +| *Getter* | get_interpolation_mode() | ++-----------+-------------------------------+ + +Defines how the colors between points of the gradient are interpolated. See :ref:`InterpolationMode` for available modes. + +---- + .. _class_Gradient_property_offsets: - :ref:`PoolRealArray` **offsets** diff --git a/classes/class_graphedit.rst b/classes/class_graphedit.rst index b306750d7..5c2cbb7b2 100644 --- a/classes/class_graphedit.rst +++ b/classes/class_graphedit.rst @@ -176,9 +176,9 @@ Emitted when the user presses ``Ctrl + C``. .. _class_GraphEdit_signal_delete_nodes_request: -- **delete_nodes_request** **(** **)** +- **delete_nodes_request** **(** :ref:`Array` nodes **)** -Emitted when a GraphNode is attempted to be removed from the GraphEdit. +Emitted when a GraphNode is attempted to be removed from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button). ---- diff --git a/classes/class_gridcontainer.rst b/classes/class_gridcontainer.rst index 166b0218c..306916d37 100644 --- a/classes/class_gridcontainer.rst +++ b/classes/class_gridcontainer.rst @@ -25,6 +25,8 @@ Notice that grid layout will preserve the columns and rows for every size of the Tutorials --------- +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + - `OS Test Demo `__ Properties diff --git a/classes/class_hashingcontext.rst b/classes/class_hashingcontext.rst index 82b22a97d..ae2e9f6fc 100644 --- a/classes/class_hashingcontext.rst +++ b/classes/class_hashingcontext.rst @@ -42,8 +42,6 @@ The :ref:`HashType` enum shows the supported hashi # Print the result as hex string and array. printt(res.hex_encode(), Array(res)) -\ **Note:** Not available in HTML5 exports. - Methods ------- diff --git a/classes/class_hboxcontainer.rst b/classes/class_hboxcontainer.rst index bcb0fe99f..0fb63147b 100644 --- a/classes/class_hboxcontainer.rst +++ b/classes/class_hboxcontainer.rst @@ -20,6 +20,11 @@ Description Horizontal box container. See :ref:`BoxContainer`. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Theme Properties ---------------- diff --git a/classes/class_hsplitcontainer.rst b/classes/class_hsplitcontainer.rst index 17c46870d..ffeaad7e8 100644 --- a/classes/class_hsplitcontainer.rst +++ b/classes/class_hsplitcontainer.rst @@ -18,6 +18,11 @@ Description Horizontal split container. See :ref:`SplitContainer`. This goes from left to right. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Theme Properties ---------------- diff --git a/classes/class_httprequest.rst b/classes/class_httprequest.rst index 0a81276e9..1eecb168a 100644 --- a/classes/class_httprequest.rst +++ b/classes/class_httprequest.rst @@ -103,7 +103,7 @@ Properties +-----------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`max_redirects` | ``8`` | +-----------------------------+----------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`timeout` | ``0`` | +| :ref:`float` | :ref:`timeout` | ``0.0`` | +-----------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`use_threads` | ``false`` | +-----------------------------+----------------------------------------------------------------------------+-----------+ @@ -212,7 +212,7 @@ Property Descriptions | *Getter* | get_body_size_limit() | +-----------+----------------------------+ -Maximum allowed size for response bodies. +Maximum allowed size for response bodies (``-1`` means no limit). When only small files are expected, this can be used to prevent disallow receiving files that are too large, preventing potential denial of service attacks. ---- @@ -246,7 +246,9 @@ Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to | *Getter* | get_download_file() | +-----------+--------------------------+ -The file to download into. Will output any received file into it. +The file to download into. If set to a non-empty string, the request output will be written to the file located at the path. If a file already exists at the specified location, it will be overwritten as soon as body data begins to be received. + +\ **Note:** Folders are not automatically created when the file is created. If :ref:`download_file` points to a subfolder, it's recommended to create the necessary folders beforehand using :ref:`Directory.make_dir_recursive` to ensure the file can be written. ---- @@ -262,22 +264,24 @@ The file to download into. Will output any received file into it. | *Getter* | get_max_redirects() | +-----------+--------------------------+ -Maximum number of allowed redirects. +Maximum number of allowed redirects. This is used to prevent endless redirect loops. ---- .. _class_HTTPRequest_property_timeout: -- :ref:`int` **timeout** +- :ref:`float` **timeout** +-----------+--------------------+ -| *Default* | ``0`` | +| *Default* | ``0.0`` | +-----------+--------------------+ | *Setter* | set_timeout(value) | +-----------+--------------------+ | *Getter* | get_timeout() | +-----------+--------------------+ +If set to a value greater than ``0.0``, the HTTP request will time out after ``timeout`` seconds have passed and the request is not *completed* yet. For small HTTP requests such as REST API usage, set :ref:`timeout` to a value greater than ``0.0`` to prevent the application from getting stuck if the request fails to get a response in a timely manner. For file downloads, leave this to ``0.0`` to prevent the download from failing if it takes too much time. + ---- .. _class_HTTPRequest_property_use_threads: diff --git a/classes/class_input.rst b/classes/class_input.rst index 46fb6b5f8..5cb13da7d 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -212,9 +212,9 @@ enum **CursorShape**: - **CURSOR_CROSS** = **3** --- Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. -- **CURSOR_WAIT** = **4** --- Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. +- **CURSOR_WAIT** = **4** --- Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). -- **CURSOR_BUSY** = **5** --- Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). +- **CURSOR_BUSY** = **5** --- Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. - **CURSOR_DRAG** = **6** --- Drag cursor. Usually displayed when dragging something. diff --git a/classes/class_inputmap.rst b/classes/class_inputmap.rst index 070408431..20dac5462 100644 --- a/classes/class_inputmap.rst +++ b/classes/class_inputmap.rst @@ -139,6 +139,8 @@ If ``exact_match`` is ``false``, it ignores additional input modifiers for :ref: Returns an array of :ref:`InputEvent`\ s associated with a given action. +\ **Note:** When used in the editor (e.g. a tool script or :ref:`EditorPlugin`), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the ``input/*`` settings from :ref:`ProjectSettings`. + ---- .. _class_InputMap_method_get_actions: diff --git a/classes/class_label3d.rst b/classes/class_label3d.rst new file mode 100644 index 000000000..9a72c2e2e --- /dev/null +++ b/classes/class_label3d.rst @@ -0,0 +1,544 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Label3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Label3D: + +Label3D +======= + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Displays plain text in a 3D world. + +Description +----------- + +Label3D displays plain text in a 3D world. It gives you control over the horizontal and vertical alignment. + +Properties +---------- + ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`AlphaCutMode` | :ref:`alpha_cut` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`alpha_scissor_threshold` | ``0.5`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`autowrap` | ``false`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`BillboardMode` | :ref:`billboard` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`double_sided` | ``true`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`fixed_size` | ``false`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Font` | :ref:`font` | | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Align` | :ref:`horizontal_alignment` | ``1`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`line_spacing` | ``0.0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`modulate` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`no_depth_test` | ``false`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`outline_modulate` | ``Color( 0, 0, 0, 1 )`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`outline_render_priority` | ``-1`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`pixel_size` | ``0.01`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`render_priority` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`shaded` | ``false`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`uppercase` | ``false`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`VAlign` | :ref:`vertical_alignment` | ``1`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`width` | ``500.0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TriangleMesh` | :ref:`generate_triangle_mesh` **(** **)** |const| | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_draw_flag` **(** :ref:`DrawFlags` flag **)** |const| | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_draw_flag` **(** :ref:`DrawFlags` flag, :ref:`bool` enabled **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Label3D_DrawFlags: + +.. _class_Label3D_constant_FLAG_SHADED: + +.. _class_Label3D_constant_FLAG_DOUBLE_SIDED: + +.. _class_Label3D_constant_FLAG_DISABLE_DEPTH_TEST: + +.. _class_Label3D_constant_FLAG_FIXED_SIZE: + +.. _class_Label3D_constant_FLAG_MAX: + +enum **DrawFlags**: + +- **FLAG_SHADED** = **0** --- If set, lights in the environment affect the label. + +- **FLAG_DOUBLE_SIDED** = **1** --- If set, text can be seen from the back as well. If not, the texture is invisible when looking at it from behind. + +- **FLAG_DISABLE_DEPTH_TEST** = **2** --- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + +- **FLAG_FIXED_SIZE** = **3** --- Label is scaled by depth so that it always appears the same size on screen. + +- **FLAG_MAX** = **4** --- Represents the size of the :ref:`DrawFlags` enum. + +---- + +.. _enum_Label3D_AlphaCutMode: + +.. _class_Label3D_constant_ALPHA_CUT_DISABLED: + +.. _class_Label3D_constant_ALPHA_CUT_DISCARD: + +.. _class_Label3D_constant_ALPHA_CUT_OPAQUE_PREPASS: + +enum **AlphaCutMode**: + +- **ALPHA_CUT_DISABLED** = **0** --- This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. + +- **ALPHA_CUT_DISCARD** = **1** --- This mode only allows fully transparent or fully opaque pixels. This mode is also known as *alpha testing* or *1-bit transparency*. + +\ **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting :ref:`alpha_scissor_threshold` or using SDF font. + +\ **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + +- **ALPHA_CUT_OPAQUE_PREPASS** = **2** --- This mode draws fully opaque pixels in the depth prepass. This is slower than :ref:`ALPHA_CUT_DISABLED` or :ref:`ALPHA_CUT_DISCARD`, but it allows displaying translucent areas and smooth edges while using proper sorting. + +\ **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + +---- + +.. _enum_Label3D_Align: + +.. _class_Label3D_constant_ALIGN_LEFT: + +.. _class_Label3D_constant_ALIGN_CENTER: + +.. _class_Label3D_constant_ALIGN_RIGHT: + +.. _class_Label3D_constant_ALIGN_FILL: + +enum **Align**: + +- **ALIGN_LEFT** = **0** --- Align rows to the left (default). + +- **ALIGN_CENTER** = **1** --- Align rows centered. + +- **ALIGN_RIGHT** = **2** --- Align rows to the right. + +- **ALIGN_FILL** = **3** --- Expand row whitespaces to fit the width. + +---- + +.. _enum_Label3D_VAlign: + +.. _class_Label3D_constant_VALIGN_TOP: + +.. _class_Label3D_constant_VALIGN_CENTER: + +.. _class_Label3D_constant_VALIGN_BOTTOM: + +.. _class_Label3D_constant_VALIGN_FILL: + +enum **VAlign**: + +- **VALIGN_TOP** = **0** --- Align the whole text to the top. + +- **VALIGN_CENTER** = **1** --- Align the whole text to the center. + +- **VALIGN_BOTTOM** = **2** --- Align the whole text to the bottom. + +- **VALIGN_FILL** = **3** --- Align the whole text by spreading the rows. + +Property Descriptions +--------------------- + +.. _class_Label3D_property_alpha_cut: + +- :ref:`AlphaCutMode` **alpha_cut** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_alpha_cut_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_alpha_cut_mode() | ++-----------+---------------------------+ + +The alpha cutting mode to use for the sprite. See :ref:`AlphaCutMode` for possible values. + +---- + +.. _class_Label3D_property_alpha_scissor_threshold: + +- :ref:`float` **alpha_scissor_threshold** + ++-----------+------------------------------------+ +| *Default* | ``0.5`` | ++-----------+------------------------------------+ +| *Setter* | set_alpha_scissor_threshold(value) | ++-----------+------------------------------------+ +| *Getter* | get_alpha_scissor_threshold() | ++-----------+------------------------------------+ + +Threshold at which the alpha scissor will discard values. + +---- + +.. _class_Label3D_property_autowrap: + +- :ref:`bool` **autowrap** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_autowrap(value) | ++-----------+---------------------+ +| *Getter* | get_autowrap() | ++-----------+---------------------+ + +If ``true``, wraps the text to the :ref:`width`. + +---- + +.. _class_Label3D_property_billboard: + +- :ref:`BillboardMode` **billboard** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_billboard_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_billboard_mode() | ++-----------+---------------------------+ + +The billboard mode to use for the label. See :ref:`BillboardMode` for possible values. + +---- + +.. _class_Label3D_property_double_sided: + +- :ref:`bool` **double_sided** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, text can be seen from the back as well, if ``false``, it is invisible when looking at it from behind. + +---- + +.. _class_Label3D_property_fixed_size: + +- :ref:`bool` **fixed_size** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, the label is rendered at the same size regardless of distance. + +---- + +.. _class_Label3D_property_font: + +- :ref:`Font` **font** + ++----------+-----------------+ +| *Setter* | set_font(value) | ++----------+-----------------+ +| *Getter* | get_font() | ++----------+-----------------+ + +:ref:`Font` used for the ``Label3D``'s text. + +---- + +.. _class_Label3D_property_horizontal_alignment: + +- :ref:`Align` **horizontal_alignment** + ++-----------+---------------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------------+ +| *Setter* | set_horizontal_alignment(value) | ++-----------+---------------------------------+ +| *Getter* | get_horizontal_alignment() | ++-----------+---------------------------------+ + +Controls the text's horizontal alignment. Supports left, center, right. Set it to one of the :ref:`Align` constants. + +---- + +.. _class_Label3D_property_line_spacing: + +- :ref:`float` **line_spacing** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_line_spacing(value) | ++-----------+-------------------------+ +| *Getter* | get_line_spacing() | ++-----------+-------------------------+ + +Vertical space between lines in multiline ``Label3D``. + +---- + +.. _class_Label3D_property_modulate: + +- :ref:`Color` **modulate** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_modulate(value) | ++-----------+-------------------------+ +| *Getter* | get_modulate() | ++-----------+-------------------------+ + +Text :ref:`Color` of the ``Label3D``. + +---- + +.. _class_Label3D_property_no_depth_test: + +- :ref:`bool` **no_depth_test** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, depth testing is disabled and the object will be drawn in render order. + +---- + +.. _class_Label3D_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The text drawing offset (in pixels). + +---- + +.. _class_Label3D_property_outline_modulate: + +- :ref:`Color` **outline_modulate** + ++-----------+-----------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-----------------------------+ +| *Setter* | set_outline_modulate(value) | ++-----------+-----------------------------+ +| *Getter* | get_outline_modulate() | ++-----------+-----------------------------+ + +The tint of :ref:`Font`'s outline. + +---- + +.. _class_Label3D_property_outline_render_priority: + +- :ref:`int` **outline_render_priority** + ++-----------+------------------------------------+ +| *Default* | ``-1`` | ++-----------+------------------------------------+ +| *Setter* | set_outline_render_priority(value) | ++-----------+------------------------------------+ +| *Getter* | get_outline_render_priority() | ++-----------+------------------------------------+ + +Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. + +\ **Node:** This only applies if :ref:`alpha_cut` is set to :ref:`ALPHA_CUT_DISABLED` (default value). + +\ **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + +---- + +.. _class_Label3D_property_pixel_size: + +- :ref:`float` **pixel_size** + ++-----------+-----------------------+ +| *Default* | ``0.01`` | ++-----------+-----------------------+ +| *Setter* | set_pixel_size(value) | ++-----------+-----------------------+ +| *Getter* | get_pixel_size() | ++-----------+-----------------------+ + +The size of one pixel's width on the label to scale it in 3D. + +---- + +.. _class_Label3D_property_render_priority: + +- :ref:`int` **render_priority** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_render_priority(value) | ++-----------+----------------------------+ +| *Getter* | get_render_priority() | ++-----------+----------------------------+ + +Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. + +\ **Node:** This only applies if :ref:`alpha_cut` is set to :ref:`ALPHA_CUT_DISABLED` (default value). + +\ **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + +---- + +.. _class_Label3D_property_shaded: + +- :ref:`bool` **shaded** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, the :ref:`Light` in the :ref:`Environment` has effects on the label. + +---- + +.. _class_Label3D_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +The text to display on screen. + +---- + +.. _class_Label3D_property_uppercase: + +- :ref:`bool` **uppercase** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_uppercase(value) | ++-----------+----------------------+ +| *Getter* | is_uppercase() | ++-----------+----------------------+ + +If ``true``, all the text displays as UPPERCASE. + +---- + +.. _class_Label3D_property_vertical_alignment: + +- :ref:`VAlign` **vertical_alignment** + ++-----------+-------------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------------+ +| *Setter* | set_vertical_alignment(value) | ++-----------+-------------------------------+ +| *Getter* | get_vertical_alignment() | ++-----------+-------------------------------+ + +Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the :ref:`VAlign` constants. + +---- + +.. _class_Label3D_property_width: + +- :ref:`float` **width** + ++-----------+------------------+ +| *Default* | ``500.0`` | ++-----------+------------------+ +| *Setter* | set_width(value) | ++-----------+------------------+ +| *Getter* | get_width() | ++-----------+------------------+ + +Text width (in pixels), used for autowrap and fill alignment. + +Method Descriptions +------------------- + +.. _class_Label3D_method_generate_triangle_mesh: + +- :ref:`TriangleMesh` **generate_triangle_mesh** **(** **)** |const| + +Returns a :ref:`TriangleMesh` with the label's vertices following its current configuration (such as its :ref:`pixel_size`). + +---- + +.. _class_Label3D_method_get_draw_flag: + +- :ref:`bool` **get_draw_flag** **(** :ref:`DrawFlags` flag **)** |const| + +Returns the value of the specified flag. + +---- + +.. _class_Label3D_method_set_draw_flag: + +- void **set_draw_flag** **(** :ref:`DrawFlags` flag, :ref:`bool` enabled **)** + +If ``true``, the specified flag will be enabled. See :ref:`DrawFlags` for a list of flags. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_line2d.rst b/classes/class_line2d.rst index 66f979d77..5c8554c50 100644 --- a/classes/class_line2d.rst +++ b/classes/class_line2d.rst @@ -16,7 +16,7 @@ A 2D line. Description ----------- -A line through several points in 2D space. +A line through several points in 2D space. Supports varying width and color over the line's length, texturing, and several cap/joint types. \ **Note:** By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase :ref:`ProjectSettings.rendering/limits/buffers/canvas_polygon_buffer_size_kb` and :ref:`ProjectSettings.rendering/limits/buffers/canvas_polygon_index_buffer_size_kb`. @@ -145,9 +145,11 @@ Property Descriptions | *Getter* | get_antialiased() | +-----------+------------------------+ -If ``true``, the line's border will be anti-aliased. +If ``true``, the line's border will attempt to perform antialiasing by drawing thin OpenGL smooth lines on the line's edges. -\ **Note:** Line2D is not accelerated by batching when being anti-aliased. +\ **Note:** Line2D is not accelerated by batching if :ref:`antialiased` is ``true``. + +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ---- diff --git a/classes/class_margincontainer.rst b/classes/class_margincontainer.rst index bf65544a3..17ab040ce 100644 --- a/classes/class_margincontainer.rst +++ b/classes/class_margincontainer.rst @@ -29,6 +29,11 @@ Adds a top, left, bottom, and right margin to all :ref:`Control` add_constant_override("margin_bottom", margin_value) add_constant_override("margin_right", margin_value) +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Theme Properties ---------------- diff --git a/classes/class_navigation2dserver.rst b/classes/class_navigation2dserver.rst index 979f6a35f..1bbc1dfc6 100644 --- a/classes/class_navigation2dserver.rst +++ b/classes/class_navigation2dserver.rst @@ -37,6 +37,8 @@ Methods +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`agent_create` **(** **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`agent_get_map` **(** :ref:`RID` agent **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed` **(** :ref:`RID` agent **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`agent_set_callback` **(** :ref:`RID` agent, :ref:`Object` receiver, :ref:`String` method, :ref:`Variant` userdata=null **)** |const| | @@ -63,6 +65,8 @@ Methods +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`map_create` **(** **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`map_get_agents` **(** :ref:`RID` map **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_cell_size` **(** :ref:`RID` map **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`map_get_closest_point` **(** :ref:`RID` map, :ref:`Vector2` to_point **)** |const| | @@ -73,6 +77,8 @@ Methods +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolVector2Array` | :ref:`map_get_path` **(** :ref:`RID` map, :ref:`Vector2` origin, :ref:`Vector2` destination, :ref:`bool` optimize **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`map_get_regions` **(** :ref:`RID` map **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active` **(** :ref:`RID` nap **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`map_set_active` **(** :ref:`RID` map, :ref:`bool` active **)** |const| | @@ -83,6 +89,8 @@ Methods +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_create` **(** **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`region_get_map` **(** :ref:`RID` region **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_map` **(** :ref:`RID` region, :ref:`RID` map **)** |const| | +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_navpoly` **(** :ref:`RID` region, :ref:`NavigationPolygon` nav_poly **)** |const| | @@ -101,6 +109,14 @@ Creates the agent. ---- +.. _class_Navigation2DServer_method_agent_get_map: + +- :ref:`RID` **agent_get_map** **(** :ref:`RID` agent **)** |const| + +Returns the navigation map :ref:`RID` the requested ``agent`` is currently assigned to. + +---- + .. _class_Navigation2DServer_method_agent_is_map_changed: - :ref:`bool` **agent_is_map_changed** **(** :ref:`RID` agent **)** |const| @@ -205,6 +221,14 @@ Create a new map. ---- +.. _class_Navigation2DServer_method_map_get_agents: + +- :ref:`Array` **map_get_agents** **(** :ref:`RID` map **)** |const| + +Returns all navigation agents :ref:`RID`\ s that are currently assigned to the requested navigation ``map``. + +---- + .. _class_Navigation2DServer_method_map_get_cell_size: - :ref:`float` **map_get_cell_size** **(** :ref:`RID` map **)** |const| @@ -245,6 +269,14 @@ Returns the navigation path to reach the destination from the origin. ---- +.. _class_Navigation2DServer_method_map_get_regions: + +- :ref:`Array` **map_get_regions** **(** :ref:`RID` map **)** |const| + +Returns all navigation regions :ref:`RID`\ s that are currently assigned to the requested navigation ``map``. + +---- + .. _class_Navigation2DServer_method_map_is_active: - :ref:`bool` **map_is_active** **(** :ref:`RID` nap **)** |const| @@ -285,6 +317,14 @@ Creates a new region. ---- +.. _class_Navigation2DServer_method_region_get_map: + +- :ref:`RID` **region_get_map** **(** :ref:`RID` region **)** |const| + +Returns the navigation map :ref:`RID` the requested ``region`` is currently assigned to. + +---- + .. _class_Navigation2DServer_method_region_set_map: - void **region_set_map** **(** :ref:`RID` region, :ref:`RID` map **)** |const| diff --git a/classes/class_navigationagent.rst b/classes/class_navigationagent.rst index 754b8cc8e..f727eb585 100644 --- a/classes/class_navigationagent.rst +++ b/classes/class_navigationagent.rst @@ -21,25 +21,27 @@ Description Properties ---------- -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`agent_height_offset` | ``0.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`bool` | :ref:`ignore_y` | ``true`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`int` | :ref:`max_neighbors` | ``10`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`max_speed` | ``10.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`neighbor_dist` | ``50.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`path_max_distance` | ``3.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`radius` | ``1.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`target_desired_distance` | ``1.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ -| :ref:`float` | :ref:`time_horizon` | ``5.0`` | -+---------------------------+----------------------------------------------------------------------------------------+----------+ ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`agent_height_offset` | ``0.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`avoidance_enabled` | ``false`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`ignore_y` | ``true`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`max_neighbors` | ``10`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`max_speed` | ``10.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`neighbor_dist` | ``50.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`path_max_distance` | ``3.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`target_desired_distance` | ``1.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`time_horizon` | ``5.0`` | ++---------------------------+----------------------------------------------------------------------------------------+-----------+ Methods ------- @@ -126,6 +128,22 @@ The agent height offset to match the navigation mesh height. ---- +.. _class_NavigationAgent_property_avoidance_enabled: + +- :ref:`bool` **avoidance_enabled** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_avoidance_enabled(value) | ++-----------+------------------------------+ +| *Getter* | get_avoidance_enabled() | ++-----------+------------------------------+ + +If ``true`` the agent is registered for an RVO avoidance callback on the :ref:`NavigationServer`. When :ref:`set_velocity` is used and the processing is completed a ``safe_velocity`` Vector3 is received with a signal connection to :ref:`velocity_computed`. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. + +---- + .. _class_NavigationAgent_property_ignore_y: - :ref:`bool` **ignore_y** @@ -307,7 +325,7 @@ Returns a :ref:`Vector3` in global coordinates, that can be moved - :ref:`RID` **get_rid** **(** **)** |const| -Returns the object's :ref:`RID`. +Returns the :ref:`RID` of this agent on the :ref:`NavigationServer`. ---- diff --git a/classes/class_navigationagent2d.rst b/classes/class_navigationagent2d.rst index 6c959073f..eeb1c3d79 100644 --- a/classes/class_navigationagent2d.rst +++ b/classes/class_navigationagent2d.rst @@ -21,6 +21,8 @@ Description Properties ---------- ++---------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`avoidance_enabled` | ``false`` | +---------------------------+------------------------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`max_neighbors` | ``10`` | +---------------------------+------------------------------------------------------------------------------------------+-----------+ @@ -106,6 +108,22 @@ Notifies when the collision avoidance velocity is calculated after a call to :re Property Descriptions --------------------- +.. _class_NavigationAgent2D_property_avoidance_enabled: + +- :ref:`bool` **avoidance_enabled** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_avoidance_enabled(value) | ++-----------+------------------------------+ +| *Getter* | get_avoidance_enabled() | ++-----------+------------------------------+ + +If ``true`` the agent is registered for an RVO avoidance callback on the :ref:`Navigation2DServer`. When :ref:`set_velocity` is used and the processing is completed a ``safe_velocity`` Vector2 is received with a signal connection to :ref:`velocity_computed`. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. + +---- + .. _class_NavigationAgent2D_property_max_neighbors: - :ref:`int` **max_neighbors** @@ -271,7 +289,7 @@ Returns a :ref:`Vector2` in global coordinates, that can be moved - :ref:`RID` **get_rid** **(** **)** |const| -Returns the object's :ref:`RID`. +Returns the :ref:`RID` of this agent on the :ref:`Navigation2DServer`. ---- diff --git a/classes/class_navigationmesh.rst b/classes/class_navigationmesh.rst index 4ea7f0e73..1fe87c953 100644 --- a/classes/class_navigationmesh.rst +++ b/classes/class_navigationmesh.rst @@ -27,17 +27,17 @@ Properties ---------- +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`agent/height` | ``2.0`` | +| :ref:`float` | :ref:`agent/height` | ``1.5`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`agent/max_climb` | ``0.9`` | +| :ref:`float` | :ref:`agent/max_climb` | ``0.25`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`agent/max_slope` | ``45.0`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`agent/radius` | ``0.6`` | +| :ref:`float` | :ref:`agent/radius` | ``0.5`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`cell/height` | ``0.2`` | +| :ref:`float` | :ref:`cell/height` | ``0.25`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`cell/size` | ``0.3`` | +| :ref:`float` | :ref:`cell/size` | ``0.25`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`detail/sample_distance` | ``6.0`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ @@ -65,7 +65,7 @@ Properties +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`region/merge_size` | ``20.0`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`region/min_size` | ``8.0`` | +| :ref:`float` | :ref:`region/min_size` | ``2.0`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ | :ref:`SamplePartitionType` | :ref:`sample_partition_type/sample_partition_type` | ``0`` | +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ @@ -168,7 +168,7 @@ Property Descriptions - :ref:`float` **agent/height** +-----------+-------------------------+ -| *Default* | ``2.0`` | +| *Default* | ``1.5`` | +-----------+-------------------------+ | *Setter* | set_agent_height(value) | +-----------+-------------------------+ @@ -186,7 +186,7 @@ The minimum floor to ceiling height that will still allow the floor area to be c - :ref:`float` **agent/max_climb** +-----------+----------------------------+ -| *Default* | ``0.9`` | +| *Default* | ``0.25`` | +-----------+----------------------------+ | *Setter* | set_agent_max_climb(value) | +-----------+----------------------------+ @@ -220,7 +220,7 @@ The maximum slope that is considered walkable, in degrees. - :ref:`float` **agent/radius** +-----------+-------------------------+ -| *Default* | ``0.6`` | +| *Default* | ``0.5`` | +-----------+-------------------------+ | *Setter* | set_agent_radius(value) | +-----------+-------------------------+ @@ -238,7 +238,7 @@ The distance to erode/shrink the walkable area of the heightfield away from obst - :ref:`float` **cell/height** +-----------+------------------------+ -| *Default* | ``0.2`` | +| *Default* | ``0.25`` | +-----------+------------------------+ | *Setter* | set_cell_height(value) | +-----------+------------------------+ @@ -254,7 +254,7 @@ The Y axis cell size to use for fields. - :ref:`float` **cell/size** +-----------+----------------------+ -| *Default* | ``0.3`` | +| *Default* | ``0.25`` | +-----------+----------------------+ | *Setter* | set_cell_size(value) | +-----------+----------------------+ @@ -482,7 +482,7 @@ Any regions with a size smaller than this will be merged with larger regions if - :ref:`float` **region/min_size** +-----------+----------------------------+ -| *Default* | ``8.0`` | +| *Default* | ``2.0`` | +-----------+----------------------------+ | *Setter* | set_region_min_size(value) | +-----------+----------------------------+ diff --git a/classes/class_navigationmeshgenerator.rst b/classes/class_navigationmeshgenerator.rst index 62c851fa3..3432dedb6 100644 --- a/classes/class_navigationmeshgenerator.rst +++ b/classes/class_navigationmeshgenerator.rst @@ -11,12 +11,18 @@ NavigationMeshGenerator **Inherits:** :ref:`Object` -This class is responsible for creating and clearing navigation meshes. +Helper class for creating and clearing navigation meshes. Description ----------- -This class is responsible for creating and clearing navigation meshes. +This class is responsible for creating and clearing 3D navigation meshes used as :ref:`NavigationMesh` resources inside :ref:`NavigationMeshInstance`. The ``NavigationMeshGenerator`` has very limited to no use for 2D as the navigation mesh baking process expects 3D node types and 3D source geometry to parse. + +The entire navigation mesh baking is best done in a separate thread as the voxelization, collision tests and mesh optimization steps involved are very performance and time hungry operations. + +Navigation mesh baking happens in multiple steps and the result depends on 3D source geometry and properties of the :ref:`NavigationMesh` resource. In the first step, starting from a root node and depending on :ref:`NavigationMesh` properties all valid 3D source geometry nodes are collected from the :ref:`SceneTree`. Second, all collected nodes are parsed for their relevant 3D geometry data and a combined 3D mesh is build. Due to the many different types of parsable objects, from normal :ref:`MeshInstance`\ s to :ref:`CSGShape`\ s or various :ref:`CollisionObject`\ s, some operations to collect geometry data can trigger :ref:`VisualServer` and :ref:`PhysicsServer` synchronizations. Server synchronization can have a negative effect on baking time or framerate as it often involves :ref:`Mutex` locking for thread security. Many parsable objects and the continuous synchronization with other threaded Servers can increase the baking time significantly. On the other hand only a few but very large and complex objects will take some time to prepare for the Servers which can noticeably stall the next frame render. As a general rule the total amount of parsable objects and their individual size and complexity should be balanced to avoid framerate issues or very long baking times. The combined mesh is then passed to the Recast Navigation Object to test the source geometry for walkable terrain suitable to :ref:`NavigationMesh` agent properties by creating a voxel world around the meshes bounding area. + +The finalized navigation mesh is then returned and stored inside the :ref:`NavigationMesh` for use as a resource inside :ref:`NavigationMeshInstance` nodes. Methods ------- @@ -34,7 +40,7 @@ Method Descriptions - void **bake** **(** :ref:`NavigationMesh` nav_mesh, :ref:`Node` root_node **)** -Bakes the navigation mesh. This will allow you to use pathfinding with the navigation system. +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. ---- @@ -42,7 +48,7 @@ Bakes the navigation mesh. This will allow you to use pathfinding with the navig - void **clear** **(** :ref:`NavigationMesh` nav_mesh **)** -Clears the navigation mesh. +Removes all polygons and vertices from the provided ``nav_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_navigationmeshinstance.rst b/classes/class_navigationmeshinstance.rst index e81d6ee8b..388982536 100644 --- a/classes/class_navigationmeshinstance.rst +++ b/classes/class_navigationmeshinstance.rst @@ -30,9 +30,11 @@ Properties Methods ------- -+------+---------------------------------------------------------------------------------------------------+ -| void | :ref:`bake_navigation_mesh` **(** **)** | -+------+---------------------------------------------------------------------------------------------------+ ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bake_navigation_mesh` **(** :ref:`bool` on_thread=true **)** | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_region_rid` **(** **)** |const| | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- @@ -87,9 +89,17 @@ Method Descriptions .. _class_NavigationMeshInstance_method_bake_navigation_mesh: -- void **bake_navigation_mesh** **(** **)** +- void **bake_navigation_mesh** **(** :ref:`bool` on_thread=true **)** -Bakes the :ref:`NavigationMesh`. The baking is done in a separate thread because navigation baking is not a cheap operation. This can be done at runtime. When it is completed, it automatically sets the new :ref:`NavigationMesh`. +Bakes the :ref:`NavigationMesh`. If ``on_thread`` is set to ``true`` (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new :ref:`NavigationMesh`. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as HTML5 with threads disabled). + +---- + +.. _class_NavigationMeshInstance_method_get_region_rid: + +- :ref:`RID` **get_region_rid** **(** **)** |const| + +Returns the :ref:`RID` of this region on the :ref:`NavigationServer`. Combined with :ref:`NavigationServer.map_get_closest_point_owner` can be used to identify the ``NavigationMeshInstance`` closest to a point on the merged navigation map. .. |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_navigationobstacle.rst b/classes/class_navigationobstacle.rst index 11cbd9fb2..d8471c9d8 100644 --- a/classes/class_navigationobstacle.rst +++ b/classes/class_navigationobstacle.rst @@ -33,6 +33,8 @@ Methods +-------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`Node` | :ref:`get_navigation` **(** **)** |const| | +-------------------------+----------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_rid` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation` **(** :ref:`Node` navigation **)** | +-------------------------+----------------------------------------------------------------------------------------------------------------------+ @@ -80,6 +82,14 @@ Returns the :ref:`Navigation` node that the obstacle is using ---- +.. _class_NavigationObstacle_method_get_rid: + +- :ref:`RID` **get_rid** **(** **)** |const| + +Returns the :ref:`RID` of this obstacle on the :ref:`NavigationServer`. + +---- + .. _class_NavigationObstacle_method_set_navigation: - void **set_navigation** **(** :ref:`Node` navigation **)** diff --git a/classes/class_navigationobstacle2d.rst b/classes/class_navigationobstacle2d.rst index 908353757..55af446d5 100644 --- a/classes/class_navigationobstacle2d.rst +++ b/classes/class_navigationobstacle2d.rst @@ -33,6 +33,8 @@ Methods +-------------------------+------------------------------------------------------------------------------------------------------------------------+ | :ref:`Node` | :ref:`get_navigation` **(** **)** |const| | +-------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_rid` **(** **)** |const| | ++-------------------------+------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation` **(** :ref:`Node` navigation **)** | +-------------------------+------------------------------------------------------------------------------------------------------------------------+ @@ -80,6 +82,14 @@ Returns the :ref:`Navigation2D` node that the obstacle is us ---- +.. _class_NavigationObstacle2D_method_get_rid: + +- :ref:`RID` **get_rid** **(** **)** |const| + +Returns the :ref:`RID` of this obstacle on the :ref:`Navigation2DServer`. + +---- + .. _class_NavigationObstacle2D_method_set_navigation: - void **set_navigation** **(** :ref:`Node` navigation **)** diff --git a/classes/class_navigationpolygoninstance.rst b/classes/class_navigationpolygoninstance.rst index 2987d0211..752f937a4 100644 --- a/classes/class_navigationpolygoninstance.rst +++ b/classes/class_navigationpolygoninstance.rst @@ -22,6 +22,13 @@ Properties | :ref:`NavigationPolygon` | :ref:`navpoly` | | +---------------------------------------------------+------------------------------------------------------------------+----------+ +Methods +------- + ++-----------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_region_rid` **(** **)** |const| | ++-----------------------+--------------------------------------------------------------------------------------------------+ + Property Descriptions --------------------- @@ -49,6 +56,15 @@ Property Descriptions | *Getter* | get_navigation_polygon() | +----------+-------------------------------+ +Method Descriptions +------------------- + +.. _class_NavigationPolygonInstance_method_get_region_rid: + +- :ref:`RID` **get_region_rid** **(** **)** |const| + +Returns the :ref:`RID` of this region on the :ref:`Navigation2DServer`. Combined with :ref:`Navigation2DServer.map_get_closest_point_owner` can be used to identify the ``NavigationPolygonInstance`` closest to a point on the merged navigation map. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_navigationserver.rst b/classes/class_navigationserver.rst index 76970e64b..c287adce6 100644 --- a/classes/class_navigationserver.rst +++ b/classes/class_navigationserver.rst @@ -37,6 +37,8 @@ Methods +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`agent_create` **(** **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`agent_get_map` **(** :ref:`RID` agent **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed` **(** :ref:`RID` agent **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`agent_set_callback` **(** :ref:`RID` agent, :ref:`Object` receiver, :ref:`String` method, :ref:`Variant` userdata=null **)** |const| | @@ -63,6 +65,8 @@ Methods +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`map_create` **(** **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`map_get_agents` **(** :ref:`RID` map **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_cell_height` **(** :ref:`RID` map **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_cell_size` **(** :ref:`RID` map **)** |const| | @@ -79,6 +83,8 @@ Methods +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolVector3Array` | :ref:`map_get_path` **(** :ref:`RID` map, :ref:`Vector3` origin, :ref:`Vector3` destination, :ref:`bool` optimize **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`map_get_regions` **(** :ref:`RID` map **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_up` **(** :ref:`RID` map **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active` **(** :ref:`RID` nap **)** |const| | @@ -99,6 +105,8 @@ Methods +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_create` **(** **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`region_get_map` **(** :ref:`RID` region **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_map` **(** :ref:`RID` region, :ref:`RID` map **)** |const| | +-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`region_set_navmesh` **(** :ref:`RID` region, :ref:`NavigationMesh` nav_mesh **)** |const| | @@ -119,6 +127,14 @@ Creates the agent. ---- +.. _class_NavigationServer_method_agent_get_map: + +- :ref:`RID` **agent_get_map** **(** :ref:`RID` agent **)** |const| + +Returns the navigation map :ref:`RID` the requested ``agent`` is currently assigned to. + +---- + .. _class_NavigationServer_method_agent_is_map_changed: - :ref:`bool` **agent_is_map_changed** **(** :ref:`RID` agent **)** |const| @@ -223,6 +239,14 @@ Create a new map. ---- +.. _class_NavigationServer_method_map_get_agents: + +- :ref:`Array` **map_get_agents** **(** :ref:`RID` map **)** |const| + +Returns all navigation agents :ref:`RID`\ s that are currently assigned to the requested navigation ``map``. + +---- + .. _class_NavigationServer_method_map_get_cell_height: - :ref:`float` **map_get_cell_height** **(** :ref:`RID` map **)** |const| @@ -287,6 +311,14 @@ Returns the navigation path to reach the destination from the origin. ---- +.. _class_NavigationServer_method_map_get_regions: + +- :ref:`Array` **map_get_regions** **(** :ref:`RID` map **)** |const| + +Returns all navigation regions :ref:`RID`\ s that are currently assigned to the requested navigation ``map``. + +---- + .. _class_NavigationServer_method_map_get_up: - :ref:`Vector3` **map_get_up** **(** :ref:`RID` map **)** |const| @@ -371,6 +403,14 @@ Creates a new region. ---- +.. _class_NavigationServer_method_region_get_map: + +- :ref:`RID` **region_get_map** **(** :ref:`RID` region **)** |const| + +Returns the navigation map :ref:`RID` the requested ``region`` is currently assigned to. + +---- + .. _class_NavigationServer_method_region_set_map: - void **region_set_map** **(** :ref:`RID` region, :ref:`RID` map **)** |const| diff --git a/classes/class_networkedmultiplayerenet.rst b/classes/class_networkedmultiplayerenet.rst index 8f662324a..5d8443a95 100644 --- a/classes/class_networkedmultiplayerenet.rst +++ b/classes/class_networkedmultiplayerenet.rst @@ -195,7 +195,7 @@ When set to an empty string, the ``address`` parameter passed to :ref:`create_cl | *Getter* | is_dtls_verify_enabled() | +-----------+--------------------------------+ -Enable or disable certificate verification when :ref:`use_dtls` ``true``. +Enable or disable certificate verification when :ref:`use_dtls` is ``true``. ---- diff --git a/classes/class_node.rst b/classes/class_node.rst index 21f9a81a5..9ecaf5f01 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -1160,7 +1160,7 @@ Returns ``true`` if the local system is the master of this node. Returns ``true`` if the physics interpolated flag is set for this Node (see :ref:`physics_interpolation_mode`). -\ **Note:** Interpolation will only be active is both the flag is set **and** physics interpolation is enabled within the :ref:`SceneTree`. This can be tested using :ref:`is_physics_interpolated_and_enabled`. +\ **Note:** Interpolation will only be active if both the flag is set **and** physics interpolation is enabled within the :ref:`SceneTree`. This can be tested using :ref:`is_physics_interpolated_and_enabled`. ---- @@ -1384,7 +1384,7 @@ This glitch can be prevented by calling ``reset_physics_interpolation``, which t - :ref:`Variant` **rpc** **(** :ref:`String` method, ... **)** |vararg| -Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same :ref:`NodePath`, including the exact same node name. Behaviour depends on the RPC configuration for the given method, see :ref:`rpc_config`. Methods are not exposed to RPCs by default. See also :ref:`rset` and :ref:`rset_config` for properties. Returns an empty :ref:`Variant`. +Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same :ref:`NodePath`, including the exact same node name. Behaviour depends on the RPC configuration for the given method, see :ref:`rpc_config`. Methods are not exposed to RPCs by default. See also :ref:`rset` and :ref:`rset_config` for properties. Returns ``null``. \ **Note:** You can only safely use RPCs on clients after you received the ``connected_to_server`` signal from the :ref:`SceneTree`. You also need to keep track of the connection state, either by the :ref:`SceneTree` signals like ``server_disconnected`` or by checking ``SceneTree.network_peer.get_connection_status() == CONNECTION_CONNECTED``. @@ -1402,7 +1402,7 @@ Changes the RPC mode for the given ``method`` to the given ``mode``. See :ref:`R - :ref:`Variant` **rpc_id** **(** :ref:`int` peer_id, :ref:`String` method, ... **)** |vararg| -Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Returns an empty :ref:`Variant`. +Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Returns ``null``. ---- @@ -1410,7 +1410,7 @@ Sends a :ref:`rpc` to a specific peer identified by ``pee - :ref:`Variant` **rpc_unreliable** **(** :ref:`String` method, ... **)** |vararg| -Sends a :ref:`rpc` using an unreliable protocol. Returns an empty :ref:`Variant`. +Sends a :ref:`rpc` using an unreliable protocol. Returns ``null``. ---- @@ -1418,7 +1418,7 @@ Sends a :ref:`rpc` using an unreliable protocol. Returns - :ref:`Variant` **rpc_unreliable_id** **(** :ref:`int` peer_id, :ref:`String` method, ... **)** |vararg| -Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` using an unreliable protocol (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Returns an empty :ref:`Variant`. +Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` using an unreliable protocol (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Returns ``null``. ---- diff --git a/classes/class_object.rst b/classes/class_object.rst index a3efa6f56..a965e41df 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -316,7 +316,7 @@ Returns ``true`` if the object can translate strings. See :ref:`set_message_tran Connects a ``signal`` to a ``method`` on a ``target`` object. Pass optional ``binds`` to the call as an :ref:`Array` of parameters. These parameters will be passed to the method after any parameter used in the call to :ref:`emit_signal`. Use ``flags`` to set deferred or one-shot connections. See :ref:`ConnectFlags` constants. -A ``signal`` can only be connected once to a ``method``. It will throw an error if already connected, unless the signal was connected with :ref:`CONNECT_REFERENCE_COUNTED`. To avoid this, first, use :ref:`is_connected` to check for existing connections. +A ``signal`` can only be connected once to a ``method``. It will print an error if already connected, unless the signal was connected with :ref:`CONNECT_REFERENCE_COUNTED`. To avoid this, first, use :ref:`is_connected` to check for existing connections. If the ``target`` is destroyed in the game's lifecycle, the connection will be lost. @@ -345,7 +345,7 @@ An example of the relationship between ``binds`` passed to :ref:`connect` to ensure that the connection exists. +If you try to disconnect a connection that does not exist, the method will print an error. Use :ref:`is_connected` to ensure that the connection exists. ---- diff --git a/classes/class_optionbutton.rst b/classes/class_optionbutton.rst index 01b75137b..001386363 100644 --- a/classes/class_optionbutton.rst +++ b/classes/class_optionbutton.rst @@ -254,7 +254,7 @@ Returns the :ref:`PopupMenu` contained in this button. - :ref:`int` **get_selected_id** **(** **)** |const| -Returns the ID of the selected item, or ``0`` if no item is selected. +Returns the ID of the selected item, or ``-1`` if no item is selected. ---- @@ -288,6 +288,8 @@ Removes the item at index ``idx``. Selects an item by index and makes it the current item. This will work even if the item is disabled. +Passing ``-1`` as the index deselects any currently selected item. + ---- .. _class_OptionButton_method_set_item_disabled: diff --git a/classes/class_os.rst b/classes/class_os.rst index 7d34ca641..f94813c7d 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -120,6 +120,8 @@ Methods +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_datetime_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_display_cutouts` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_dynamic_memory_usage` **(** **)** |const| | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_environment` **(** :ref:`String` variable **)** |const| | @@ -242,6 +244,8 @@ Methods +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_ok_left_and_cancel_right` **(** **)** |const| | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_process_running` **(** :ref:`int` pid **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_scancode_unicode` **(** :ref:`int` code **)** |const| | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_stdout_verbose` **(** **)** |const| | @@ -442,39 +446,39 @@ enum **HandleType**: - **APPLICATION_HANDLE** = **0** --- Application handle: -- Windows: ``HINSTANCE`` of the application + - Windows: ``HINSTANCE`` of the application -- MacOS: ``NSApplication*`` of the application (not yet implemented) + - MacOS: ``NSApplication*`` of the application (not yet implemented) -- Android: ``JNIEnv*`` of the application (not yet implemented) + - Android: ``JNIEnv*`` of the application (not yet implemented) - **DISPLAY_HANDLE** = **1** --- Display handle: -- Linux: ``X11::Display*`` for the display + - Linux: ``X11::Display*`` for the display - **WINDOW_HANDLE** = **2** --- Window handle: -- Windows: ``HWND`` of the main window + - Windows: ``HWND`` of the main window -- Linux: ``X11::Window*`` of the main window + - Linux: ``X11::Window*`` of the main window -- MacOS: ``NSWindow*`` of the main window (not yet implemented) + - MacOS: ``NSWindow*`` of the main window (not yet implemented) -- Android: ``jObject`` the main android activity (not yet implemented) + - Android: ``jObject`` the main android activity (not yet implemented) - **WINDOW_VIEW** = **3** --- Window view: -- Windows: ``HDC`` of the main window drawing context + - Windows: ``HDC`` of the main window drawing context -- MacOS: ``NSView*`` of the main windows view (not yet implemented) + - MacOS: ``NSView*`` of the main windows view (not yet implemented) - **OPENGL_CONTEXT** = **4** --- OpenGL Context: -- Windows: ``HGLRC``\ + - Windows: ``HGLRC``\ -- Linux: ``X11::GLXContext``\ + - Linux: ``X11::GLXContext``\ -- MacOS: ``NSOpenGLContext*`` (not yet implemented) + - MacOS: ``NSOpenGLContext*`` (not yet implemented) ---- @@ -1203,6 +1207,16 @@ The returned Dictionary's values will be the same as :ref:`get_datetime` **get_display_cutouts** **(** **)** |const| + +Returns an :ref:`Array` of :ref:`Rect2`, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also :ref:`get_window_safe_area`. + +\ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches. + +---- + .. _class_OS_method_get_dynamic_memory_usage: - :ref:`int` **get_dynamic_memory_usage** **(** **)** |const| @@ -1824,6 +1838,18 @@ Returns ``true`` if the **OK** button should appear on the left and **Cancel** o ---- +.. _class_OS_method_is_process_running: + +- :ref:`bool` **is_process_running** **(** :ref:`int` pid **)** |const| + +Returns ``true`` if the child process ID (``pid``) is still running or ``false`` if it has terminated. + +Must be a valid ID generated from :ref:`execute`. + +\ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. + +---- + .. _class_OS_method_is_scancode_unicode: - :ref:`bool` **is_scancode_unicode** **(** :ref:`int` code **)** |const| diff --git a/classes/class_panelcontainer.rst b/classes/class_panelcontainer.rst index c871f4818..b4e0145f1 100644 --- a/classes/class_panelcontainer.rst +++ b/classes/class_panelcontainer.rst @@ -23,6 +23,8 @@ Panel container type. This container fits controls inside of the delimited area Tutorials --------- +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + - `2D Role Playing Game Demo `__ Theme Properties diff --git a/classes/class_polygon2d.rst b/classes/class_polygon2d.rst index 349d604b8..7b1490887 100644 --- a/classes/class_polygon2d.rst +++ b/classes/class_polygon2d.rst @@ -95,7 +95,9 @@ Property Descriptions | *Getter* | get_antialiased() | +-----------+------------------------+ -If ``true``, polygon edges will be anti-aliased. +If ``true``, attempts to perform antialiasing for polygon edges by drawing a thin OpenGL smooth line on the edges. + +\ **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the `Antialiased Line2D `__ add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ---- diff --git a/classes/class_poolbytearray.rst b/classes/class_poolbytearray.rst index 03308aa93..edfd7709a 100644 --- a/classes/class_poolbytearray.rst +++ b/classes/class_poolbytearray.rst @@ -16,7 +16,23 @@ Description An array specifically designed to hold bytes. Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolByteArray`` or mutating a ``PoolByteArray`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolByteArray()] + array[0].push_back(123) + print(array) # [[]] (empty PoolByteArray within an empty Array) + +Instead, the entire ``PoolByteArray`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolByteArray()] + var pool_array = array[0] + pool_array.push_back(123) + array[0] = pool_array + print(array) # [[123]] (PoolByteArray with 1 element inside an Array) Methods ------- @@ -30,6 +46,8 @@ Methods +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolByteArray` | :ref:`compress` **(** :ref:`int` compression_mode=0 **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`int` value **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolByteArray` | :ref:`decompress` **(** :ref:`int` buffer_size, :ref:`int` compression_mode=0 **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolByteArray` | :ref:`decompress_dynamic` **(** :ref:`int` max_output_size, :ref:`int` compression_mode=0 **)** | @@ -38,10 +56,14 @@ Methods +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`int` byte **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`int` value, :ref:`int` from=0 **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_string_from_ascii` **(** **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_string_from_utf8` **(** **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`int` value **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`hex_encode` **(** **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`int` byte **)** | @@ -54,6 +76,8 @@ Methods +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`int` value, :ref:`int` from=-1 **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`int` byte **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | @@ -96,6 +120,14 @@ Returns a new ``PoolByteArray`` with the data compressed. Set the compression mo ---- +.. _class_PoolByteArray_method_count: + +- :ref:`int` **count** **(** :ref:`int` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolByteArray_method_decompress: - :ref:`PoolByteArray` **decompress** **(** :ref:`int` buffer_size, :ref:`int` compression_mode=0 **)** @@ -134,6 +166,14 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolByteArray_method_find: + +- :ref:`int` **find** **(** :ref:`int` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + .. _class_PoolByteArray_method_get_string_from_ascii: - :ref:`String` **get_string_from_ascii** **(** **)** @@ -150,6 +190,16 @@ Returns a copy of the array's contents as :ref:`String`. Slower th ---- +.. _class_PoolByteArray_method_has: + +- :ref:`bool` **has** **(** :ref:`int` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolByteArray_method_hex_encode: - :ref:`String` **hex_encode** **(** **)** @@ -205,6 +255,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolByteArray_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`int` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolByteArray_method_set: - void **set** **(** :ref:`int` idx, :ref:`int` byte **)** diff --git a/classes/class_poolcolorarray.rst b/classes/class_poolcolorarray.rst index 5c5da9efd..5786041fd 100644 --- a/classes/class_poolcolorarray.rst +++ b/classes/class_poolcolorarray.rst @@ -9,14 +9,30 @@ PoolColorArray ============== -A pooled array of :ref:`Color`. +A pooled array of :ref:`Color`\ s. Description ----------- An array specifically designed to hold :ref:`Color`. Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolColorArray`` or mutating a ``PoolColorArray`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolColorArray()] + array[0].push_back(Color(0.1, 0.2, 0.3, 0.4)) + print(array) # [[]] (empty PoolColorArray within an empty Array) + +Instead, the entire ``PoolColorArray`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolColorArray()] + var pool_array = array[0] + pool_array.push_back(Color(0.1, 0.2, 0.3, 0.4)) + array[0] = pool_array + print(array) # [[(0.1, 0.2, 0.3, 0.4)]] (PoolColorArray with 1 element inside an Array) Methods ------- @@ -28,10 +44,16 @@ Methods +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_array` **(** :ref:`PoolColorArray` array **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`Color` value **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`Color` color **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`Color` value, :ref:`int` from=0 **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`Color` value **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Color` color **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invert` **(** **)** | @@ -42,6 +64,8 @@ Methods +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`Color` value, :ref:`int` from=-1 **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`Color` color **)** | +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | @@ -74,6 +98,14 @@ Appends a ``PoolColorArray`` at the end of this array. ---- +.. _class_PoolColorArray_method_count: + +- :ref:`int` **count** **(** :ref:`Color` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolColorArray_method_empty: - :ref:`bool` **empty** **(** **)** @@ -90,6 +122,24 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolColorArray_method_find: + +- :ref:`int` **find** **(** :ref:`Color` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + +.. _class_PoolColorArray_method_has: + +- :ref:`bool` **has** **(** :ref:`Color` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolColorArray_method_insert: - :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Color` color **)** @@ -130,6 +180,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolColorArray_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`Color` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolColorArray_method_set: - void **set** **(** :ref:`int` idx, :ref:`Color` color **)** diff --git a/classes/class_poolintarray.rst b/classes/class_poolintarray.rst index 9384caa26..59b064ee8 100644 --- a/classes/class_poolintarray.rst +++ b/classes/class_poolintarray.rst @@ -16,7 +16,23 @@ Description An array specifically designed to hold integer values (:ref:`int`). Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolIntArray`` or mutating a ``PoolIntArray`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolIntArray()] + array[0].push_back(1234) + print(array) # [[]] (empty PoolIntArray within an empty Array) + +Instead, the entire ``PoolIntArray`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolIntArray()] + var pool_array = array[0] + pool_array.push_back(1234) + array[0] = pool_array + print(array) # [[1234]] (PoolIntArray with 1 element inside an Array) \ **Note:** This type is limited to signed 32-bit integers, which means it can only take values in the interval ``[-2^31, 2^31 - 1]``, i.e. ``[-2147483648, 2147483647]``. Exceeding those bounds will wrap around. In comparison, :ref:`int` uses signed 64-bit integers which can hold much larger values. @@ -30,10 +46,16 @@ Methods +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_array` **(** :ref:`PoolIntArray` array **)** | +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`int` value **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`int` integer **)** | +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`int` value, :ref:`int` from=0 **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`int` value **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`int` integer **)** | +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invert` **(** **)** | @@ -44,6 +66,8 @@ Methods +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`int` value, :ref:`int` from=-1 **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`int` integer **)** | +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | @@ -76,6 +100,14 @@ Appends a ``PoolIntArray`` at the end of this array. ---- +.. _class_PoolIntArray_method_count: + +- :ref:`int` **count** **(** :ref:`int` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolIntArray_method_empty: - :ref:`bool` **empty** **(** **)** @@ -92,6 +124,24 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolIntArray_method_find: + +- :ref:`int` **find** **(** :ref:`int` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + +.. _class_PoolIntArray_method_has: + +- :ref:`bool` **has** **(** :ref:`int` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolIntArray_method_insert: - :ref:`int` **insert** **(** :ref:`int` idx, :ref:`int` integer **)** @@ -134,6 +184,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolIntArray_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`int` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolIntArray_method_set: - void **set** **(** :ref:`int` idx, :ref:`int` integer **)** diff --git a/classes/class_poolrealarray.rst b/classes/class_poolrealarray.rst index 294babf28..61c41a883 100644 --- a/classes/class_poolrealarray.rst +++ b/classes/class_poolrealarray.rst @@ -9,45 +9,69 @@ PoolRealArray ============= -A pooled array of reals (:ref:`float`). +A pooled array of real numbers (:ref:`float`). Description ----------- An array specifically designed to hold floating-point values. Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolRealArray`` or mutating a ``PoolRealArray`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolRealArray()] + array[0].push_back(12.34) + print(array) # [[]] (empty PoolRealArray within an empty Array) + +Instead, the entire ``PoolRealArray`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolRealArray()] + var pool_array = array[0] + pool_array.push_back(12.34) + array[0] = pool_array + print(array) # [[12.34]] (PoolRealArray with 1 element inside an Array) \ **Note:** Unlike primitive :ref:`float`\ s which are 64-bit, numbers stored in ``PoolRealArray`` are 32-bit floats. This means values stored in ``PoolRealArray`` have lower precision compared to primitive :ref:`float`\ s. If you need to store 64-bit floats in an array, use a generic :ref:`Array` with :ref:`float` elements as these will still be 64-bit. However, using a generic :ref:`Array` to store :ref:`float`\ s will use roughly 6 times more memory compared to a ``PoolRealArray``. Methods ------- -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolRealArray` | :ref:`PoolRealArray` **(** :ref:`Array` from **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`append` **(** :ref:`float` value **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`append_array` **(** :ref:`PoolRealArray` array **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`empty` **(** **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`fill` **(** :ref:`float` value **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`float` value **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`invert` **(** **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`push_back` **(** :ref:`float` value **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove` **(** :ref:`int` idx **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`resize` **(** :ref:`int` idx **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set` **(** :ref:`int` idx, :ref:`float` value **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`size` **(** **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`PoolRealArray` **(** :ref:`Array` from **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolRealArray` array **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fill` **(** :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`float` value, :ref:`int` from=0 **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`float` value, :ref:`int` from=-1 **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`float` value **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- @@ -76,6 +100,14 @@ Appends a ``PoolRealArray`` at the end of this array. ---- +.. _class_PoolRealArray_method_count: + +- :ref:`int` **count** **(** :ref:`float` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolRealArray_method_empty: - :ref:`bool` **empty** **(** **)** @@ -92,6 +124,24 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolRealArray_method_find: + +- :ref:`int` **find** **(** :ref:`float` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + +.. _class_PoolRealArray_method_has: + +- :ref:`bool` **has** **(** :ref:`float` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolRealArray_method_insert: - :ref:`int` **insert** **(** :ref:`int` idx, :ref:`float` value **)** @@ -134,6 +184,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolRealArray_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`float` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolRealArray_method_set: - void **set** **(** :ref:`int` idx, :ref:`float` value **)** diff --git a/classes/class_poolstringarray.rst b/classes/class_poolstringarray.rst index 3e137dc0b..bbaded5a7 100644 --- a/classes/class_poolstringarray.rst +++ b/classes/class_poolstringarray.rst @@ -9,14 +9,30 @@ PoolStringArray =============== -A pooled array of :ref:`String`. +A pooled array of :ref:`String`\ s. Description ----------- An array specifically designed to hold :ref:`String`\ s. Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolStringArray`` or mutating a ``PoolStringArray`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolStringArray()] + array[0].push_back("hello") + print(array) # [[]] (empty PoolStringArray within an empty Array) + +Instead, the entire ``PoolStringArray`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolStringArray()] + var pool_array = array[0] + pool_array.push_back("hello") + array[0] = pool_array + print(array) # [[hello]] (PoolStringArray with 1 element inside an Array) Tutorials --------- @@ -33,10 +49,16 @@ Methods +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_array` **(** :ref:`PoolStringArray` array **)** | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`String` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`String` string **)** | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`String` value, :ref:`int` from=0 **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`String` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`String` string **)** | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invert` **(** **)** | @@ -49,6 +71,8 @@ Methods +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`String` value, :ref:`int` from=-1 **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`String` string **)** | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | @@ -81,6 +105,14 @@ Appends a ``PoolStringArray`` at the end of this array. ---- +.. _class_PoolStringArray_method_count: + +- :ref:`int` **count** **(** :ref:`String` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolStringArray_method_empty: - :ref:`bool` **empty** **(** **)** @@ -97,6 +129,24 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolStringArray_method_find: + +- :ref:`int` **find** **(** :ref:`String` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + +.. _class_PoolStringArray_method_has: + +- :ref:`bool` **has** **(** :ref:`String` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolStringArray_method_insert: - :ref:`int` **insert** **(** :ref:`int` idx, :ref:`String` string **)** @@ -145,6 +195,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolStringArray_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`String` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolStringArray_method_set: - void **set** **(** :ref:`int` idx, :ref:`String` string **)** diff --git a/classes/class_poolvector2array.rst b/classes/class_poolvector2array.rst index b8bbd86f1..283c3a265 100644 --- a/classes/class_poolvector2array.rst +++ b/classes/class_poolvector2array.rst @@ -9,14 +9,30 @@ PoolVector2Array ================ -A pooled array of :ref:`Vector2`. +A pooled array of :ref:`Vector2`\ s. Description ----------- An array specifically designed to hold :ref:`Vector2`. Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolVector2Array`` or mutating a ``PoolVector2Array`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolVector2Array()] + array[0].push_back(Vector2(12, 34)) + print(array) # [[]] (empty PoolVector2Array within an empty Array) + +Instead, the entire ``PoolVector2Array`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolVector2Array()] + var pool_array = array[0] + pool_array.push_back(Vector2(12, 34)) + array[0] = pool_array + print(array) # [[(12, 34)]] (PoolVector2Array with 1 element inside an Array) Tutorials --------- @@ -33,10 +49,16 @@ Methods +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_array` **(** :ref:`PoolVector2Array` array **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`Vector2` value **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`Vector2` vector2 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`Vector2` value, :ref:`int` from=0 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`Vector2` value **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invert` **(** **)** | @@ -47,6 +69,8 @@ Methods +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`Vector2` value, :ref:`int` from=-1 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | @@ -79,6 +103,14 @@ Appends a ``PoolVector2Array`` at the end of this array. ---- +.. _class_PoolVector2Array_method_count: + +- :ref:`int` **count** **(** :ref:`Vector2` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolVector2Array_method_empty: - :ref:`bool` **empty** **(** **)** @@ -95,6 +127,24 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolVector2Array_method_find: + +- :ref:`int` **find** **(** :ref:`Vector2` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + +.. _class_PoolVector2Array_method_has: + +- :ref:`bool` **has** **(** :ref:`Vector2` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolVector2Array_method_insert: - :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** @@ -135,6 +185,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolVector2Array_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`Vector2` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolVector2Array_method_set: - void **set** **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** diff --git a/classes/class_poolvector3array.rst b/classes/class_poolvector3array.rst index d8b90bd67..0ab87a8b8 100644 --- a/classes/class_poolvector3array.rst +++ b/classes/class_poolvector3array.rst @@ -16,7 +16,23 @@ Description An array specifically designed to hold :ref:`Vector3`. Optimized for memory usage, does not fragment the memory. -\ **Note:** This type is passed by value and not by reference. +\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolVector3Array`` or mutating a ``PoolVector3Array`` within an :ref:`Array` or :ref:`Dictionary`, changes will be lost: + +:: + + var array = [PoolVector3Array()] + array[0].push_back(Vector3(12, 34, 56)) + print(array) # [[]] (empty PoolVector3Array within an empty Array) + +Instead, the entire ``PoolVector3Array`` property must be *reassigned* with ``=`` for it to be changed: + +:: + + var array = [PoolVector3Array()] + var pool_array = array[0] + pool_array.push_back(Vector3(12, 34, 56)) + array[0] = pool_array + print(array) # [[(12, 34, 56)]] (PoolVector3Array with 1 element inside an Array) Methods ------- @@ -28,10 +44,16 @@ Methods +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_array` **(** :ref:`PoolVector3Array` array **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`Vector3` value **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`Vector3` value, :ref:`int` from=0 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`Vector3` value **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invert` **(** **)** | @@ -42,6 +64,8 @@ Methods +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`Vector3` value, :ref:`int` from=-1 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | @@ -74,6 +98,14 @@ Appends a ``PoolVector3Array`` at the end of this array. ---- +.. _class_PoolVector3Array_method_count: + +- :ref:`int` **count** **(** :ref:`Vector3` value **)** + +Returns the number of times an element is in the array. + +---- + .. _class_PoolVector3Array_method_empty: - :ref:`bool` **empty** **(** **)** @@ -90,6 +122,24 @@ Assigns the given value to all elements in the array. This can typically be used ---- +.. _class_PoolVector3Array_method_find: + +- :ref:`int` **find** **(** :ref:`Vector3` value, :ref:`int` from=0 **)** + +Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds. + +---- + +.. _class_PoolVector3Array_method_has: + +- :ref:`bool` **has** **(** :ref:`Vector3` value **)** + +Returns ``true`` if the array contains the given value. + +\ **Note:** This is equivalent to using the ``in`` operator. + +---- + .. _class_PoolVector3Array_method_insert: - :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** @@ -130,6 +180,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end ---- +.. _class_PoolVector3Array_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`Vector3` value, :ref:`int` from=-1 **)** + +Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + +---- + .. _class_PoolVector3Array_method_set: - void **set** **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index 5f3e8fded..88be8831c 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -168,6 +168,8 @@ Theme Properties +---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ | :ref:`Font` | :ref:`font` | | +---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font_separator` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ | :ref:`Texture` | :ref:`checked` | | +---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ | :ref:`Texture` | :ref:`radio_checked` | | @@ -552,7 +554,7 @@ Returns the text of the item at index ``idx``. - :ref:`String` **get_item_tooltip** **(** :ref:`int` idx **)** |const| -Returns the tooltip associated with the specified index index ``idx``. +Returns the tooltip associated with the specified index ``idx``. ---- @@ -875,6 +877,14 @@ The vertical space between each menu item. ---- +.. _class_PopupMenu_theme_font_font_separator: + +- :ref:`Font` **font_separator** + +:ref:`Font` used for the labeled separator. + +---- + .. _class_PopupMenu_theme_icon_checked: - :ref:`Texture` **checked** diff --git a/classes/class_primitivemesh.rst b/classes/class_primitivemesh.rst index 1c8ea6277..7f3ffb575 100644 --- a/classes/class_primitivemesh.rst +++ b/classes/class_primitivemesh.rst @@ -11,7 +11,7 @@ PrimitiveMesh **Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` -**Inherited By:** :ref:`CapsuleMesh`, :ref:`CubeMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PointMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, :ref:`SphereMesh` +**Inherited By:** :ref:`CapsuleMesh`, :ref:`CubeMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PointMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, :ref:`SphereMesh`, :ref:`TextMesh` Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. diff --git a/classes/class_propertytweener.rst b/classes/class_propertytweener.rst index fc0953957..ef3d3a29c 100644 --- a/classes/class_propertytweener.rst +++ b/classes/class_propertytweener.rst @@ -91,7 +91,7 @@ Sets the time in seconds after which the ``PropertyTweener`` will start interpol - :ref:`PropertyTweener` **set_ease** **(** :ref:`EaseType` ease **)** -Sets the type of used easing from :ref:`EaseType`. If not set, the default easing is used from the :ref:`Tween` that contains this Tweener. +Sets the type of used easing from :ref:`EaseType`. If not set, the default easing is used from the :ref:`SceneTreeTween` that contains this Tweener. ---- @@ -99,7 +99,7 @@ Sets the type of used easing from :ref:`EaseType`. If not s - :ref:`PropertyTweener` **set_trans** **(** :ref:`TransitionType` trans **)** -Sets the type of used transition from :ref:`TransitionType`. If not set, the default transition is used from the :ref:`Tween` that contains this Tweener. +Sets the type of used transition from :ref:`TransitionType`. If not set, the default transition is used from the :ref:`SceneTreeTween` that contains this Tweener. .. |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_proximitygroup.rst b/classes/class_proximitygroup.rst index 48067cf0b..600ab87ba 100644 --- a/classes/class_proximitygroup.rst +++ b/classes/class_proximitygroup.rst @@ -11,12 +11,46 @@ ProximityGroup **Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -General-purpose proximity detection node. +General-purpose 3D proximity detection node. Description ----------- -General-purpose proximity detection node. +General-purpose proximity detection node. ``ProximityGroup`` can be used for *approximate* distance checks, which are faster than exact distance checks using :ref:`Vector3.distance_to` or :ref:`Vector3.distance_squared_to`. + +\ ``ProximityGroup`` nodes are automatically grouped together, as long as they share the same :ref:`group_name` and intersect with each other. By calling the :ref:`broadcast`, you can invoke a specified method with various parameters to all intersecting members. + +\ ``ProximityGroup`` is cuboid-shaped and consists of a cluster of :ref:`Vector3` coordinates. The coordinates are automatically calculated by calling :ref:`grid_radius`. To allow ``ProximityGroup`` to find its peers (and perform automatic grouping), you need to define its :ref:`group_name` to a non-empty :ref:`String`. As soon as this object's shape intersects with another ``ProximityGroup`` object' shape, and both share the same :ref:`group_name`, they will belong together for as long as they intersect. + +Since ``ProximityGroup`` doesn't rely the physics engine, you don't need to add any other node as a child (unlike :ref:`PhysicsBody`). + +The ``ProximityGroup`` uses the :ref:`SceneTree` groups in the background by calling the method :ref:`Node.add_to_group` internally. The :ref:`SceneTree` group names are constructed by combining the :ref:`group_name` with its coordinates, which are calculated using the :ref:`grid_radius` you defined beforehand. + +\ **Example:** A ``ProximityGroup`` node named ``"PlanetEarth"`` at position ``Vector3(6, 6, 6)`` with a :ref:`group_name` set to ``"planets"`` and a :ref:`grid_radius` of ``Vector3(1, 2, 3)`` will create the following :ref:`SceneTree` group names: + +:: + + - "planets|5|4|3" + - "planets|5|4|4" + - "planets|5|4|5" + - "planets|5|4|6" + - "planets|5|4|7" + - "planets|5|4|8" + - "planets|5|4|9" + - ... + +If there is another ``ProximityGroup`` named ``"PlanetMars"`` with group name ``"planets"``, and one of its coordinates is ``Vector3(5, 4, 7)``, it would normally create the :ref:`SceneTree` group called ``"planets|5|4|7"``. However, since this group name already exists, this ``ProximityGroup`` object will be *added* to the existing one. ``"PlanetEarth"`` is already in this group. As long as both nodes don't change their transform and stop intersecting (or exit the scene tree), they are grouped together. As long as this intersection exists, any call to :ref:`broadcast` will affect *both* ``ProximityGroup`` nodes. + +There are 3 caveats to keep in mind when using ``ProximityGroup``: + +- The larger the grid radius, the more coordinates and the more :ref:`SceneTree` groups are created. This can have a performance impact if too many groups are created. + +- If the ``ProximityGroup`` node is transformed in any way (or is removed from the scene tree), the groupings will have to be recalculated. This can also have a performance impact. + +- If your :ref:`grid_radius` is smaller than ``Vector3(1, 1, 1)``, it will be rounded up to ``Vector3(1, 1, 1)``. Therefore, small grid radius values may lead to unwanted groupings. + + +\ **Note:** ``ProximityGroup`` will be removed in Godot 4.0 in favor of more effective and faster :ref:`VisibilityNotifier` functionality. For most use cases, :ref:`Vector3.distance_to` or :ref:`Vector3.distance_squared_to` are fast enough too, especially if you call them less often using a :ref:`Timer` node. Properties ---------- @@ -43,6 +77,12 @@ Signals - **broadcast** **(** :ref:`String` method, :ref:`Array` parameters **)** +Emitted when the user calls the :ref:`broadcast` method and has set :ref:`dispatch_mode` to :ref:`MODE_SIGNAL`. + +The given method and its parameters are passed on to the listeners who connected to this signal of this object, as well as any ``ProximityGroup`` node this node is grouped together with. + +\ **Note:** This signal is *not* emitted by default, as the default :ref:`dispatch_mode` is :ref:`MODE_PROXY`. + Enumerations ------------ @@ -54,9 +94,9 @@ Enumerations enum **DispatchMode**: -- **MODE_PROXY** = **0** +- **MODE_PROXY** = **0** --- This ``ProximityGroup``'s parent will be target of :ref:`broadcast`. -- **MODE_SIGNAL** = **1** +- **MODE_SIGNAL** = **1** --- This ``ProximityGroup`` will emit the :ref:`broadcast` *signal* when calling the :ref:`broadcast` *method*. Property Descriptions --------------------- @@ -73,6 +113,8 @@ Property Descriptions | *Getter* | get_dispatch_mode() | +-----------+--------------------------+ +Specifies which node gets contacted on a call of method :ref:`broadcast`. + ---- .. _class_ProximityGroup_property_grid_radius: @@ -87,6 +129,8 @@ Property Descriptions | *Getter* | get_grid_radius() | +-----------+------------------------+ +The size of the space in 3D units. This also sets the amount of coordinates required to calculate whether two ``ProximityGroup`` nodes are intersecting or not. Smaller :ref:`grid_radius` values can be used for more precise proximity checks at the cost of performance, since more groups will be created. + ---- .. _class_ProximityGroup_property_group_name: @@ -101,6 +145,10 @@ Property Descriptions | *Getter* | get_group_name() | +-----------+-----------------------+ +Specify the common group name, to let other ``ProximityGroup`` nodes know, if they should be auto-grouped with this node in case they intersect with each other. + +For example, if you have a ``ProximityGroup`` node named ``"Earth"`` and another called ``"Mars"``, with both nodes having ``"planet"`` as their :ref:`group_name`. Give both planets a significantly larger :ref:`grid_radius` than their actual radius, position them close enough and they'll be automatically grouped. + Method Descriptions ------------------- @@ -108,6 +156,10 @@ Method Descriptions - void **broadcast** **(** :ref:`String` method, :ref:`Variant` parameters **)** +Calls on all intersecting ``ProximityGroup`` the given method and parameters. + +If the :ref:`dispatch_mode` is set to :ref:`MODE_PROXY` (the default), all calls are delegated to their respective parent :ref:`Node`. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst index e634d612e..17b2a898d 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -596,10 +596,12 @@ Adds raw non-BBCode-parsed text to the tag stack. - :ref:`Error` **append_bbcode** **(** :ref:`String` bbcode **)** -Parses ``bbcode`` and adds tags to the tag stack as needed. Returns the result of the parsing, :ref:`@GlobalScope.OK` if successful. +Parses ``bbcode`` and adds tags to the tag stack as needed. \ **Note:** Using this method, you can't close a tag that was opened in a previous :ref:`append_bbcode` call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the :ref:`bbcode_text` instead of using :ref:`append_bbcode`. +\ **Note:** This method internals' can't possibly fail, but an error code is returned for backwards compatibility, which will always be :ref:`@GlobalScope.OK`. + ---- .. _class_RichTextLabel_method_clear: @@ -688,7 +690,9 @@ Adds a newline tag to the tag stack. - :ref:`Error` **parse_bbcode** **(** :ref:`String` bbcode **)** -The assignment version of :ref:`append_bbcode`. Clears the tag stack and inserts the new content. Returns :ref:`@GlobalScope.OK` if parses ``bbcode`` successfully. +The assignment version of :ref:`append_bbcode`. Clears the tag stack and inserts the new content. + +\ **Note:** This method internals' can't possibly fail, but an error code is returned for backwards compatibility, which will always be :ref:`@GlobalScope.OK`. ---- @@ -1023,7 +1027,7 @@ The default text font. - :ref:`StyleBox` **focus** -The background The background used when the ``RichTextLabel`` is focused. +The background used when the ``RichTextLabel`` is focused. ---- diff --git a/classes/class_rigidbody.rst b/classes/class_rigidbody.rst index c20ce08a6..b16f1e359 100644 --- a/classes/class_rigidbody.rst +++ b/classes/class_rigidbody.rst @@ -222,7 +222,7 @@ Property Descriptions | *Getter* | get_angular_damp() | +-----------+-------------------------+ -Damps RigidBody's rotational forces. +Damps RigidBody's rotational forces. If this value is different from -1.0 it will be added to any linear damp derived from the world or areas. See :ref:`ProjectSettings.physics/3d/default_angular_damp` for more details about damping. @@ -486,7 +486,7 @@ This is multiplied by the global 3D gravity setting found in **Project > Project | *Getter* | get_linear_damp() | +-----------+------------------------+ -The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden. +The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0 it will be added to any linear damp derived from the world or areas. See :ref:`ProjectSettings.physics/3d/default_linear_damp` for more details about damping. diff --git a/classes/class_rigidbody2d.rst b/classes/class_rigidbody2d.rst index 46a48a636..d588f3d91 100644 --- a/classes/class_rigidbody2d.rst +++ b/classes/class_rigidbody2d.rst @@ -224,7 +224,7 @@ Property Descriptions | *Getter* | get_angular_damp() | +-----------+-------------------------+ -Damps the body's :ref:`angular_velocity`. If ``-1``, the body will use the **Default Angular Damp** defined in **Project > Project Settings > Physics > 2d**. +Damps the body's :ref:`angular_velocity`. If ``-1``, the body will use the **Default Angular Damp** defined in **Project > Project Settings > Physics > 2d**. If greater than ``-1`` it will be added to the default project value. See :ref:`ProjectSettings.physics/2d/default_angular_damp` for more details about damping. @@ -438,7 +438,7 @@ The body's moment of inertia. This is like mass, but for rotation: it determines | *Getter* | get_linear_damp() | +-----------+------------------------+ -Damps the body's :ref:`linear_velocity`. If ``-1``, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d**. +Damps the body's :ref:`linear_velocity`. If ``-1``, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d**. If greater than ``-1`` it will be added to the default project value. See :ref:`ProjectSettings.physics/2d/default_linear_damp` for more details about damping. diff --git a/classes/class_scenetree.rst b/classes/class_scenetree.rst index 75ab27c13..399bb6de3 100644 --- a/classes/class_scenetree.rst +++ b/classes/class_scenetree.rst @@ -32,6 +32,8 @@ Tutorials Properties ---------- ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`auto_accept_quit` | ``true`` | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ | :ref:`Node` | :ref:`current_scene` | | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ @@ -51,6 +53,8 @@ Properties +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`physics_interpolation` | ``false`` | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`quit_on_go_back` | ``true`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`refuse_new_network_connections` | ``false`` | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ | :ref:`Viewport` | :ref:`root` | | @@ -106,16 +110,12 @@ Methods +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`reload_current_scene` **(** **)** | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_auto_accept_quit` **(** :ref:`bool` enabled **)** | -+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_group` **(** :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_group_flags` **(** :ref:`int` call_flags, :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_input_as_handled` **(** **)** | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_quit_on_go_back` **(** :ref:`bool` enabled **)** | -+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_screen_stretch` **(** :ref:`StretchMode` mode, :ref:`StretchAspect` aspect, :ref:`Vector2` minsize, :ref:`float` scale=1 **)** | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -310,6 +310,24 @@ enum **StretchAspect**: Property Descriptions --------------------- +.. _class_SceneTree_property_auto_accept_quit: + +- :ref:`bool` **auto_accept_quit** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_auto_accept_quit(value) | ++-----------+-----------------------------+ +| *Getter* | is_auto_accept_quit() | ++-----------+-----------------------------+ + +If ``true``, the application automatically accepts quitting. + +For mobile platforms, see :ref:`quit_on_go_back`. + +---- + .. _class_SceneTree_property_current_scene: - :ref:`Node` **current_scene** @@ -452,6 +470,24 @@ Although physics interpolation would normally be globally turned on and off usin ---- +.. _class_SceneTree_property_quit_on_go_back: + +- :ref:`bool` **quit_on_go_back** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_quit_on_go_back(value) | ++-----------+----------------------------+ +| *Getter* | is_quit_on_go_back() | ++-----------+----------------------------+ + +If ``true``, the application quits automatically on going back (e.g. on Android). + +To handle 'Go Back' button when this option is disabled, use :ref:`MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST`. + +---- + .. _class_SceneTree_property_refuse_new_network_connections: - :ref:`bool` **refuse_new_network_connections** @@ -715,16 +751,6 @@ Returns :ref:`@GlobalScope.OK` on success, :ref: ---- -.. _class_SceneTree_method_set_auto_accept_quit: - -- void **set_auto_accept_quit** **(** :ref:`bool` enabled **)** - -If ``true``, the application automatically accepts quitting. Enabled by default. - -For mobile platforms, see :ref:`set_quit_on_go_back`. - ----- - .. _class_SceneTree_method_set_group: - void **set_group** **(** :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** @@ -749,16 +775,6 @@ Marks the most recent :ref:`InputEvent` as handled. ---- -.. _class_SceneTree_method_set_quit_on_go_back: - -- void **set_quit_on_go_back** **(** :ref:`bool` enabled **)** - -If ``true``, the application quits automatically on going back (e.g. on Android). Enabled by default. - -To handle 'Go Back' button when this option is disabled, use :ref:`MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST`. - ----- - .. _class_SceneTree_method_set_screen_stretch: - void **set_screen_stretch** **(** :ref:`StretchMode` mode, :ref:`StretchAspect` aspect, :ref:`Vector2` minsize, :ref:`float` scale=1 **)** diff --git a/classes/class_scenetreetween.rst b/classes/class_scenetreetween.rst index e510ce49d..0d18ea67b 100644 --- a/classes/class_scenetreetween.rst +++ b/classes/class_scenetreetween.rst @@ -125,6 +125,10 @@ Signals - **finished** **(** **)** +Emitted when the ``SceneTreeTween`` has finished all tweening. Never emitted when the ``SceneTreeTween`` is set to infinite looping (see :ref:`set_loops`). + +\ **Note:** The ``SceneTreeTween`` is removed (invalidated) after this signal is emitted, but it doesn't happen immediately, but on the next processing frame. Calling :ref:`stop` inside the signal callback will preserve the ``SceneTreeTween``. + ---- .. _class_SceneTreeTween_signal_loop_finished: diff --git a/classes/class_scrollcontainer.rst b/classes/class_scrollcontainer.rst index 08907c24e..65be938ee 100644 --- a/classes/class_scrollcontainer.rst +++ b/classes/class_scrollcontainer.rst @@ -20,6 +20,11 @@ Description A ScrollContainer node meant to contain a :ref:`Control` child. ScrollContainers will automatically create a scrollbar child (:ref:`HScrollBar`, :ref:`VScrollBar`, or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the :ref:`Control.rect_min_size` of the Control relative to the ScrollContainer. Works great with a :ref:`Panel` control. You can set ``EXPAND`` on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Properties ---------- diff --git a/classes/class_shape2d.rst b/classes/class_shape2d.rst index a238ea14b..6abf587af 100644 --- a/classes/class_shape2d.rst +++ b/classes/class_shape2d.rst @@ -81,7 +81,11 @@ This method needs the transformation matrix for this shape (``local_xform``), th - :ref:`Array` **collide_and_get_contacts** **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** -Returns a list of the points where this shape touches another. If there are no collisions the list is empty. +Returns a list of contact point pairs where this shape touches another. + +If there are no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of ``with_shape``. + +A collision pair A, B can be used to calculate the collision normal with ``(B - A).normalized()``, and the collision depth with ``(B - A).length()``. This information is typically used to separate shapes, particularly in collision solvers. This method needs the transformation matrix for this shape (``local_xform``), the shape to check collisions with (``with_shape``), and the transformation matrix of that shape (``shape_xform``). @@ -101,7 +105,11 @@ This method needs the transformation matrix for this shape (``local_xform``), th - :ref:`Array` **collide_with_motion_and_get_contacts** **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** -Returns a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions the list is empty. +Returns a list of contact point pairs where this shape would touch another, if a given movement was applied. + +If there would be no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of ``with_shape``. + +A collision pair A, B can be used to calculate the collision normal with ``(B - A).normalized()``, and the collision depth with ``(B - A).length()``. This information is typically used to separate shapes, particularly in collision solvers. This method needs the transformation matrix for this shape (``local_xform``), the movement to test on this shape (``local_motion``), the shape to check collisions with (``with_shape``), the transformation matrix of that shape (``shape_xform``), and the movement to test onto the other object (``shape_motion``). diff --git a/classes/class_spatialmaterial.rst b/classes/class_spatialmaterial.rst index 55b101e9a..9af80962b 100644 --- a/classes/class_spatialmaterial.rst +++ b/classes/class_spatialmaterial.rst @@ -105,6 +105,8 @@ Properties +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`bool` | :ref:`flags_albedo_tex_force_srgb` | ``false`` | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_albedo_tex_msdf` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`bool` | :ref:`flags_disable_ambient_light` | ``false`` | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`bool` | :ref:`flags_do_not_receive_shadows` | ``false`` | @@ -500,6 +502,8 @@ enum **CullMode**: .. _class_SpatialMaterial_constant_FLAG_USE_SHADOW_TO_OPACITY: +.. _class_SpatialMaterial_constant_FLAG_ALBEDO_TEXTURE_SDF: + .. _class_SpatialMaterial_constant_FLAG_MAX: enum **Flags**: @@ -542,7 +546,9 @@ enum **Flags**: - **FLAG_USE_SHADOW_TO_OPACITY** = **18** --- Enables the shadow to opacity feature. -- **FLAG_MAX** = **19** --- Represents the size of the :ref:`Flags` enum. +- **FLAG_ALBEDO_TEXTURE_SDF** = **19** --- Enables signed distance field rendering shader. + +- **FLAG_MAX** = **20** --- Represents the size of the :ref:`Flags` enum. ---- @@ -1285,6 +1291,22 @@ Forces a conversion of the :ref:`albedo_texture` **flags_albedo_tex_msdf** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +Enables signed distance field rendering shader. + +---- + .. _class_SpatialMaterial_property_flags_disable_ambient_light: - :ref:`bool` **flags_disable_ambient_light** diff --git a/classes/class_splitcontainer.rst b/classes/class_splitcontainer.rst index d1f0bfb27..93822348b 100644 --- a/classes/class_splitcontainer.rst +++ b/classes/class_splitcontainer.rst @@ -20,6 +20,11 @@ Description Container for splitting two :ref:`Control`\ s vertically or horizontally, with a grabber that allows adjusting the split offset or ratio. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Properties ---------- diff --git a/classes/class_spritebase3d.rst b/classes/class_spritebase3d.rst index c7732e0b4..0a75d35f7 100644 --- a/classes/class_spritebase3d.rst +++ b/classes/class_spritebase3d.rst @@ -23,33 +23,39 @@ A node that displays 2D texture information in a 3D environment. Properties ---------- -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`AlphaCutMode` | :ref:`alpha_cut` | ``0`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| Vector3.Axis | :ref:`axis` | ``2`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`BillboardMode` | :ref:`billboard` | ``0`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`centered` | ``true`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`double_sided` | ``true`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`flip_h` | ``false`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`flip_v` | ``false`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`Color` | :ref:`modulate` | ``Color( 1, 1, 1, 1 )`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`opacity` | ``1.0`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`pixel_size` | ``0.01`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`shaded` | ``false`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`transparent` | ``true`` | -+----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`AlphaCutMode` | :ref:`alpha_cut` | ``0`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| Vector3.Axis | :ref:`axis` | ``2`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`BillboardMode` | :ref:`billboard` | ``0`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`centered` | ``true`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`double_sided` | ``true`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`fixed_size` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`modulate` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`no_depth_test` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`opacity` | ``1.0`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`pixel_size` | ``0.01`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`render_priority` | ``0`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`shaded` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`transparent` | ``true`` | ++----------------------------------------------------------+---------------------------------------------------------------------+-------------------------+ Methods ------- @@ -75,6 +81,10 @@ Enumerations .. _class_SpriteBase3D_constant_FLAG_DOUBLE_SIDED: +.. _class_SpriteBase3D_constant_FLAG_DISABLE_DEPTH_TEST: + +.. _class_SpriteBase3D_constant_FLAG_FIXED_SIZE: + .. _class_SpriteBase3D_constant_FLAG_MAX: enum **DrawFlags**: @@ -85,7 +95,11 @@ enum **DrawFlags**: - **FLAG_DOUBLE_SIDED** = **2** --- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind. -- **FLAG_MAX** = **3** --- Represents the size of the :ref:`DrawFlags` enum. +- **FLAG_DISABLE_DEPTH_TEST** = **3** --- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + +- **FLAG_FIXED_SIZE** = **4** --- Sprite is scaled by depth so that it always appears the same size on screen. + +- **FLAG_MAX** = **5** --- Represents the size of the :ref:`DrawFlags` enum. ---- @@ -184,6 +198,22 @@ If ``true``, texture can be seen from the back as well, if ``false``, it is invi ---- +.. _class_SpriteBase3D_property_fixed_size: + +- :ref:`bool` **fixed_size** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, the label is rendered at the same size regardless of distance. + +---- + .. _class_SpriteBase3D_property_flip_h: - :ref:`bool` **flip_h** @@ -234,6 +264,22 @@ A color value used to *multiply* the texture's colors. Can be used for mood-colo ---- +.. _class_SpriteBase3D_property_no_depth_test: + +- :ref:`bool` **no_depth_test** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, depth testing is disabled and the object will be drawn in render order. + +---- + .. _class_SpriteBase3D_property_offset: - :ref:`Vector2` **offset** @@ -284,6 +330,26 @@ The size of one pixel's width on the sprite to scale it in 3D. ---- +.. _class_SpriteBase3D_property_render_priority: + +- :ref:`int` **render_priority** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_render_priority(value) | ++-----------+----------------------------+ +| *Getter* | get_render_priority() | ++-----------+----------------------------+ + +Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects. + +\ **Node:** This only applies if :ref:`alpha_cut` is set to :ref:`ALPHA_CUT_DISABLED` (default value). + +\ **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + +---- + .. _class_SpriteBase3D_property_shaded: - :ref:`bool` **shaded** diff --git a/classes/class_tabcontainer.rst b/classes/class_tabcontainer.rst index 74d50986e..48737e195 100644 --- a/classes/class_tabcontainer.rst +++ b/classes/class_tabcontainer.rst @@ -22,6 +22,11 @@ Ignores non-:ref:`Control` children. \ **Note:** The drawing of the clickable tabs themselves is handled by this node. Adding :ref:`Tabs` as children is not needed. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Properties ---------- diff --git a/classes/class_textmesh.rst b/classes/class_textmesh.rst new file mode 100644 index 000000000..fa1e3a25d --- /dev/null +++ b/classes/class_textmesh.rst @@ -0,0 +1,176 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TextMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextMesh: + +TextMesh +======== + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Generate an :ref:`PrimitiveMesh` from the text. + +Description +----------- + +Generate an :ref:`PrimitiveMesh` from the text. + +TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported. + +The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges. + +Properties +---------- + ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`curve_step` | ``0.5`` | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`depth` | ``0.05`` | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`Font` | :ref:`font` | | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`Align` | :ref:`horizontal_alignment` | ``1`` | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`pixel_size` | ``0.01`` | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`text` | ``""`` | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`uppercase` | ``false`` | ++-----------------------------------+---------------------------------------------------------------------------+-----------+ + +Enumerations +------------ + +.. _enum_TextMesh_Align: + +.. _class_TextMesh_constant_ALIGN_LEFT: + +.. _class_TextMesh_constant_ALIGN_CENTER: + +.. _class_TextMesh_constant_ALIGN_RIGHT: + +enum **Align**: + +- **ALIGN_LEFT** = **0** --- Align rows to the left (default). + +- **ALIGN_CENTER** = **1** --- Align rows centered. + +- **ALIGN_RIGHT** = **2** --- Align rows to the right. + +Property Descriptions +--------------------- + +.. _class_TextMesh_property_curve_step: + +- :ref:`float` **curve_step** + ++-----------+-----------------------+ +| *Default* | ``0.5`` | ++-----------+-----------------------+ +| *Setter* | set_curve_step(value) | ++-----------+-----------------------+ +| *Getter* | get_curve_step() | ++-----------+-----------------------+ + +Step (in pixels) used to approximate Bézier curves. + +---- + +.. _class_TextMesh_property_depth: + +- :ref:`float` **depth** + ++-----------+------------------+ +| *Default* | ``0.05`` | ++-----------+------------------+ +| *Setter* | set_depth(value) | ++-----------+------------------+ +| *Getter* | get_depth() | ++-----------+------------------+ + +Depths of the mesh, if set to ``0.0`` only front surface, is generated, and UV layout is changed to use full texture for the front face only. + +---- + +.. _class_TextMesh_property_font: + +- :ref:`Font` **font** + ++----------+-----------------+ +| *Setter* | set_font(value) | ++----------+-----------------+ +| *Getter* | get_font() | ++----------+-----------------+ + +:ref:`Font` used for the ``TextMesh``'s text. + +---- + +.. _class_TextMesh_property_horizontal_alignment: + +- :ref:`Align` **horizontal_alignment** + ++-----------+---------------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------------+ +| *Setter* | set_horizontal_alignment(value) | ++-----------+---------------------------------+ +| *Getter* | get_horizontal_alignment() | ++-----------+---------------------------------+ + +Controls the text's horizontal alignment. Supports left, center and right. Set it to one of the :ref:`Align` constants. + +---- + +.. _class_TextMesh_property_pixel_size: + +- :ref:`float` **pixel_size** + ++-----------+-----------------------+ +| *Default* | ``0.01`` | ++-----------+-----------------------+ +| *Setter* | set_pixel_size(value) | ++-----------+-----------------------+ +| *Getter* | get_pixel_size() | ++-----------+-----------------------+ + +The size of one pixel's width on the text to scale it in 3D. + +---- + +.. _class_TextMesh_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +The text to generate mesh from. + +---- + +.. _class_TextMesh_property_uppercase: + +- :ref:`bool` **uppercase** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_uppercase(value) | ++-----------+----------------------+ +| *Getter* | is_uppercase() | ++-----------+----------------------+ + +If ``true``, all the text displays as UPPERCASE. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_time.rst b/classes/class_time.rst index ee34a5b25..2ff1afe73 100644 --- a/classes/class_time.rst +++ b/classes/class_time.rst @@ -29,49 +29,49 @@ When getting time information from the system, the time can either be in the loc Methods ------- -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_date_dict_from_system` **(** :ref:`bool` utc=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_date_dict_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_date_string_from_system` **(** :ref:`bool` utc=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_date_string_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_datetime_dict_from_string` **(** :ref:`String` datetime, :ref:`bool` weekday **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_datetime_dict_from_system` **(** :ref:`bool` utc=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_datetime_dict_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_datetime_string_from_dict` **(** :ref:`Dictionary` datetime, :ref:`bool` use_space **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_datetime_string_from_system` **(** :ref:`bool` utc=false, :ref:`bool` use_space=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_datetime_string_from_unix_time` **(** :ref:`int` unix_time_val, :ref:`bool` use_space=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_offset_string_from_offset_minutes` **(** :ref:`int` offset_minutes **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_ticks_msec` **(** **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_ticks_usec` **(** **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_time_dict_from_system` **(** :ref:`bool` utc=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_time_dict_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_time_string_from_system` **(** :ref:`bool` utc=false **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_time_string_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_time_zone_from_system` **(** **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_unix_time_from_datetime_dict` **(** :ref:`Dictionary` datetime **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_unix_time_from_datetime_string` **(** :ref:`String` datetime **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_unix_time_from_system` **(** **)** |const| | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_date_dict_from_system` **(** :ref:`bool` utc=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_date_dict_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_date_string_from_system` **(** :ref:`bool` utc=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_date_string_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_datetime_dict_from_datetime_string` **(** :ref:`String` datetime, :ref:`bool` weekday **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_datetime_dict_from_system` **(** :ref:`bool` utc=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_datetime_dict_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_datetime_string_from_datetime_dict` **(** :ref:`Dictionary` datetime, :ref:`bool` use_space **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_datetime_string_from_system` **(** :ref:`bool` utc=false, :ref:`bool` use_space=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_datetime_string_from_unix_time` **(** :ref:`int` unix_time_val, :ref:`bool` use_space=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_offset_string_from_offset_minutes` **(** :ref:`int` offset_minutes **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_ticks_msec` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_ticks_usec` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_time_dict_from_system` **(** :ref:`bool` utc=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_time_dict_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_time_string_from_system` **(** :ref:`bool` utc=false **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_time_string_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_time_zone_from_system` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_unix_time_from_datetime_dict` **(** :ref:`Dictionary` datetime **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_unix_time_from_datetime_string` **(** :ref:`String` datetime **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_unix_time_from_system` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ @@ -201,9 +201,9 @@ Converts the given Unix timestamp to an ISO 8601 date string (YYYY-MM-DD). ---- -.. _class_Time_method_get_datetime_dict_from_string: +.. _class_Time_method_get_datetime_dict_from_datetime_string: -- :ref:`Dictionary` **get_datetime_dict_from_string** **(** :ref:`String` datetime, :ref:`bool` weekday **)** |const| +- :ref:`Dictionary` **get_datetime_dict_from_datetime_string** **(** :ref:`String` datetime, :ref:`bool` weekday **)** |const| Converts the given ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS) to a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``hour``, ``minute``, and ``second``. @@ -231,9 +231,9 @@ The returned Dictionary's values will be the same as the :ref:`get_datetime_dict ---- -.. _class_Time_method_get_datetime_string_from_dict: +.. _class_Time_method_get_datetime_string_from_datetime_dict: -- :ref:`String` **get_datetime_string_from_dict** **(** :ref:`Dictionary` datetime, :ref:`bool` use_space **)** |const| +- :ref:`String` **get_datetime_string_from_datetime_dict** **(** :ref:`Dictionary` datetime, :ref:`bool` use_space **)** |const| Converts the given dictionary of keys to an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). diff --git a/classes/class_transform.rst b/classes/class_transform.rst index 29a4169d7..d08776ffa 100644 --- a/classes/class_transform.rst +++ b/classes/class_transform.rst @@ -68,7 +68,7 @@ Methods +-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`orthonormalized` **(** **)** | +-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Transform` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | +| :ref:`Transform` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | +-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`scaled` **(** :ref:`Vector3` scale **)** | +-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -212,9 +212,9 @@ Returns the transform with the basis orthogonal (90 degrees), and normalized axi .. _class_Transform_method_rotated: -- :ref:`Transform` **rotated** **(** :ref:`Vector3` axis, :ref:`float` phi **)** +- :ref:`Transform` **rotated** **(** :ref:`Vector3` axis, :ref:`float` angle **)** -Rotates the transform around the given axis by the given angle (in radians), using matrix multiplication. The axis must be a normalized vector. +Returns a copy of the transform rotated around the given ``axis`` by the given ``angle`` (in radians), using matrix multiplication. The ``axis`` must be a normalized vector. ---- @@ -222,7 +222,7 @@ Rotates the transform around the given axis by the given angle (in radians), usi - :ref:`Transform` **scaled** **(** :ref:`Vector3` scale **)** -Scales basis and origin of the transform by the given scale factor, using matrix multiplication. +Returns a copy of the transform with its basis and origin scaled by the given ``scale`` factor, using matrix multiplication. ---- @@ -230,7 +230,7 @@ Scales basis and origin of the transform by the given scale factor, using matrix - :ref:`Transform` **translated** **(** :ref:`Vector3` offset **)** -Translates the transform by the given offset, relative to the transform's basis vectors. +Returns a copy of the transform translated by the given ``offset``, relative to the transform's basis vectors. Unlike :ref:`rotated` and :ref:`scaled`, this does not use matrix multiplication. diff --git a/classes/class_transform2d.rst b/classes/class_transform2d.rst index 6f689c744..135bb904f 100644 --- a/classes/class_transform2d.rst +++ b/classes/class_transform2d.rst @@ -70,7 +70,7 @@ Methods +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`orthonormalized` **(** **)** | +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Transform2D` | :ref:`rotated` **(** :ref:`float` phi **)** | +| :ref:`Transform2D` | :ref:`rotated` **(** :ref:`float` angle **)** | +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`scaled` **(** :ref:`Vector2` scale **)** | +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -242,9 +242,9 @@ Returns the transform with the basis orthogonal (90 degrees), and normalized axi .. _class_Transform2D_method_rotated: -- :ref:`Transform2D` **rotated** **(** :ref:`float` phi **)** +- :ref:`Transform2D` **rotated** **(** :ref:`float` angle **)** -Rotates the transform by the given angle (in radians), using matrix multiplication. +Returns a copy of the transform rotated by the given ``angle`` (in radians), using matrix multiplication. ---- @@ -252,7 +252,7 @@ Rotates the transform by the given angle (in radians), using matrix multiplicati - :ref:`Transform2D` **scaled** **(** :ref:`Vector2` scale **)** -Scales the transform by the given scale factor, using matrix multiplication. +Returns a copy of the transform scaled by the given ``scale`` factor, using matrix multiplication. ---- @@ -260,7 +260,7 @@ Scales the transform by the given scale factor, using matrix multiplication. - :ref:`Transform2D` **translated** **(** :ref:`Vector2` offset **)** -Translates the transform by the given offset, relative to the transform's basis vectors. +Returns a copy of the transform translated by the given ``offset``, relative to the transform's basis vectors. Unlike :ref:`rotated` and :ref:`scaled`, this does not use matrix multiplication. diff --git a/classes/class_tree.rst b/classes/class_tree.rst index f87edc43f..f8c427237 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -601,7 +601,7 @@ Returns the currently edited item. Can be used with :ref:`item_edited` **reset** **(** :ref:`Object` object, :ref:`String` key="" **)** -Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are removed, unless ``key`` is specified. +Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are reset, unless ``key`` is specified. ---- diff --git a/classes/class_vboxcontainer.rst b/classes/class_vboxcontainer.rst index 45c2ee2d1..d31d6afae 100644 --- a/classes/class_vboxcontainer.rst +++ b/classes/class_vboxcontainer.rst @@ -23,6 +23,8 @@ Vertical box container. See :ref:`BoxContainer`. Tutorials --------- +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + - `3D Voxel Demo `__ Theme Properties diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index f530da19d..df6043df5 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -102,7 +102,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`reflect` **(** :ref:`Vector2` n **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`rotated` **(** :ref:`float` phi **)** | +| :ref:`Vector2` | :ref:`rotated` **(** :ref:`float` angle **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`round` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -436,9 +436,9 @@ Returns the vector reflected (i.e. mirrored, or symmetric) over a line defined b .. _class_Vector2_method_rotated: -- :ref:`Vector2` **rotated** **(** :ref:`float` phi **)** +- :ref:`Vector2` **rotated** **(** :ref:`float` angle **)** -Returns the vector rotated by ``phi`` radians. See also :ref:`@GDScript.deg2rad`. +Returns the vector rotated by ``angle`` (in radians). See also :ref:`@GDScript.deg2rad`. ---- diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 19dcfb427..9f037cfa3 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -104,7 +104,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`reflect` **(** :ref:`Vector3` n **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | +| :ref:`Vector3` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`round` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -448,9 +448,9 @@ Returns this vector reflected from a plane defined by the given normal. .. _class_Vector3_method_rotated: -- :ref:`Vector3` **rotated** **(** :ref:`Vector3` axis, :ref:`float` phi **)** +- :ref:`Vector3` **rotated** **(** :ref:`Vector3` axis, :ref:`float` angle **)** -Rotates this vector around a given axis by ``phi`` radians. The axis must be a normalized vector. +Rotates this vector around a given axis by ``angle`` (in radians). The axis must be a normalized vector. ---- diff --git a/classes/class_videostreamgdnative.rst b/classes/class_videostreamgdnative.rst index 3ec2f2a27..96c65096a 100644 --- a/classes/class_videostreamgdnative.rst +++ b/classes/class_videostreamgdnative.rst @@ -11,12 +11,12 @@ VideoStreamGDNative **Inherits:** :ref:`VideoStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` -:ref:`VideoStream` resource for for video formats implemented via GDNative. +:ref:`VideoStream` resource for video formats implemented via GDNative. Description ----------- -:ref:`VideoStream` resource for for video formats implemented via GDNative. +:ref:`VideoStream` resource for video formats implemented via GDNative. It can be used via `godot-videodecoder `__ which uses the `FFmpeg `__ library. diff --git a/classes/class_visualserver.rst b/classes/class_visualserver.rst index 7af686b30..3f63c50cb 100644 --- a/classes/class_visualserver.rst +++ b/classes/class_visualserver.rst @@ -1897,15 +1897,17 @@ enum **EnvironmentGlowBlendMode**: enum **EnvironmentToneMapper**: -- **ENV_TONE_MAPPER_LINEAR** = **0** --- Output color as they came in. +- **ENV_TONE_MAPPER_LINEAR** = **0** --- Output color as they came in. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. -- **ENV_TONE_MAPPER_REINHARD** = **1** --- Use the Reinhard tonemapper. +- **ENV_TONE_MAPPER_REINHARD** = **1** --- Use the Reinhard tonemapper. Performs a variation on rendered pixels' colors by this formula: ``color = color / (1 + color)``. This avoids clipping bright highlights, but the resulting image can look a bit dull. -- **ENV_TONE_MAPPER_FILMIC** = **2** --- Use the filmic tonemapper. +- **ENV_TONE_MAPPER_FILMIC** = **2** --- Use the filmic tonemapper. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than :ref:`ENV_TONE_MAPPER_REINHARD`. -- **ENV_TONE_MAPPER_ACES** = **3** --- Use the ACES tonemapper. +- **ENV_TONE_MAPPER_ACES** = **3** --- Use the legacy Godot version of the Academy Color Encoding System tonemapper. Unlike :ref:`ENV_TONE_MAPPER_ACES_FITTED`, this version of ACES does not handle bright lighting in a physically accurate way. ACES typically has a more contrasted output compared to :ref:`ENV_TONE_MAPPER_REINHARD` and :ref:`ENV_TONE_MAPPER_FILMIC`. -- **ENV_TONE_MAPPER_ACES_FITTED** = **4** --- Use the ACES Fitted tonemapper. +\ **Note:** This tonemapping operator will be removed in Godot 4.0 in favor of the more accurate :ref:`ENV_TONE_MAPPER_ACES_FITTED`. + +- **ENV_TONE_MAPPER_ACES_FITTED** = **4** --- Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to :ref:`ENV_TONE_MAPPER_REINHARD` and :ref:`ENV_TONE_MAPPER_FILMIC`. ---- @@ -3710,7 +3712,7 @@ Returns the value of a certain material's parameter. - :ref:`Variant` **material_get_param_default** **(** :ref:`RID` material, :ref:`String` parameter **)** |const| -Returns the default value for the param if available. Otherwise returns an empty :ref:`Variant`. +Returns the default value for the param if available. Returns ``null`` otherwise. ---- diff --git a/classes/class_vsplitcontainer.rst b/classes/class_vsplitcontainer.rst index c21c356ee..45e84f54d 100644 --- a/classes/class_vsplitcontainer.rst +++ b/classes/class_vsplitcontainer.rst @@ -18,6 +18,11 @@ Description Vertical split container. See :ref:`SplitContainer`. This goes from top to bottom. +Tutorials +--------- + +- :doc:`GUI containers <../tutorials/ui/gui_containers>` + Theme Properties ---------------- diff --git a/classes/class_webxrinterface.rst b/classes/class_webxrinterface.rst index f03f44710..e66c927b2 100644 --- a/classes/class_webxrinterface.rst +++ b/classes/class_webxrinterface.rst @@ -286,7 +286,7 @@ Enumerations enum **TargetRayMode**: -- **TARGET_RAY_MODE_UNKNOWN** = **0** --- We don't know the the target ray mode. +- **TARGET_RAY_MODE_UNKNOWN** = **0** --- We don't know the target ray mode. - **TARGET_RAY_MODE_GAZE** = **1** --- Target ray originates at the viewer's eyes and points in the direction they are looking. diff --git a/classes/class_x509certificate.rst b/classes/class_x509certificate.rst index 7c677877a..3157e80c7 100644 --- a/classes/class_x509certificate.rst +++ b/classes/class_x509certificate.rst @@ -20,8 +20,6 @@ The X509Certificate class represents an X509 certificate. Certificates can be lo They can be used as the server certificate in :ref:`StreamPeerSSL.accept_stream` (along with the proper :ref:`CryptoKey`), and to specify the only certificate that should be accepted when connecting to an SSL server via :ref:`StreamPeerSSL.connect_to_stream`. -\ **Note:** Not available in HTML5 exports. - Methods -------