diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index d1620d34b..ed4cdd4bc 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -271,8 +271,7 @@ Returns the absolute value of parameter ``s`` (i.e. positive value). :: - # a is 1 - a = abs(-1) + a = abs(-1) # a is 1 ---- @@ -306,17 +305,19 @@ Returns the arc sine of ``s`` in radians. Use to get the angle of sine ``s``. - void **assert** **(** :ref:`bool` condition, :ref:`String` message="" **)** -Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated and the program is halted until you resume it. Only executes in debug builds, or when running the game from the editor. Use it for debugging purposes, to make sure a statement is ``true`` during development. +Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of :ref:`push_error` for reporting errors to project developers or add-on users. + +**Note:** For performance reasons, the code inside :ref:`assert` is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an :ref:`assert` call. Otherwise, the project will behave differently when exported in release mode. The optional ``message`` argument, if given, is shown in addition to the generic "Assertion failed" message. You can use this to provide additional details about why the assertion failed. :: - # Imagine we always want speed to be between 0 and 20 - speed = -10 + # Imagine we always want speed to be between 0 and 20. + var speed = -10 assert(speed < 20) # True, the program will continue assert(speed >= 0) # False, the program will stop - assert(speed >= 0 && speed < 20) # You can also combine the two conditional statements in one check + assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check assert(speed < 20, "speed = %f, but the speed limit is 20" % speed) # Show a message with clarifying details ---- @@ -375,10 +376,10 @@ Rounds ``s`` upward (towards positive infinity), returning the smallest whole nu :: - i = ceil(1.45) # i is 2 - i = ceil(1.001) # i is 2 + a = ceil(1.45) # a is 2.0 + a = ceil(1.001) # a is 2.0 -See also :ref:`floor`, :ref:`round`, and :ref:`stepify`. +See also :ref:`floor`, :ref:`round`, :ref:`stepify`, and :ref:`int`. ---- @@ -406,13 +407,9 @@ Clamps ``value`` and returns a value not less than ``min`` and not more than ``m :: - speed = 1000 - # a is 20 - a = clamp(speed, 1, 20) - - speed = -10 - # a is 1 - a = clamp(speed, 1, 20) + a = clamp(1000, 1, 20) # a is 20 + a = clamp(-10, 1, 20) # a is 1 + a = clamp(15, 1, 20) # a is 15 ---- @@ -441,9 +438,8 @@ Returns the cosine of angle ``s`` in radians. :: - # Prints 1 then -1 - print(cos(PI * 2)) - print(cos(PI)) + a = cos(TAU) # a is 1.0 + a = cos(PI) # a is -1.0 ---- @@ -455,8 +451,7 @@ Returns the hyperbolic cosine of ``s`` in radians. :: - # Prints 1.543081 - print(cosh(1)) + print(cosh(1)) # Prints 1.543081 ---- @@ -484,8 +479,7 @@ Returns the result of ``value`` decreased by ``step`` \* ``amount``. :: - # a = 59 - a = dectime(60, 10, 0.1)) + a = dectime(60, 10, 0.1)) # a is 59.0 ---- @@ -497,8 +491,7 @@ Converts an angle expressed in degrees to radians. :: - # r is 3.141593 - r = deg2rad(180) + r = deg2rad(180) # r is 3.141593 ---- @@ -506,7 +499,7 @@ Converts an angle expressed in degrees to radians. - :ref:`Object` **dict2inst** **(** :ref:`Dictionary` dict **)** -Converts a previously converted instance to a dictionary, back into an instance. Useful for deserializing. +Converts a dictionary (previously created with :ref:`inst2dict`) back to an instance. Useful for deserializing. ---- @@ -542,14 +535,13 @@ Rounds ``s`` downward (towards negative infinity), returning the largest whole n :: - # a is 2.0 - a = floor(2.99) - # a is -3.0 - a = floor(-2.99) + a = floor(2.45) # a is 2.0 + a = floor(2.99) # a is 2.0 + a = floor(-2.99) # a is -3.0 -See also :ref:`ceil`, :ref:`round`, and :ref:`stepify`. +See also :ref:`ceil`, :ref:`round`, :ref:`stepify`, and :ref:`int`. -**Note:** This method returns a float. If you need an integer, you can use ``int(s)`` directly. +**Note:** This method returns a float. If you need an integer and ``s`` is a non-negative number, you can use ``int(s)`` directly. ---- @@ -561,8 +553,7 @@ Returns the floating-point remainder of ``a/b``, keeping the sign of ``a``. :: - # Remainder is 1.5 - var remainder = fmod(7, 5.5) + r = fmod(7, 5.5) # r is 1.5 For the integer remainder operation, use the % operator. @@ -826,6 +817,8 @@ Loads a resource from the filesystem located at ``path``. The resource is loaded **Important:** The path must be absolute, a local path will just return ``null``. +This method is a simplified version of :ref:`ResourceLoader.load`, which can be used for more advanced scenarios. + ---- .. _class_@GDScript_method_log: @@ -951,7 +944,7 @@ Returns the integer modulus of ``a/b`` that wraps equally in positive and negati :: for i in range(-3, 4): - print("%2.0f %2.0f %2.0f" % [i, i % 3, posmod(i, 3)]) + print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) Produces: @@ -971,11 +964,11 @@ Produces: - :ref:`float` **pow** **(** :ref:`float` base, :ref:`float` exp **)** -Returns the result of ``x`` raised to the power of ``y``. +Returns the result of ``base`` raised to the power of ``exp``. :: - pow(2, 5) # Returns 32 + pow(2, 5) # Returns 32.0 ---- @@ -998,12 +991,14 @@ Returns a :ref:`Resource` from the filesystem located at ``path` - void **print** **(** ... **)** |vararg| -Converts one or more arguments to strings in the best way possible and prints them to the console. +Converts one or more arguments of any type to string in the best way possible and prints them to the console. :: a = [1, 2, 3] - print("a", "b", a) # Prints ab[1, 2, 3] + print("a", "=", a) # Prints a=[1, 2, 3] + +**Note:** Consider using :ref:`push_error` and :ref:`push_warning` to print error and warning messages instead of :ref:`print`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. ---- @@ -1091,6 +1086,8 @@ Pushes an error message to Godot's built-in debugger and to the OS terminal. push_error("test error") # Prints "test error" to debugger and terminal as error call +**Note:** Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use ``assert(false, "test error")`` instead. + ---- .. _class_@GDScript_method_push_warning: @@ -1113,7 +1110,7 @@ Converts an angle expressed in radians to degrees. :: - rad2deg(0.523599) # Returns 30 + rad2deg(0.523599) # Returns 30.0 ---- @@ -1219,9 +1216,11 @@ Rounds ``s`` to the nearest whole number, with halfway cases rounded away from z :: - round(2.6) # Returns 3 + a = round(2.49) # a is 2.0 + a = round(2.5) # a is 3.0 + a = round(2.51) # a is 3.0 -See also :ref:`floor`, :ref:`ceil`, and :ref:`stepify`. +See also :ref:`floor`, :ref:`ceil`, :ref:`stepify`, and :ref:`int`. ---- @@ -1285,9 +1284,10 @@ Returns a number smoothly interpolated between the ``from`` and ``to``, based on :: - smoothstep(0, 2, 0.5) # Returns 0.15 - smoothstep(0, 2, 1.0) # Returns 0.5 - smoothstep(0, 2, 2.0) # Returns 1.0 + smoothstep(0, 2, -5.0) # Returns 0.0 + smoothstep(0, 2, 0.5) # Returns 0.15625 + smoothstep(0, 2, 1.0) # Returns 0.5 + smoothstep(0, 2, 2.0) # Returns 1.0 ---- @@ -1313,12 +1313,9 @@ Returns the position of the first non-zero digit, after the decimal point. Note :: - # n is 0 - n = step_decimals(5) - # n is 4 - n = step_decimals(1.0005) - # n is 9 - n = step_decimals(0.000000005) + n = step_decimals(5) # n is 0 + n = step_decimals(1.0005) # n is 4 + n = step_decimals(0.000000005) # n is 9 ---- @@ -1330,10 +1327,10 @@ Snaps float value ``s`` to a given ``step``. This can also be used to round a fl :: - stepify(100, 32) # Returns 96 + stepify(100, 32) # Returns 96.0 stepify(3.14159, 0.01) # Returns 3.14 -See also :ref:`ceil`, :ref:`floor`, and :ref:`round`. +See also :ref:`ceil`, :ref:`floor`, :ref:`round`, and :ref:`int`. ---- @@ -1341,7 +1338,7 @@ See also :ref:`ceil`, :ref:`floor` **str** **(** ... **)** |vararg| -Converts one or more arguments to string in the best way possible. +Converts one or more arguments of any type to string in the best way possible. :: @@ -1386,8 +1383,8 @@ Returns the hyperbolic tangent of ``s``. :: - a = log(2.0) # Returns 0.693147 - tanh(a) # Returns 0.6 + a = log(2.0) # a is 0.693147 + b = tanh(a) # b is 0.6 ---- diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index a42aeb725..8a75749a5 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -1678,10 +1678,10 @@ Since :ref:`OK` has value 0, and all other failu var err = method_that_returns_error() if err != OK: - print("Failure!) + print("Failure!") # Or, equivalent: if err: - print("Still failing!) + print("Still failing!") - **FAILED** = **1** --- Generic error. diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 96a227d5b..ee3f8f653 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -14,13 +14,21 @@ Axis-Aligned Bounding Box. Description ----------- -AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. +``AABB`` consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + +It uses floating-point coordinates. The 2D counterpart to ``AABB`` is :ref:`Rect2`. + +**Note:** Unlike :ref:`Rect2`, ``AABB`` does not have a variant that uses integer coordinates. Tutorials --------- - :doc:`../tutorials/math/index` +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + Properties ---------- diff --git a/classes/class_animatedsprite.rst b/classes/class_animatedsprite.rst index 7fbcada43..fc540f3ad 100644 --- a/classes/class_animatedsprite.rst +++ b/classes/class_animatedsprite.rst @@ -25,6 +25,8 @@ Tutorials - :doc:`../tutorials/2d/2d_sprite_animation` +- `https://godotengine.org/asset-library/asset/515 `_ + Properties ---------- diff --git a/classes/class_animation.rst b/classes/class_animation.rst index f67aea8b5..1aed18170 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -164,6 +164,8 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`UpdateMode` | :ref:`value_track_get_update_mode` **(** :ref:`int` track_idx **)** |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`value_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`value_track_set_update_mode` **(** :ref:`int` track_idx, :ref:`UpdateMode` mode **)** | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -767,6 +769,14 @@ Returns the update mode of a value track. ---- +.. _class_Animation_method_value_track_interpolate: + +- :ref:`Variant` **value_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| + +Returns the interpolated value at the given time (in seconds). The ``track_idx`` must be the index of a value track. + +---- + .. _class_Animation_method_value_track_set_update_mode: - void **value_track_set_update_mode** **(** :ref:`int` track_idx, :ref:`UpdateMode` mode **)** diff --git a/classes/class_animationnodeadd3.rst b/classes/class_animationnodeadd3.rst index a3f4cd3ab..7020fa342 100644 --- a/classes/class_animationnodeadd3.rst +++ b/classes/class_animationnodeadd3.rst @@ -31,6 +31,8 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_animationnodeanimation.rst b/classes/class_animationnodeanimation.rst index 730ca765d..68c3a0042 100644 --- a/classes/class_animationnodeanimation.rst +++ b/classes/class_animationnodeanimation.rst @@ -23,6 +23,10 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_animationnodeblend2.rst b/classes/class_animationnodeblend2.rst index 789cfdd5b..1787f74c1 100644 --- a/classes/class_animationnodeblend2.rst +++ b/classes/class_animationnodeblend2.rst @@ -23,6 +23,10 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_animationnodeblendspace2d.rst b/classes/class_animationnodeblendspace2d.rst index 27c56981e..fd6efff39 100644 --- a/classes/class_animationnodeblendspace2d.rst +++ b/classes/class_animationnodeblendspace2d.rst @@ -27,6 +27,8 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_animationnodeoneshot.rst b/classes/class_animationnodeoneshot.rst index b64304ac2..a4bae9caa 100644 --- a/classes/class_animationnodeoneshot.rst +++ b/classes/class_animationnodeoneshot.rst @@ -23,6 +23,8 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_animationnodeoutput.rst b/classes/class_animationnodeoutput.rst index b4135fce8..9c065af3f 100644 --- a/classes/class_animationnodeoutput.rst +++ b/classes/class_animationnodeoutput.rst @@ -18,6 +18,10 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + .. |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_animationnodestatemachineplayback.rst b/classes/class_animationnodestatemachineplayback.rst index 60decaf41..3f7e4f4ed 100644 --- a/classes/class_animationnodestatemachineplayback.rst +++ b/classes/class_animationnodestatemachineplayback.rst @@ -40,23 +40,33 @@ Properties Methods ------- -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_current_node` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_travel_path` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`start` **(** :ref:`String` node **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`stop` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`travel` **(** :ref:`String` to_node **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_current_length` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_node` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_current_play_position` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_travel_path` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`start` **(** :ref:`String` node **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`travel` **(** :ref:`String` to_node **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- +.. _class_AnimationNodeStateMachinePlayback_method_get_current_length: + +- :ref:`float` **get_current_length** **(** **)** |const| + +---- + .. _class_AnimationNodeStateMachinePlayback_method_get_current_node: - :ref:`String` **get_current_node** **(** **)** |const| @@ -65,6 +75,14 @@ Returns the currently playing animation state. ---- +.. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position: + +- :ref:`float` **get_current_play_position** **(** **)** |const| + +Returns the playback position within the current animation state. + +---- + .. _class_AnimationNodeStateMachinePlayback_method_get_travel_path: - :ref:`PoolStringArray` **get_travel_path** **(** **)** |const| diff --git a/classes/class_animationnodestatemachinetransition.rst b/classes/class_animationnodestatemachinetransition.rst index 096727e65..6ba02cc43 100644 --- a/classes/class_animationnodestatemachinetransition.rst +++ b/classes/class_animationnodestatemachinetransition.rst @@ -78,7 +78,7 @@ Property Descriptions | *Getter* | get_advance_condition() | +-----------+------------------------------+ -Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree` that can be controlled from code (see `https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code `_). For example, if :ref:`AnimationTree.tree_root` is an :ref:`AnimationNodeStateMachine` and :ref:`advance_condition` is set to ``"idle"``: +Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree` that can be controlled from code (see `https://docs.godotengine.org/en/3.2/tutorials/animation/animation_tree.html#controlling-from-code `_). For example, if :ref:`AnimationTree.tree_root` is an :ref:`AnimationNodeStateMachine` and :ref:`advance_condition` is set to ``"idle"``: :: diff --git a/classes/class_animationnodetimescale.rst b/classes/class_animationnodetimescale.rst index 660c17993..e09a2e73b 100644 --- a/classes/class_animationnodetimescale.rst +++ b/classes/class_animationnodetimescale.rst @@ -23,6 +23,8 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/125 `_ + .. |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_animationnodetransition.rst b/classes/class_animationnodetransition.rst index ed1ba133b..b2a04a706 100644 --- a/classes/class_animationnodetransition.rst +++ b/classes/class_animationnodetransition.rst @@ -23,6 +23,10 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index fb3e3b63a..31a459463 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -25,11 +25,11 @@ Updating the target properties of animations occurs at process time. Tutorials --------- -- :doc:`../getting_started/step_by_step/animations` +- :doc:`../tutorials/animation/index` - :doc:`../tutorials/2d/2d_sprite_animation` -- :doc:`../tutorials/animation/index` +- `https://godotengine.org/asset-library/asset/678 `_ Properties ---------- diff --git a/classes/class_animationtree.rst b/classes/class_animationtree.rst index 9bd115122..b4f25287c 100644 --- a/classes/class_animationtree.rst +++ b/classes/class_animationtree.rst @@ -23,7 +23,7 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` -- `https://github.com/godotengine/tps-demo `_ +- `https://godotengine.org/asset-library/asset/678 `_ Properties ---------- diff --git a/classes/class_area.rst b/classes/class_area.rst index 883f82e80..34fa96cf5 100644 --- a/classes/class_area.rst +++ b/classes/class_area.rst @@ -18,6 +18,13 @@ Description 3D area that detects :ref:`CollisionObject` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/127 `_ + Properties ---------- @@ -195,7 +202,9 @@ Property Descriptions | *Getter* | get_angular_damp() | +-----------+-------------------------+ -The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). +The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. + +See :ref:`ProjectSettings.physics/3d/default_angular_damp` for more details about damping. ---- @@ -243,7 +252,7 @@ If ``true``, the area's audio bus overrides the default audio bus. | *Getter* | get_collision_layer() | +-----------+----------------------------+ -The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also :ref:`collision_mask`. See `Collision layers and masks `_ in the documentation for more information. +The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also :ref:`collision_mask`. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -259,7 +268,7 @@ The area's physics layer(s). Collidable objects can exist in any of 32 different | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this area scans to determine collision detection. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this area scans to determine collision detection. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -339,7 +348,9 @@ The area's gravity vector (not normalized). If gravity is a point (see :ref:`gra | *Getter* | get_linear_damp() | +-----------+------------------------+ -The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). +The rate at which objects stop moving in this area. Represents the linear velocity lost per second. + +See :ref:`ProjectSettings.physics/3d/default_linear_damp` for more details about damping. ---- diff --git a/classes/class_area2d.rst b/classes/class_area2d.rst index b0f0ee70e..29cff2815 100644 --- a/classes/class_area2d.rst +++ b/classes/class_area2d.rst @@ -23,6 +23,12 @@ Tutorials - :doc:`../tutorials/physics/using_area_2d` +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/121 `_ + +- `https://godotengine.org/asset-library/asset/120 `_ + Properties ---------- @@ -192,7 +198,9 @@ Property Descriptions | *Getter* | get_angular_damp() | +-----------+-------------------------+ -The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). +The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. + +See :ref:`ProjectSettings.physics/2d/default_angular_damp` for more details about damping. ---- @@ -240,7 +248,7 @@ If ``true``, the area's audio bus overrides the default audio bus. | *Getter* | get_collision_layer() | +-----------+----------------------------+ -The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also :ref:`collision_mask`. See `Collision layers and masks `_ in the documentation for more information. +The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also :ref:`collision_mask`. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -256,7 +264,7 @@ The area's physics layer(s). Collidable objects can exist in any of 32 different | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this area scans to determine collision detection. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this area scans to determine collision detection. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -336,7 +344,9 @@ The area's gravity vector (not normalized). If gravity is a point (see :ref:`gra | *Getter* | get_linear_damp() | +-----------+------------------------+ -The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). +The rate at which objects stop moving in this area. Represents the linear velocity lost per second. + +See :ref:`ProjectSettings.physics/2d/default_linear_damp` for more details about damping. ---- diff --git a/classes/class_array.rst b/classes/class_array.rst index 5c882b398..3d2e9380e 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -35,8 +35,12 @@ Arrays can be concatenated using the ``+`` operator: var array2 = [3, "Four"] print(array1 + array2) # ["One", 2, 3, "Four"] +**Note:** Concatenating with the ``+=`` operator will create a new array, which has a cost. If you want to append another array to an existing array, :ref:`append_array` is more efficient. + **Note:** Arrays are always passed by reference. To get a copy of an array which can be modified independently of the original array, use :ref:`duplicate`. +**Note:** When declaring an array with ``const``, the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using ``const`` will only prevent assigning the constant with another value after it was initialized. + Methods ------- @@ -57,6 +61,8 @@ Methods +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append` **(** :ref:`Variant` value **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`Array` array **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`back` **(** **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`bsearch` **(** :ref:`Variant` value, :ref:`bool` before=true **)** | @@ -171,6 +177,21 @@ Appends an element at the end of the array (alias of :ref:`push_back` array **)** + +Appends another array at the end of this array. + +:: + + var array1 = [1, 2, 3] + var array2 = [4, 5, 6] + array1.append_array(array2) + print(array1) # Prints [1, 2, 3, 4, 5, 6]. + +---- + .. _class_Array_method_back: - :ref:`Variant` **back** **(** **)** @@ -344,7 +365,7 @@ Removes and returns the last element of the array. Returns ``null`` if the array - :ref:`Variant` **pop_front** **(** **)** -Removes and returns the first element of the array. Returns ``null`` if the array is empty, wwithout printing an error message. +Removes and returns the first element of the array. Returns ``null`` if the array is empty, without printing an error message. ---- diff --git a/classes/class_arvrinterface.rst b/classes/class_arvrinterface.rst index eba45143b..354121545 100644 --- a/classes/class_arvrinterface.rst +++ b/classes/class_arvrinterface.rst @@ -11,7 +11,7 @@ ARVRInterface **Inherits:** :ref:`Reference` **<** :ref:`Object` -**Inherited By:** :ref:`ARVRInterfaceGDNative`, :ref:`MobileVRInterface` +**Inherited By:** :ref:`ARVRInterfaceGDNative`, :ref:`MobileVRInterface`, :ref:`WebXRInterface` Base class for an AR/VR interface implementation. diff --git a/classes/class_astar.rst b/classes/class_astar.rst index 70253903e..228c98a08 100644 --- a/classes/class_astar.rst +++ b/classes/class_astar.rst @@ -35,6 +35,8 @@ It is also possible to use non-Euclidean distances. To do so, create a class tha :ref:`_estimate_cost` should return a lower bound of the distance, i.e. ``_estimate_cost(u, v) <= _compute_cost(u, v)``. This serves as a hint to the algorithm because the custom ``_compute_cost`` might be computation-heavy. If this is not the case, make :ref:`_estimate_cost` return the same value as :ref:`_compute_cost` to provide the algorithm with the most accurate information. +If the default :ref:`_estimate_cost` and :ref:`_compute_cost` methods are used, or if the supplied :ref:`_estimate_cost` method returns a lower bound of the cost, then the paths returned by A\* will be the lowest cost paths. Here, the cost of a path equals to the sum of the :ref:`_compute_cost` results of all segments in the path multiplied by the ``weight_scale``\ s of the end points of the respective segments. If the default methods are used and the ``weight_scale``\ s of all points are set to ``1.0``, then this equals to the sum of Euclidean distances of all segments in the path. + Methods ------- @@ -117,7 +119,9 @@ 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 algorithm prefers points with lower ``weight_scale`` to form a path. 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 1 or larger. + +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. :: @@ -349,7 +353,7 @@ Sets the ``position`` for the point with the given ``id``. - void **set_point_weight_scale** **(** :ref:`int` id, :ref:`float` weight_scale **)** -Sets the ``weight_scale`` for the point with the given ``id``. +Sets the ``weight_scale`` for the point with the given ``id``. 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. .. |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_astar2d.rst b/classes/class_astar2d.rst index d273cf769..d700fab13 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -100,7 +100,9 @@ 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 algorithm prefers points with lower ``weight_scale`` to form a path. 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 1 or larger. + +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. :: @@ -332,7 +334,7 @@ Sets the ``position`` for the point with the given ``id``. - void **set_point_weight_scale** **(** :ref:`int` id, :ref:`float` weight_scale **)** -Sets the ``weight_scale`` for the point with the given ``id``. +Sets the ``weight_scale`` for the point with the given ``id``. 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. .. |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_atlastexture.rst b/classes/class_atlastexture.rst index 120a25d0f..cfb248554 100644 --- a/classes/class_atlastexture.rst +++ b/classes/class_atlastexture.rst @@ -18,6 +18,8 @@ Description :ref:`Texture` resource aimed at managing big textures files that pack multiple smaller textures. Consists of a :ref:`Texture`, a margin that defines the border width, and a region that defines the actual area of the AtlasTexture. +**Note:** AtlasTextures don't support repetition. The :ref:`Texture.FLAG_REPEAT` and :ref:`Texture.FLAG_MIRRORED_REPEAT` flags are ignored when using an AtlasTexture. + Properties ---------- diff --git a/classes/class_audioeffect.rst b/classes/class_audioeffect.rst index fd24b78f7..4263ecd6c 100644 --- a/classes/class_audioeffect.rst +++ b/classes/class_audioeffect.rst @@ -20,6 +20,11 @@ Description Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/527 `_ + .. |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_audioeffecthighshelffilter.rst b/classes/class_audioeffecthighshelffilter.rst index 093f89fae..90158451f 100644 --- a/classes/class_audioeffecthighshelffilter.rst +++ b/classes/class_audioeffecthighshelffilter.rst @@ -11,7 +11,12 @@ AudioEffectHighShelfFilter **Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Reduces all frequencies above the :ref:`AudioEffectFilter.cutoff_hz`. +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_buses` .. |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_audioeffectlowshelffilter.rst b/classes/class_audioeffectlowshelffilter.rst index b798f0dfa..6bb5f49db 100644 --- a/classes/class_audioeffectlowshelffilter.rst +++ b/classes/class_audioeffectlowshelffilter.rst @@ -11,7 +11,12 @@ AudioEffectLowShelfFilter **Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Reduces all frequencies below the :ref:`AudioEffectFilter.cutoff_hz`. +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_buses` .. |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_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst index 3d93f27b8..7db192fbe 100644 --- a/classes/class_audioeffectrecord.rst +++ b/classes/class_audioeffectrecord.rst @@ -23,6 +23,8 @@ Tutorials - :doc:`../tutorials/audio/recording_with_microphone` +- `https://godotengine.org/asset-library/asset/527 `_ + Properties ---------- diff --git a/classes/class_audioeffectreverb.rst b/classes/class_audioeffectreverb.rst index 824052c64..f65e0b69f 100644 --- a/classes/class_audioeffectreverb.rst +++ b/classes/class_audioeffectreverb.rst @@ -20,6 +20,11 @@ Description Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_audioserver.rst b/classes/class_audioserver.rst index 7ae33334b..f5ce2ff29 100644 --- a/classes/class_audioserver.rst +++ b/classes/class_audioserver.rst @@ -23,6 +23,12 @@ Tutorials - :doc:`../tutorials/audio/audio_buses` +- `https://godotengine.org/asset-library/asset/525 `_ + +- `https://godotengine.org/asset-library/asset/527 `_ + +- `https://godotengine.org/asset-library/asset/528 `_ + Properties ---------- diff --git a/classes/class_audiostream.rst b/classes/class_audiostream.rst index 6799dad5d..207cdb6d5 100644 --- a/classes/class_audiostream.rst +++ b/classes/class_audiostream.rst @@ -11,7 +11,7 @@ AudioStream **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` -**Inherited By:** :ref:`AudioStreamGenerator`, :ref:`AudioStreamMicrophone`, :ref:`AudioStreamOGGVorbis`, :ref:`AudioStreamRandomPitch`, :ref:`AudioStreamSample` +**Inherited By:** :ref:`AudioStreamGenerator`, :ref:`AudioStreamMP3`, :ref:`AudioStreamMicrophone`, :ref:`AudioStreamOGGVorbis`, :ref:`AudioStreamRandomPitch`, :ref:`AudioStreamSample` Base class for audio streams. @@ -25,6 +25,12 @@ Tutorials - :doc:`../tutorials/audio/audio_streams` +- `https://godotengine.org/asset-library/asset/526 `_ + +- `https://godotengine.org/asset-library/asset/527 `_ + +- `https://godotengine.org/asset-library/asset/528 `_ + Methods ------- diff --git a/classes/class_audiostreamgenerator.rst b/classes/class_audiostreamgenerator.rst index d357a01f8..34d55b324 100644 --- a/classes/class_audiostreamgenerator.rst +++ b/classes/class_audiostreamgenerator.rst @@ -16,7 +16,7 @@ AudioStreamGenerator Tutorials --------- -- `https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator `_ +- `https://godotengine.org/asset-library/asset/526 `_ Properties ---------- diff --git a/classes/class_audiostreammp3.rst b/classes/class_audiostreammp3.rst new file mode 100644 index 000000000..df5990bff --- /dev/null +++ b/classes/class_audiostreammp3.rst @@ -0,0 +1,83 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamMP3.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamMP3: + +AudioStreamMP3 +============== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +MP3 audio stream driver. + +Description +----------- + +MP3 audio stream driver. + +Properties +---------- + ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`data` | ``PoolByteArray( )`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`loop` | ``false`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`loop_offset` | ``0.0`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioStreamMP3_property_data: + +- :ref:`PoolByteArray` **data** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_data(value) | ++-----------+-----------------------+ +| *Getter* | get_data() | ++-----------+-----------------------+ + +Contains the audio data in bytes. + +---- + +.. _class_AudioStreamMP3_property_loop: + +- :ref:`bool` **loop** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_loop(value) | ++-----------+-----------------+ +| *Getter* | has_loop() | ++-----------+-----------------+ + +If ``true``, the stream will automatically loop when it reaches the end. + +---- + +.. _class_AudioStreamMP3_property_loop_offset: + +- :ref:`float` **loop_offset** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_loop_offset(value) | ++-----------+------------------------+ +| *Getter* | get_loop_offset() | ++-----------+------------------------+ + +Time in seconds at which the stream starts after being looped. + +.. |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_audiostreamplayback.rst b/classes/class_audiostreamplayback.rst index 1a76f4d2b..17581a9a6 100644 --- a/classes/class_audiostreamplayback.rst +++ b/classes/class_audiostreamplayback.rst @@ -20,6 +20,11 @@ Description Can play, loop, pause a scroll through audio. See :ref:`AudioStream` and :ref:`AudioStreamOGGVorbis` for usage. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/526 `_ + .. |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_audiostreamplayer.rst b/classes/class_audiostreamplayer.rst index ca8e65cde..6c3769536 100644 --- a/classes/class_audiostreamplayer.rst +++ b/classes/class_audiostreamplayer.rst @@ -23,6 +23,16 @@ Tutorials - :doc:`../tutorials/audio/audio_streams` +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/525 `_ + +- `https://godotengine.org/asset-library/asset/526 `_ + +- `https://godotengine.org/asset-library/asset/527 `_ + +- `https://godotengine.org/asset-library/asset/528 `_ + Properties ---------- diff --git a/classes/class_audiostreamplayer3d.rst b/classes/class_audiostreamplayer3d.rst index 984a1b3c3..d35de4ace 100644 --- a/classes/class_audiostreamplayer3d.rst +++ b/classes/class_audiostreamplayer3d.rst @@ -16,7 +16,7 @@ Plays 3D sound in 3D space. Description ----------- -Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. +Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting :ref:`attenuation_filter_cutoff_hz` to ``20500``. By default, audio is heard from the camera position. This can be changed by adding a :ref:`Listener` node to the scene and enabling it by calling :ref:`Listener.make_current` on it. @@ -113,7 +113,7 @@ enum **AttenuationModel**: - **ATTENUATION_LOGARITHMIC** = **2** --- Logarithmic dampening of loudness according to distance. -- **ATTENUATION_DISABLED** = **3** --- No dampening of loudness according to distance. +- **ATTENUATION_DISABLED** = **3** --- No dampening of loudness according to distance. The sound will still be heard positionally, unlike an :ref:`AudioStreamPlayer`. ---- @@ -125,9 +125,9 @@ enum **AttenuationModel**: enum **OutOfRangeMode**: -- **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range. +- **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance` radius. -- **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range. +- **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance` radius. ---- @@ -178,7 +178,7 @@ Areas in which this sound plays. | *Getter* | get_attenuation_filter_cutoff_hz() | +-----------+-----------------------------------------+ -Dampens audio above this frequency, in Hz. +Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to ``20500`` as this frequency is above the human hearing limit. ---- @@ -194,7 +194,7 @@ Dampens audio above this frequency, in Hz. | *Getter* | get_attenuation_filter_db() | +-----------+----------------------------------+ -Amount how much the filter affects the loudness, in dB. +Amount how much the filter affects the loudness, in decibels. ---- @@ -226,7 +226,7 @@ Decides if audio should get quieter with distance linearly, quadratically, logar | *Getter* | is_autoplay_enabled() | +-----------+-----------------------+ -If ``true``, audio plays when added to scene tree. +If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree. ---- @@ -242,7 +242,7 @@ If ``true``, audio plays when added to scene tree. | *Getter* | get_bus() | +-----------+----------------+ -Bus on which this audio is playing. +The bus on which this audio is playing. ---- @@ -306,7 +306,7 @@ If ``true``, the audio should be dampened according to the direction of the soun | *Getter* | get_emission_angle_filter_attenuation_db() | +-----------+-------------------------------------------------+ -Dampens audio if camera is outside of :ref:`emission_angle_degrees` and :ref:`emission_angle_enabled` is set by this factor, in dB. +Dampens audio if camera is outside of :ref:`emission_angle_degrees` and :ref:`emission_angle_enabled` is set by this factor, in decibels. ---- @@ -322,7 +322,7 @@ Dampens audio if camera is outside of :ref:`emission_angle_degrees` object to be played. +The :ref:`AudioStream` resource to be played. ---- @@ -414,7 +414,7 @@ The :ref:`AudioStream` object to be played. | *Getter* | get_stream_paused() | +-----------+--------------------------+ -If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``. +If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused` to ``false``. ---- @@ -430,7 +430,7 @@ If ``true``, the playback is paused. You can resume it by setting ``stream_pause | *Getter* | get_unit_db() | +-----------+--------------------+ -Base sound level unaffected by dampening, in dB. +The base sound level unaffected by dampening, in decibels. ---- @@ -446,7 +446,7 @@ Base sound level unaffected by dampening, in dB. | *Getter* | get_unit_size() | +-----------+----------------------+ -Factor for the attenuation effect. +The factor for the attenuation effect. Higher values make the sound audible over a larger distance. Method Descriptions ------------------- diff --git a/classes/class_basebutton.rst b/classes/class_basebutton.rst index 9238d4feb..5a7aedf44 100644 --- a/classes/class_basebutton.rst +++ b/classes/class_basebutton.rst @@ -201,7 +201,7 @@ If ``true``, the button is in disabled state and can't be clicked or toggled. | *Getter* | get_enabled_focus_mode() | +-----------+-------------------------------+ -Focus access mode to use when switching between enabled/disabled (see :ref:`Control.focus_mode` and :ref:`disabled`). +*Deprecated.* This property has been deprecated due to redundancy and no longer has any effect when set. Please use :ref:`Control.focus_mode` instead. ---- diff --git a/classes/class_basis.rst b/classes/class_basis.rst index f06c96260..1f52506c7 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -25,10 +25,20 @@ For more information, read the "Matrices and transforms" documentation article. Tutorials --------- +- :doc:`../tutorials/math/index` + - :doc:`../tutorials/math/matrices_and_transforms` - :doc:`../tutorials/3d/using_transforms` +- `https://godotengine.org/asset-library/asset/584 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + +- `https://godotengine.org/asset-library/asset/583 `_ + Properties ---------- diff --git a/classes/class_boxshape.rst b/classes/class_boxshape.rst index 0b3d8ab65..0e16b075d 100644 --- a/classes/class_boxshape.rst +++ b/classes/class_boxshape.rst @@ -18,6 +18,15 @@ Description 3D box shape that can be a child of a :ref:`PhysicsBody` or :ref:`Area`. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + +- `https://godotengine.org/asset-library/asset/126 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + Properties ---------- diff --git a/classes/class_button.rst b/classes/class_button.rst index d2ac56441..8f233075d 100644 --- a/classes/class_button.rst +++ b/classes/class_button.rst @@ -35,6 +35,15 @@ Button is the standard themed button. It can contain text and an icon, and will Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/677 `_ + Properties ---------- diff --git a/classes/class_camera.rst b/classes/class_camera.rst index 31f53f819..63ee0c0b4 100644 --- a/classes/class_camera.rst +++ b/classes/class_camera.rst @@ -20,6 +20,11 @@ Description Camera is a special node that displays what is visible from its current location. Cameras register themselves in the nearest :ref:`Viewport` node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a :ref:`Viewport`, and, without one, a scene registered in that :ref:`Viewport` (or higher viewports) can't be displayed. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- @@ -477,6 +482,15 @@ Sets the camera projection to perspective mode (see :ref:`PROJECTION_PERSPECTIVE Returns the 2D coordinate in the :ref:`Viewport` rectangle that maps to the given 3D point in worldspace. +**Note:** When using this to position GUI elements over a 3D viewport, use :ref:`is_position_behind` to prevent them from appearing if the 3D point is behind the camera: + +:: + + # This code block is part of a script that inherits from Spatial. + # `control` is a reference to a node inheriting from Control. + control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin) + control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin) + .. |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_camera2d.rst b/classes/class_camera2d.rst index d0d8b98d2..2999da9a8 100644 --- a/classes/class_camera2d.rst +++ b/classes/class_camera2d.rst @@ -22,6 +22,15 @@ This node is intended to be a simple helper to get things going quickly and it m Note that the ``Camera2D`` node's ``position`` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use :ref:`get_camera_screen_center` to get the real position. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/120 `_ + +- `https://godotengine.org/asset-library/asset/112 `_ + +- `https://godotengine.org/asset-library/asset/110 `_ + Properties ---------- diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index 92fbb8751..7fac82ac4 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -37,6 +37,8 @@ Tutorials - :doc:`../tutorials/2d/custom_drawing_in_2d` +- `https://godotengine.org/asset-library/asset/528 `_ + Properties ---------- @@ -178,7 +180,7 @@ Emitted when becoming hidden. - **item_rect_changed** **(** **)** -Emitted when the item rect has changed. +Emitted when the item's :ref:`Rect2` boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing :ref:`Sprite.texture`). ---- diff --git a/classes/class_canvaslayer.rst b/classes/class_canvaslayer.rst index 1ac293fca..598028a43 100644 --- a/classes/class_canvaslayer.rst +++ b/classes/class_canvaslayer.rst @@ -27,6 +27,8 @@ Tutorials - :doc:`../tutorials/2d/canvas_layers` +- `https://godotengine.org/asset-library/asset/515 `_ + Properties ---------- diff --git a/classes/class_capsuleshape.rst b/classes/class_capsuleshape.rst index 08ad8ae7d..17e98b946 100644 --- a/classes/class_capsuleshape.rst +++ b/classes/class_capsuleshape.rst @@ -18,6 +18,11 @@ Description Capsule shape for collisions. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + Properties ---------- diff --git a/classes/class_checkbox.rst b/classes/class_checkbox.rst index be6e9f361..7ebe4b234 100644 --- a/classes/class_checkbox.rst +++ b/classes/class_checkbox.rst @@ -18,6 +18,8 @@ Description A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to :ref:`CheckButton` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has **no** immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + Properties ---------- diff --git a/classes/class_checkbutton.rst b/classes/class_checkbutton.rst index 2acd3423e..76fb93069 100644 --- a/classes/class_checkbutton.rst +++ b/classes/class_checkbutton.rst @@ -18,6 +18,8 @@ Description CheckButton is a toggle button displayed as a check field. It's similar to :ref:`CheckBox` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an **immediate** effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + Properties ---------- diff --git a/classes/class_clippedcamera.rst b/classes/class_clippedcamera.rst index a308a751b..735214e98 100644 --- a/classes/class_clippedcamera.rst +++ b/classes/class_clippedcamera.rst @@ -116,7 +116,7 @@ If ``true``, the camera stops on contact with :ref:`PhysicsBody`_ in the documentation for more information. +The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_collisionshape.rst b/classes/class_collisionshape.rst index 3f33e2ec0..d551dc1d2 100644 --- a/classes/class_collisionshape.rst +++ b/classes/class_collisionshape.rst @@ -23,6 +23,12 @@ Tutorials - :doc:`../tutorials/physics/physics_introduction` +- `https://godotengine.org/asset-library/asset/126 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_collisionshape2d.rst b/classes/class_collisionshape2d.rst index e0d5f2839..625b97e77 100644 --- a/classes/class_collisionshape2d.rst +++ b/classes/class_collisionshape2d.rst @@ -23,6 +23,12 @@ Tutorials - :doc:`../tutorials/physics/physics_introduction` +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/121 `_ + +- `https://godotengine.org/asset-library/asset/113 `_ + Properties ---------- diff --git a/classes/class_color.rst b/classes/class_color.rst index 9105e4b33..1862a23ca 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -22,6 +22,17 @@ If you want to supply values in a range of 0 to 255, you should use :ref:`@GDScr **Note:** In a boolean context, a Color will evaluate to ``false`` if it's equal to ``Color(0, 0, 0, 1)`` (opaque black). Otherwise, a Color will always evaluate to ``true``. +`Color constants cheatsheet `_ + +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/517 `_ + +- `https://godotengine.org/asset-library/asset/146 `_ + +- `https://godotengine.org/asset-library/asset/133 `_ + Properties ---------- @@ -835,31 +846,31 @@ Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. - :ref:`Color` **Color** **(** :ref:`int` from **)** -Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile). +Constructs a color from a 32-bit integer in RGBA format (each byte represents a color channel). :: - var c = Color(274) # Equivalent to RGBA(0, 0, 1, 18) + var c = Color(274) # Similar to Color(0.0, 0.0, 0.004, 0.07) ---- - :ref:`Color` **Color** **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** -Constructs a color from an RGB profile using values between 0 and 1. Alpha will always be 1. +Constructs a color from RGB values, typically between 0 and 1. Alpha will be 1. :: - var c = Color(0.2, 1.0, 0.7) # Equivalent to RGBA(51, 255, 178, 255) + var color = Color(0.2, 1.0, 0.7) # Similar to Color8(51, 255, 178, 255) ---- - :ref:`Color` **Color** **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** -Constructs a color from an RGBA profile using values between 0 and 1. +Constructs a color from RGBA values, typically between 0 and 1. :: - var c = Color(0.2, 1.0, 0.7, 0.8) # Equivalent to RGBA(51, 255, 178, 204) + var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to Color8(51, 255, 178, 204) ---- @@ -938,8 +949,8 @@ Returns the inverted color ``(1 - r, 1 - g, 1 - b, a)``. :: - var c = Color(0.3, 0.4, 0.9) - var inverted_color = c.inverted() # A color of an RGBA(178, 153, 26, 255) + var color = Color(0.3, 0.4, 0.9) + var inverted_color = color.inverted() # Equivalent to Color(0.7, 0.6, 0.1) ---- @@ -974,7 +985,7 @@ Returns the linear interpolation with another color. The interpolation factor `` var c1 = Color(1.0, 0.0, 0.0) var c2 = Color(0.0, 1.0, 0.0) - var li_c = c1.linear_interpolate(c2, 0.5) # A color of an RGBA(128, 128, 0, 255) + var li_c = c1.linear_interpolate(c2, 0.5) # Equivalent to Color(0.5, 0.5, 0.0) ---- @@ -982,12 +993,12 @@ Returns the linear interpolation with another color. The interpolation factor `` - :ref:`int` **to_abgr32** **(** **)** -Returns the color's 32-bit integer in ABGR format (each byte represents a component of the ABGR profile). ABGR is the reversed version of the default format. +Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format. :: - var c = Color(1, 0.5, 0.2) - print(c.to_abgr32()) # Prints 4281565439 + var color = Color(1, 0.5, 0.2) + print(color.to_abgr32()) # Prints 4281565439 ---- @@ -995,12 +1006,12 @@ Returns the color's 32-bit integer in ABGR format (each byte represents a compon - :ref:`int` **to_abgr64** **(** **)** -Returns the color's 64-bit integer in ABGR format (each word represents a component of the ABGR profile). ABGR is the reversed version of the default format. +Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format. :: - var c = Color(1, 0.5, 0.2) - print(c.to_abgr64()) # Prints -225178692812801 + var color = Color(1, 0.5, 0.2) + print(color.to_abgr64()) # Prints -225178692812801 ---- @@ -1008,12 +1019,12 @@ Returns the color's 64-bit integer in ABGR format (each word represents a compon - :ref:`int` **to_argb32** **(** **)** -Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). ARGB is more compatible with DirectX. +Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX. :: - var c = Color(1, 0.5, 0.2) - print(c.to_argb32()) # Prints 4294934323 + var color = Color(1, 0.5, 0.2) + print(color.to_argb32()) # Prints 4294934323 ---- @@ -1021,12 +1032,12 @@ Returns the color's 32-bit integer in ARGB format (each byte represents a compon - :ref:`int` **to_argb64** **(** **)** -Returns the color's 64-bit integer in ARGB format (each word represents a component of the ARGB profile). ARGB is more compatible with DirectX. +Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX. :: - var c = Color(1, 0.5, 0.2) - print(c.to_argb64()) # Prints -2147470541 + var color = Color(1, 0.5, 0.2) + print(color.to_argb64()) # Prints -2147470541 ---- @@ -1050,12 +1061,12 @@ Setting ``with_alpha`` to ``false`` excludes alpha from the hexadecimal string. - :ref:`int` **to_rgba32** **(** **)** -Returns the color's 32-bit integer in RGBA format (each byte represents a component of the RGBA profile). RGBA is Godot's default format. +Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default format. :: - var c = Color(1, 0.5, 0.2) - print(c.to_rgba32()) # Prints 4286526463 + var color = Color(1, 0.5, 0.2) + print(color.to_rgba32()) # Prints 4286526463 ---- @@ -1063,12 +1074,12 @@ Returns the color's 32-bit integer in RGBA format (each byte represents a compon - :ref:`int` **to_rgba64** **(** **)** -Returns the color's 64-bit integer in RGBA format (each word represents a component of the RGBA profile). RGBA is Godot's default format. +Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default format. :: - var c = Color(1, 0.5, 0.2) - print(c.to_rgba64()) # Prints -140736629309441 + var color = Color(1, 0.5, 0.2) + print(color.to_rgba64()) # Prints -140736629309441 .. |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_colorpicker.rst b/classes/class_colorpicker.rst index 5ef38730e..baa424584 100644 --- a/classes/class_colorpicker.rst +++ b/classes/class_colorpicker.rst @@ -18,6 +18,11 @@ Description :ref:`Control` node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/146 `_ + Properties ---------- diff --git a/classes/class_colorpickerbutton.rst b/classes/class_colorpickerbutton.rst index 088f59d4f..d5203deff 100644 --- a/classes/class_colorpickerbutton.rst +++ b/classes/class_colorpickerbutton.rst @@ -18,6 +18,15 @@ Description Encapsulates a :ref:`ColorPicker` making it accessible by pressing a button. Pressing the button will toggle the :ref:`ColorPicker` visibility. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/133 `_ + +- `https://godotengine.org/asset-library/asset/517 `_ + Properties ---------- diff --git a/classes/class_colorrect.rst b/classes/class_colorrect.rst index 925c0e7ee..387e5da6b 100644 --- a/classes/class_colorrect.rst +++ b/classes/class_colorrect.rst @@ -16,7 +16,12 @@ Colored rectangle. Description ----------- -Displays a colored rectangle. +Displays a rectangle filled with a solid :ref:`color`. If you need to display the border alone, consider using :ref:`ReferenceRect` instead. + +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/515 `_ Properties ---------- diff --git a/classes/class_concavepolygonshape.rst b/classes/class_concavepolygonshape.rst index 69eeb16b7..1f52e0ef7 100644 --- a/classes/class_concavepolygonshape.rst +++ b/classes/class_concavepolygonshape.rst @@ -20,6 +20,11 @@ Concave polygon shape resource, which can be set into a :ref:`PhysicsBody` nodes like :ref:`StaticBody` and will not work with :ref:`KinematicBody` or :ref:`RigidBody` with a mode other than Static. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + Methods ------- diff --git a/classes/class_conetwistjoint.rst b/classes/class_conetwistjoint.rst index 3376fdfac..47fc9b539 100644 --- a/classes/class_conetwistjoint.rst +++ b/classes/class_conetwistjoint.rst @@ -11,7 +11,7 @@ ConeTwistJoint **Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -A twist joint between two 3D bodies. +A twist joint between two 3D PhysicsBodies. Description ----------- @@ -20,7 +20,7 @@ The joint can rotate the bodies across an axis defined by the local x-axes of th The twist axis is initiated as the X axis of the :ref:`Joint`. -Once the Bodies swing, the twist axis is calculated as the middle of the x-axes of the Joint in the local space of the two Bodies. +Once the Bodies swing, the twist axis is calculated as the middle of the x-axes of the Joint in the local space of the two Bodies. See also :ref:`Generic6DOFJoint`. Properties ---------- diff --git a/classes/class_control.rst b/classes/class_control.rst index fbbd22f40..628ba60d0 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -41,6 +41,8 @@ Tutorials - :doc:`../tutorials/2d/custom_drawing_in_2d` +- `https://github.com/godotengine/godot-demo-projects/tree/master/gui `_ + Properties ---------- @@ -120,7 +122,7 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_gui_input` **(** :ref:`InputEvent` event **)** |virtual| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Object` | :ref:`_make_custom_tooltip` **(** :ref:`String` for_text **)** |virtual| | +| :ref:`Control` | :ref:`_make_custom_tooltip` **(** :ref:`String` for_text **)** |virtual| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`accept_event` **(** **)** | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -146,11 +148,11 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_begin` **(** **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_combined_minimum_size` **(** **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`CursorShape` | :ref:`get_cursor_shape` **(** :ref:`Vector2` position=Vector2( 0, 0 ) **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -162,11 +164,11 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`get_focus_owner` **(** **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_global_rect` **(** **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_margin` **(** :ref:`Margin` margin **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -180,7 +182,7 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_rotation` **(** **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_tooltip` **(** :ref:`Vector2` at_position=Vector2( 0, 0 ) **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -188,21 +190,21 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`grab_focus` **(** **)** | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_color_override` **(** :ref:`String` name **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_constant_override` **(** :ref:`String` name **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_focus` **(** **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_font_override` **(** :ref:`String` name **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_icon_override` **(** :ref:`String` name **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -210,7 +212,7 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_shader_override` **(** :ref:`String` name **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` type="" **)** |const| | +| :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_stylebox_override` **(** :ref:`String` name **)** |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -845,6 +847,17 @@ Controls the direction on the vertical axis in which the control should grow if Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the :ref:`mouse_filter` property is not :ref:`MOUSE_FILTER_IGNORE`. You can change the time required for the tooltip to appear with ``gui/timers/tooltip_delay_sec`` option in Project Settings. +The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding :ref:`_make_custom_tooltip`. The default tooltip includes a :ref:`PopupPanel` and :ref:`Label` whose theme properties can be customized using :ref:`Theme` methods with the ``"TooltipPanel"`` and ``"TooltipLabel"`` respectively. For example: + +:: + + var style_box = StyleBoxFlat.new() + style_box.set_bg_color(Color(1, 1, 0)) + style_box.set_border_width_all(2) + # We assume here that the `theme` property has been assigned a custom Theme beforehand. + theme.set_stylebox("panel", "TooltipPanel", style_box) + theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1)) + ---- .. _class_Control_property_margin_bottom: @@ -1057,7 +1070,7 @@ The node's rotation around its pivot, in degrees. See :ref:`rect_pivot_offset`. Change this property to scale the node around its :ref:`rect_pivot_offset`. The Control's :ref:`hint_tooltip` will also scale according to this value. -**Note:** This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the `documentation `_ instead of scaling Controls individually. +**Note:** This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the `documentation `_ instead of scaling Controls individually. **Note:** If the Control node is a child of a :ref:`Container` node, the scale will be reset to ``Vector2(1, 1)`` when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using ``yield(get_tree(), "idle_frame")`` then set its :ref:`rect_scale` property. @@ -1191,15 +1204,17 @@ The event won't trigger if: .. _class_Control_method__make_custom_tooltip: -- :ref:`Object` **_make_custom_tooltip** **(** :ref:`String` for_text **)** |virtual| +- :ref:`Control` **_make_custom_tooltip** **(** :ref:`String` for_text **)** |virtual| -Virtual method to be implemented by the user. Returns a ``Control`` node that should be used as a tooltip instead of the default one. Use ``for_text`` parameter to determine what text the tooltip should contain (likely the contents of :ref:`hint_tooltip`). +Virtual method to be implemented by the user. Returns a ``Control`` node that should be used as a tooltip instead of the default one. The ``for_text`` includes the contents of the :ref:`hint_tooltip` property. -The returned node must be of type ``Control`` or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When ``null`` or non-Control node is returned, the default tooltip will be used instead. +The returned node must be of type ``Control`` or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance).When ``null`` or a non-Control node is returned, the default tooltip will be used instead. + +The returned node will be added as child to a :ref:`PopupPanel`, so you should only provide the contents of that panel. That :ref:`PopupPanel` can be themed using :ref:`Theme.set_stylebox` for the type ``"TooltipPanel"`` (see :ref:`hint_tooltip` for an example). **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its :ref:`rect_min_size` to some non-zero value. -Example of usage with custom-constructed node: +Example of usage with a custom-constructed node: :: @@ -1208,12 +1223,12 @@ Example of usage with custom-constructed node: label.text = for_text return label -Example of usage with custom scene instance: +Example of usage with a custom scene instance: :: func _make_custom_tooltip(for_text): - var tooltip = preload("SomeTooltipScene.tscn").instance() + var tooltip = preload("res://SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip @@ -1364,9 +1379,9 @@ Returns :ref:`margin_left` and :ref:`margin_ .. _class_Control_method_get_color: -- :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns a color from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``type``. +Returns a color from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``node_type``. :: @@ -1385,9 +1400,9 @@ Returns combined minimum size from :ref:`rect_min_size` **get_constant** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns a constant from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``type``. +Returns a constant from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``node_type``. ---- @@ -1442,9 +1457,9 @@ Returns the control that has the keyboard focus or ``null`` if none. .. _class_Control_method_get_font: -- :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns a font from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``type``. +Returns a font from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``node_type``. ---- @@ -1458,9 +1473,9 @@ Returns the position and size of the control relative to the top-left corner of .. _class_Control_method_get_icon: -- :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns an icon from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``type``. +Returns an icon from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``node_type``. ---- @@ -1514,9 +1529,9 @@ Returns the rotation (in radians). .. _class_Control_method_get_stylebox: -- :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns a :ref:`StyleBox` from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``type``. +Returns a :ref:`StyleBox` from assigned :ref:`Theme` with given ``name`` and associated with ``Control`` of given ``node_type``. ---- @@ -1551,9 +1566,9 @@ Steal the focus from another control and become the focused control (see :ref:`f .. _class_Control_method_has_color: -- :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns ``true`` if :ref:`Color` with given ``name`` and associated with ``Control`` of given ``type`` exists in assigned :ref:`Theme`. +Returns ``true`` if :ref:`Color` with given ``name`` and associated with ``Control`` of given ``node_type`` exists in assigned :ref:`Theme`. ---- @@ -1567,9 +1582,9 @@ Returns ``true`` if :ref:`Color` with given ``name`` has a valid ov .. _class_Control_method_has_constant: -- :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns ``true`` if constant with given ``name`` and associated with ``Control`` of given ``type`` exists in assigned :ref:`Theme`. +Returns ``true`` if constant with given ``name`` and associated with ``Control`` of given ``node_type`` exists in assigned :ref:`Theme`. ---- @@ -1591,9 +1606,9 @@ Returns ``true`` if this is the current focused control. See :ref:`focus_mode` **has_font** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns ``true`` if font with given ``name`` and associated with ``Control`` of given ``type`` exists in assigned :ref:`Theme`. +Returns ``true`` if font with given ``name`` and associated with ``Control`` of given ``node_type`` exists in assigned :ref:`Theme`. ---- @@ -1607,9 +1622,9 @@ Returns ``true`` if font with given ``name`` has a valid override in this ``Cont .. _class_Control_method_has_icon: -- :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns ``true`` if icon with given ``name`` and associated with ``Control`` of given ``type`` exists in assigned :ref:`Theme`. +Returns ``true`` if icon with given ``name`` and associated with ``Control`` of given ``node_type`` exists in assigned :ref:`Theme`. ---- @@ -1643,9 +1658,9 @@ Returns ``true`` if :ref:`Shader` with given ``name`` has a valid .. _class_Control_method_has_stylebox: -- :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` type="" **)** |const| +- :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` node_type="" **)** |const| -Returns ``true`` if :ref:`StyleBox` with given ``name`` and associated with ``Control`` of given ``type`` exists in assigned :ref:`Theme`. +Returns ``true`` if :ref:`StyleBox` with given ``name`` and associated with ``Control`` of given ``node_type`` exists in assigned :ref:`Theme`. ---- diff --git a/classes/class_convexpolygonshape.rst b/classes/class_convexpolygonshape.rst index 6be949045..92bf262e0 100644 --- a/classes/class_convexpolygonshape.rst +++ b/classes/class_convexpolygonshape.rst @@ -18,6 +18,11 @@ Description Convex polygon shape resource, which can be added to a :ref:`PhysicsBody` or area. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + Properties ---------- diff --git a/classes/class_cpuparticles.rst b/classes/class_cpuparticles.rst index ff79ab71c..e542e6252 100644 --- a/classes/class_cpuparticles.rst +++ b/classes/class_cpuparticles.rst @@ -20,6 +20,8 @@ CPU-based 3D particle node used to create a variety of particle systems and effe See also :ref:`Particles`, which provides the same functionality with hardware acceleration, but may not run on older devices. +**Note:** Unlike :ref:`Particles`, the visibility rect is generated on-the-fly and doesn't need to be configured by the user. + Properties ---------- @@ -322,7 +324,9 @@ Property Descriptions | *Getter* | get_amount() | +-----------+-------------------+ -Number of particles emitted in one emission cycle. +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. ---- @@ -942,7 +946,7 @@ Initial velocity randomness ratio. | *Getter* | get_lifetime() | +-----------+---------------------+ -Amount of time each particle will exist. +The amount of time each particle will exist (in seconds). ---- diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst index 9fe372458..8e7a9b9ce 100644 --- a/classes/class_cpuparticles2d.rst +++ b/classes/class_cpuparticles2d.rst @@ -20,6 +20,8 @@ CPU-based 2D particle node used to create a variety of particle systems and effe See also :ref:`Particles2D`, which provides the same functionality with hardware acceleration, but may not run on older devices. +**Note:** Unlike :ref:`Particles2D`, the visibility rect is generated on-the-fly and doesn't need to be configured by the user. + Tutorials --------- @@ -319,7 +321,9 @@ Property Descriptions | *Getter* | get_amount() | +-----------+-------------------+ -Number of particles emitted in one emission cycle. +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. ---- @@ -887,7 +891,7 @@ Initial velocity randomness ratio. | *Getter* | get_lifetime() | +-----------+---------------------+ -Amount of time each particle will exist. +The amount of time each particle will exist (in seconds). ---- diff --git a/classes/class_csgshape.rst b/classes/class_csgshape.rst index 5116ca1c0..524b0fb81 100644 --- a/classes/class_csgshape.rst +++ b/classes/class_csgshape.rst @@ -108,7 +108,7 @@ The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. -A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. +A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -124,7 +124,7 @@ A contact is detected if object A is in any of the layers that object B scans, o | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this CSG shape scans for collisions. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this CSG shape scans for collisions. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_cubemesh.rst b/classes/class_cubemesh.rst index bcfea0e69..4970364ff 100644 --- a/classes/class_cubemesh.rst +++ b/classes/class_cubemesh.rst @@ -20,6 +20,8 @@ Generate an axis-aligned cuboid :ref:`PrimitiveMesh`. The cube's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to ``Vector3(3, 2, 1)``. +**Note:** When using a large textured ``CubeMesh`` (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase :ref:`subdivide_depth`, :ref:`subdivide_height` and :ref:`subdivide_width` until you no longer notice UV jittering. + Properties ---------- diff --git a/classes/class_curve2d.rst b/classes/class_curve2d.rst index 65bd4ac0d..755cceaf3 100644 --- a/classes/class_curve2d.rst +++ b/classes/class_curve2d.rst @@ -154,7 +154,7 @@ Returns the number of points describing the curve. - :ref:`Vector2` **get_point_in** **(** :ref:`int` idx **)** |const| -Returns the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. +Returns the position of the control point leading to the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. ---- @@ -162,7 +162,7 @@ Returns the position of the control point leading to the vertex ``idx``. If the - :ref:`Vector2` **get_point_out** **(** :ref:`int` idx **)** |const| -Returns the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. +Returns the position of the control point leading out of the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. ---- @@ -216,7 +216,7 @@ Deletes the point ``idx`` from the curve. Sends an error to the console if ``idx - void **set_point_in** **(** :ref:`int` idx, :ref:`Vector2` position **)** -Sets the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. +Sets the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ---- @@ -224,7 +224,7 @@ Sets the position of the control point leading to the vertex ``idx``. If the ind - void **set_point_out** **(** :ref:`int` idx, :ref:`Vector2` position **)** -Sets the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. +Sets the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ---- diff --git a/classes/class_curve3d.rst b/classes/class_curve3d.rst index 32fbf61ae..5c863a1c7 100644 --- a/classes/class_curve3d.rst +++ b/classes/class_curve3d.rst @@ -200,7 +200,7 @@ Returns the number of points describing the curve. - :ref:`Vector3` **get_point_in** **(** :ref:`int` idx **)** |const| -Returns the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. +Returns the position of the control point leading to the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. ---- @@ -208,7 +208,7 @@ Returns the position of the control point leading to the vertex ``idx``. If the - :ref:`Vector3` **get_point_out** **(** :ref:`int` idx **)** |const| -Returns the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. +Returns the position of the control point leading out of the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. ---- @@ -242,7 +242,7 @@ If ``idx`` is out of bounds it is truncated to the first or last vertex, and ``t - :ref:`Vector3` **interpolate_baked** **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| -Returns a point within the curve at position ``offset``, where ``offset`` is measured as a pixel distance along the curve. +Returns a point within the curve at position ``offset``, where ``offset`` is measured as a distance in 3D units along the curve. To do that, it finds the two cached points where the ``offset`` lies between, then interpolates the values. This interpolation is cubic if ``cubic`` is set to ``true``, or linear if set to ``false``. @@ -282,7 +282,7 @@ Deletes the point ``idx`` from the curve. Sends an error to the console if ``idx - void **set_point_in** **(** :ref:`int` idx, :ref:`Vector3` position **)** -Sets the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. +Sets the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ---- @@ -290,7 +290,7 @@ Sets the position of the control point leading to the vertex ``idx``. If the ind - void **set_point_out** **(** :ref:`int` idx, :ref:`Vector3` position **)** -Sets the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. +Sets the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ---- diff --git a/classes/class_cylindershape.rst b/classes/class_cylindershape.rst index 0ab8acc78..4f0549bea 100644 --- a/classes/class_cylindershape.rst +++ b/classes/class_cylindershape.rst @@ -18,6 +18,15 @@ Description Cylinder shape for collisions. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/678 `_ + +- `https://godotengine.org/asset-library/asset/675 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 2b5eb48bc..e57b0cd87 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -26,24 +26,34 @@ Creating a dictionary: :: - var my_dir = {} # Creates an empty dictionary. - var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} - var another_dir = { - key1: value1, - key2: value2, - key3: value3, + var my_dict = {} # Creates an empty dictionary. + + var dict_variable_key = "Another key name" + var dict_variable_value = "value2" + var another_dict = { + "Some key name": "value1", + dict_variable_key: dict_variable_value, + } + + var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} + + # Alternative Lua-style syntax. + # Doesn't require quotes around keys, but only string constants can be used as key names. + # Additionally, key names must start with a letter or an underscore. + # Here, `some_key` is a string literal, not a variable! + another_dict = { + some_key = 42, } You can access a dictionary's values by referencing the appropriate key. In the above example, ``points_dir["White"]`` will return ``50``. You can also write ``points_dir.White``, which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). :: - export(String, "White", "Yellow", "Orange") var my_color - var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} - + 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. - var points = points_dir[my_color] + var points = points_dict[my_color] In the above code, ``points`` will be assigned the value that is paired with the appropriate color selected in ``my_color``. @@ -51,14 +61,14 @@ Dictionaries can contain more complex data: :: - my_dir = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. + my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. To add a key to an existing dictionary, access it like an existing key and assign to it: :: - var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} - points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. + var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} + points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. Finally, dictionaries can contain different types of keys and values in the same dictionary: @@ -67,11 +77,11 @@ Finally, dictionaries can contain different types of keys and values in the same # This is a valid dictionary. # To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`. # Indexing styles can be mixed and matched depending on your needs. - var my_dir = { + var my_dict = { "String Key": 5, 4: [1, 2, 3], 7: "Hello", - "sub_dir": {"sub_key": "Nested value"}, + "sub_dict": {"sub_key": "Nested value"}, } **Note:** Unlike :ref:`Array`\ s, you can't compare dictionaries directly: @@ -84,27 +94,33 @@ Finally, dictionaries can contain different types of keys and values in the same func compare_arrays(): print(array1 == array2) # Will print true. - dir1 = {"a": 1, "b": 2, "c": 3} - dir2 = {"a": 1, "b": 2, "c": 3} + var dict1 = {"a": 1, "b": 2, "c": 3} + var dict2 = {"a": 1, "b": 2, "c": 3} func compare_dictionaries(): - print(dir1 == dir2) # Will NOT print true. + print(dict1 == dict2) # Will NOT print true. You need to first calculate the dictionary's hash with :ref:`hash` before you can compare them: :: - dir1 = {"a": 1, "b": 2, "c": 3} - dir2 = {"a": 1, "b": 2, "c": 3} + var dict1 = {"a": 1, "b": 2, "c": 3} + var dict2 = {"a": 1, "b": 2, "c": 3} func compare_dictionaries(): - print(dir1.hash() == dir2.hash()) # Will print true. + print(dict1.hash() == dict2.hash()) # Will print true. + +**Note:** When declaring a dictionary with ``const``, the dictionary itself can still be mutated by defining the values of individual keys. Using ``const`` will only prevent assigning the constant with another value after it was initialized. Tutorials --------- - `#dictionary <../getting_started/scripting/gdscript/gdscript_basics.html#dictionary>`_ in :doc:`../getting_started/scripting/gdscript/gdscript_basics` +- `https://godotengine.org/asset-library/asset/676 `_ + +- `https://godotengine.org/asset-library/asset/677 `_ + Methods ------- @@ -230,7 +246,7 @@ Returns the list of keys in the ``Dictionary``. - :ref:`int` **size** **(** **)** -Returns the size of the dictionary (in pairs). +Returns the number of keys in the dictionary. ---- diff --git a/classes/class_dynamicfont.rst b/classes/class_dynamicfont.rst index ccdc337d3..90f154d8e 100644 --- a/classes/class_dynamicfont.rst +++ b/classes/class_dynamicfont.rst @@ -29,6 +29,11 @@ DynamicFont uses the `FreeType `_ library for rasteri **Note:** DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use `FontForge `_ to do so. In FontForge, use **File > Generate Fonts**, click **Options**, choose the desired features then generate the font. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- @@ -94,9 +99,9 @@ enum **SpacingType**: - **SPACING_BOTTOM** = **1** --- Spacing at the bottom. -- **SPACING_CHAR** = **2** --- Character spacing. +- **SPACING_CHAR** = **2** --- Spacing for each character. -- **SPACING_SPACE** = **3** --- Space spacing. +- **SPACING_SPACE** = **3** --- Spacing for the space character. Property Descriptions --------------------- @@ -129,7 +134,9 @@ Extra spacing at the bottom in pixels. | *Getter* | get_spacing() | +-----------+--------------------+ -Extra character spacing in pixels. +Extra spacing for each character in pixels. + +This can be a negative number to make the distance between characters smaller. ---- @@ -145,7 +152,9 @@ Extra character spacing in pixels. | *Getter* | get_spacing() | +-----------+--------------------+ -Extra space spacing in pixels. +Extra spacing for the space character (in addition to :ref:`extra_spacing_char`) in pixels. + +This can be a negative number to make the distance between words smaller. ---- diff --git a/classes/class_dynamicfontdata.rst b/classes/class_dynamicfontdata.rst index a372ad3a6..22ee44141 100644 --- a/classes/class_dynamicfontdata.rst +++ b/classes/class_dynamicfontdata.rst @@ -18,6 +18,11 @@ Description Used with :ref:`DynamicFont` to describe the location of a vector font file for dynamic rendering at runtime. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_editorexportplugin.rst b/classes/class_editorexportplugin.rst index fbe5b2fb0..742d12104 100644 --- a/classes/class_editorexportplugin.rst +++ b/classes/class_editorexportplugin.rst @@ -11,7 +11,12 @@ EditorExportPlugin **Inherits:** :ref:`Reference` **<** :ref:`Object` -A script that is executed when exporting projects. +A script that is executed when exporting the project. + +Description +----------- + +Editor export plugins are automatically activated whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, :ref:`_export_begin` is called at the beginning of the export process and then :ref:`_export_file` is called for each exported file. Methods ------- @@ -51,7 +56,7 @@ Method Descriptions - void **_export_begin** **(** :ref:`PoolStringArray` features, :ref:`bool` is_debug, :ref:`String` path, :ref:`int` flags **)** |virtual| -Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. +Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. ``features`` is the list of features for the export, ``is_debug`` is ``true`` for debug builds, ``path`` is the target path for the exported project. ``flags`` is only used when running a runnable profile, e.g. when using native run on Android. ---- @@ -67,24 +72,34 @@ Virtual method to be overridden by the user. Called when the export is finished. - void **_export_file** **(** :ref:`String` path, :ref:`String` type, :ref:`PoolStringArray` features **)** |virtual| +Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. ``path`` is the path of the file, ``type`` is the :ref:`Resource` represented by the file (e.g. :ref:`PackedScene`) and ``features`` is the list of features for the export. + +Calling :ref:`skip` inside this callback will make the file not included in the export. + ---- .. _class_EditorExportPlugin_method_add_file: - void **add_file** **(** :ref:`String` path, :ref:`PoolByteArray` file, :ref:`bool` remap **)** +Adds a custom file to be exported. ``path`` is the virtual path that can be used to load the file, ``file`` is the binary data of the file. If ``remap`` is ``true``, file will not be exported, but instead remapped to the given ``path``. + ---- .. _class_EditorExportPlugin_method_add_ios_bundle_file: - void **add_ios_bundle_file** **(** :ref:`String` path **)** +Adds an iOS bundle file from the given ``path`` to the exported project. + ---- .. _class_EditorExportPlugin_method_add_ios_cpp_code: - void **add_ios_cpp_code** **(** :ref:`String` code **)** +Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin. + ---- .. _class_EditorExportPlugin_method_add_ios_embedded_framework: @@ -111,30 +126,40 @@ Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Link - void **add_ios_linker_flags** **(** :ref:`String` flags **)** +Adds linker flags for the iOS export. + ---- .. _class_EditorExportPlugin_method_add_ios_plist_content: - void **add_ios_plist_content** **(** :ref:`String` plist_content **)** +Adds content for iOS Property List files. + ---- .. _class_EditorExportPlugin_method_add_ios_project_static_lib: - void **add_ios_project_static_lib** **(** :ref:`String` path **)** +Adds a static lib from the given ``path`` to the iOS project. + ---- .. _class_EditorExportPlugin_method_add_shared_object: - void **add_shared_object** **(** :ref:`String` path, :ref:`PoolStringArray` tags **)** +Adds a shared object with the given ``tags`` and destination ``path``. + ---- .. _class_EditorExportPlugin_method_skip: - void **skip** **(** **)** +To be called inside :ref:`_export_file`. Skips the current file, so it's not included in the export. + .. |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_editorfeatureprofile.rst b/classes/class_editorfeatureprofile.rst index 747a11b2e..6677c76b9 100644 --- a/classes/class_editorfeatureprofile.rst +++ b/classes/class_editorfeatureprofile.rst @@ -60,12 +60,12 @@ Enumerations .. _class_EditorFeatureProfile_constant_FEATURE_SCENE_TREE: -.. _class_EditorFeatureProfile_constant_FEATURE_IMPORT_DOCK: - .. _class_EditorFeatureProfile_constant_FEATURE_NODE_DOCK: .. _class_EditorFeatureProfile_constant_FEATURE_FILESYSTEM_DOCK: +.. _class_EditorFeatureProfile_constant_FEATURE_IMPORT_DOCK: + .. _class_EditorFeatureProfile_constant_FEATURE_MAX: enum **Feature**: @@ -78,11 +78,11 @@ enum **Feature**: - **FEATURE_SCENE_TREE** = **3** --- Scene tree editing. If this feature is disabled, the Scene tree dock will still be visible but will be read-only. -- **FEATURE_IMPORT_DOCK** = **4** --- The Import dock. If this feature is disabled, the Import dock won't be visible. +- **FEATURE_NODE_DOCK** = **4** --- The Node dock. If this feature is disabled, signals and groups won't be visible and modifiable from the editor. -- **FEATURE_NODE_DOCK** = **5** --- The Node dock. If this feature is disabled, signals and groups won't be visible and modifiable from the editor. +- **FEATURE_FILESYSTEM_DOCK** = **5** --- The FileSystem dock. If this feature is disabled, the FileSystem dock won't be visible. -- **FEATURE_FILESYSTEM_DOCK** = **6** --- The FileSystem dock. If this feature is disabled, the FileSystem dock won't be visible. +- **FEATURE_IMPORT_DOCK** = **6** --- The Import dock. If this feature is disabled, the Import dock won't be visible. - **FEATURE_MAX** = **7** --- Represents the size of the :ref:`Feature` enum. diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst index d4336994f..b90dd6792 100644 --- a/classes/class_editorinterface.rst +++ b/classes/class_editorinterface.rst @@ -30,67 +30,67 @@ Properties Methods ------- -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`edit_resource` **(** :ref:`Resource` resource **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Control` | :ref:`get_base_control` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_current_path` **(** **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Node` | :ref:`get_edited_scene_root` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`EditorSettings` | :ref:`get_editor_settings` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Control` | :ref:`get_editor_viewport` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`FileSystemDock` | :ref:`get_file_system_dock` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`EditorInspector` | :ref:`get_inspector` **(** **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_open_scenes` **(** **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_playing_scene` **(** **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`EditorFileSystem` | :ref:`get_resource_filesystem` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`EditorResourcePreview` | :ref:`get_resource_previewer` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`ScriptEditor` | :ref:`get_script_editor` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_selected_path` **(** **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`EditorSelection` | :ref:`get_selection` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`inspect_object` **(** :ref:`Object` object, :ref:`String` for_property="" **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing_scene` **(** **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_plugin_enabled` **(** :ref:`String` plugin **)** |const| | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`make_mesh_previews` **(** :ref:`Array` meshes, :ref:`int` preview_size **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`open_scene_from_path` **(** :ref:`String` scene_filepath **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`play_current_scene` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`play_custom_scene` **(** :ref:`String` scene_filepath **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`play_main_scene` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`reload_scene_from_path` **(** :ref:`String` scene_filepath **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_scene` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`save_scene_as` **(** :ref:`String` path, :ref:`bool` with_preview=true **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`select_file` **(** :ref:`String` file **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_main_screen_editor` **(** :ref:`String` name **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_plugin_enabled` **(** :ref:`String` plugin, :ref:`bool` enabled **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`stop_playing_scene` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`edit_resource` **(** :ref:`Resource` resource **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_base_control` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_path` **(** **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_edited_scene_root` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorSettings` | :ref:`get_editor_settings` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_editor_viewport` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`FileSystemDock` | :ref:`get_file_system_dock` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorInspector` | :ref:`get_inspector` **(** **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_open_scenes` **(** **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_playing_scene` **(** **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorFileSystem` | :ref:`get_resource_filesystem` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorResourcePreview` | :ref:`get_resource_previewer` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ScriptEditor` | :ref:`get_script_editor` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_selected_path` **(** **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorSelection` | :ref:`get_selection` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`inspect_object` **(** :ref:`Object` object, :ref:`String` for_property="", :ref:`bool` inspector_only=false **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing_scene` **(** **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_plugin_enabled` **(** :ref:`String` plugin **)** |const| | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`make_mesh_previews` **(** :ref:`Array` meshes, :ref:`int` preview_size **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`open_scene_from_path` **(** :ref:`String` scene_filepath **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_current_scene` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_custom_scene` **(** :ref:`String` scene_filepath **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_main_scene` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reload_scene_from_path` **(** :ref:`String` scene_filepath **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_scene` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`save_scene_as` **(** :ref:`String` path, :ref:`bool` with_preview=true **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select_file` **(** :ref:`String` file **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_main_screen_editor` **(** :ref:`String` name **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_plugin_enabled` **(** :ref:`String` plugin, :ref:`bool` enabled **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop_playing_scene` **(** **)** | ++-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -234,9 +234,9 @@ Returns the editor's :ref:`EditorSelection` instance. .. _class_EditorInterface_method_inspect_object: -- void **inspect_object** **(** :ref:`Object` object, :ref:`String` for_property="" **)** +- void **inspect_object** **(** :ref:`Object` object, :ref:`String` for_property="", :ref:`bool` inspector_only=false **)** -Shows the given property on the given ``object`` in the editor's Inspector dock. +Shows the given property on the given ``object`` in the editor's Inspector dock. If ``inspector_only`` is ``true``, plugins will not attempt to edit ``object``. ---- diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst index 862b3cc23..8186b8973 100644 --- a/classes/class_editorplugin.rst +++ b/classes/class_editorplugin.rst @@ -69,6 +69,10 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`forward_canvas_gui_input` **(** :ref:`InputEvent` event **)** |virtual| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`forward_spatial_draw_over_viewport` **(** :ref:`Control` overlay **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`forward_spatial_force_draw_over_viewport` **(** :ref:`Control` overlay **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`forward_spatial_gui_input` **(** :ref:`Camera` camera, :ref:`InputEvent` event **)** |virtual| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_breakpoints` **(** **)** |virtual| | @@ -323,6 +327,8 @@ During run-time, this will be a simple object with a script so this function doe - void **add_export_plugin** **(** :ref:`EditorExportPlugin` plugin **)** +Registers a new export plugin. Export plugins are used when the project is being exported. See :ref:`EditorExportPlugin` for more information. + ---- .. _class_EditorPlugin_method_add_import_plugin: @@ -417,12 +423,31 @@ Called by the engine when the user enables the ``EditorPlugin`` in the Plugin ta - void **forward_canvas_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| +Called by the engine when the 2D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays`. + +:: + + func forward_canvas_draw_over_viewport(overlay): + # Draw a circle at cursor position. + overlay.draw_circle(overlay.get_local_mouse_position(), 64) + + func forward_canvas_gui_input(event): + if event is InputEventMouseMotion: + # Redraw viewport when cursor is moved. + update_overlays() + return true + return false + ---- .. _class_EditorPlugin_method_forward_canvas_force_draw_over_viewport: - void **forward_canvas_force_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| +This method is the same as :ref:`forward_canvas_draw_over_viewport`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + +You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled`. + ---- .. _class_EditorPlugin_method_forward_canvas_gui_input: @@ -451,6 +476,37 @@ Must ``return false`` in order to forward the :ref:`InputEvent ---- +.. _class_EditorPlugin_method_forward_spatial_draw_over_viewport: + +- void **forward_spatial_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| + +Called by the engine when the 3D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays`. + +:: + + func forward_spatial_draw_over_viewport(overlay): + # Draw a circle at cursor position. + overlay.draw_circle(overlay.get_local_mouse_position(), 64) + + func forward_spatial_gui_input(camera, event): + if event is InputEventMouseMotion: + # Redraw viewport when cursor is moved. + update_overlays() + return true + return false + +---- + +.. _class_EditorPlugin_method_forward_spatial_force_draw_over_viewport: + +- void **forward_spatial_force_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| + +This method is the same as :ref:`forward_spatial_draw_over_viewport`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + +You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled`. + +---- + .. _class_EditorPlugin_method_forward_spatial_gui_input: - :ref:`bool` **forward_spatial_gui_input** **(** :ref:`Camera` camera, :ref:`InputEvent` event **)** |virtual| @@ -693,6 +749,8 @@ This method is called after the editor saves the project or when it's closed. It - void **set_force_draw_over_forwarding_enabled** **(** **)** +Enables calling of :ref:`forward_canvas_force_draw_over_viewport` for the 2D editor and :ref:`forward_spatial_force_draw_over_viewport` for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. + ---- .. _class_EditorPlugin_method_set_input_event_forwarding_always_enabled: @@ -723,7 +781,7 @@ Restore the plugin GUI layout saved by :ref:`get_window_layout` **update_overlays** **(** **)** |const| -Updates the overlays of the editor (2D/3D) viewport. +Updates the overlays of the 2D and 3D editor viewport. Causes methods :ref:`forward_canvas_draw_over_viewport`, :ref:`forward_canvas_force_draw_over_viewport`, :ref:`forward_spatial_draw_over_viewport` and :ref:`forward_spatial_force_draw_over_viewport` to be called. .. |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_editorsceneimporter.rst b/classes/class_editorsceneimporter.rst index b8879073a..d422d1721 100644 --- a/classes/class_editorsceneimporter.rst +++ b/classes/class_editorsceneimporter.rst @@ -11,7 +11,7 @@ EditorSceneImporter **Inherits:** :ref:`Reference` **<** :ref:`Object` -**Inherited By:** :ref:`EditorSceneImporterAssimp` +**Inherited By:** :ref:`EditorSceneImporterFBX` Imports scenes from third-parties' 3D files. diff --git a/classes/class_editorsceneimporterassimp.rst b/classes/class_editorsceneimporterfbx.rst similarity index 77% rename from classes/class_editorsceneimporterassimp.rst rename to classes/class_editorsceneimporterfbx.rst index 3f90cf9b2..86d7f0aed 100644 --- a/classes/class_editorsceneimporterassimp.rst +++ b/classes/class_editorsceneimporterfbx.rst @@ -1,22 +1,22 @@ :github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the EditorSceneImporterAssimp.xml source instead. +.. DO NOT EDIT THIS FILE, but the EditorSceneImporterFBX.xml source instead. .. The source is found in doc/classes or modules//doc_classes. -.. _class_EditorSceneImporterAssimp: +.. _class_EditorSceneImporterFBX: -EditorSceneImporterAssimp -========================= +EditorSceneImporterFBX +====================== **Inherits:** :ref:`EditorSceneImporter` **<** :ref:`Reference` **<** :ref:`Object` -FBX 3D asset importer based on `Assimp `_. +FBX 3D asset importer. Description ----------- -This is an FBX 3D asset importer based on `Assimp `_. It currently has many known limitations and works best with static meshes. Most animated meshes won't import correctly. +This is an FBX 3D asset importer with full support for most FBX features. If exporting a FBX scene from Autodesk Maya, use these FBX export settings: diff --git a/classes/class_editorspatialgizmoplugin.rst b/classes/class_editorspatialgizmoplugin.rst index cabf3f7c4..9118d9014 100644 --- a/classes/class_editorspatialgizmoplugin.rst +++ b/classes/class_editorspatialgizmoplugin.rst @@ -45,11 +45,11 @@ Methods +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_handle_value` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`SpatialMaterial` | :ref:`get_material` **(** :ref:`String` name, :ref:`EditorSpatialGizmo` gizmo **)** | +| :ref:`SpatialMaterial` | :ref:`get_material` **(** :ref:`String` name, :ref:`EditorSpatialGizmo` gizmo=null **)** | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_name` **(** **)** |virtual| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_priority` **(** **)** |virtual| | +| :ref:`int` | :ref:`get_priority` **(** **)** |virtual| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_gizmo` **(** :ref:`Spatial` spatial **)** |virtual| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -139,7 +139,7 @@ Gets actual value of a handle from gizmo. Called for this plugin's active gizmos .. _class_EditorSpatialGizmoPlugin_method_get_material: -- :ref:`SpatialMaterial` **get_material** **(** :ref:`String` name, :ref:`EditorSpatialGizmo` gizmo **)** +- :ref:`SpatialMaterial` **get_material** **(** :ref:`String` name, :ref:`EditorSpatialGizmo` gizmo=null **)** Gets material from the internal list of materials. If an :ref:`EditorSpatialGizmo` is provided, it will try to get the corresponding variant (selected and/or editable). @@ -155,7 +155,7 @@ Override this method to provide the name that will appear in the gizmo visibilit .. _class_EditorSpatialGizmoPlugin_method_get_priority: -- :ref:`String` **get_priority** **(** **)** |virtual| +- :ref:`int` **get_priority** **(** **)** |virtual| Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used. diff --git a/classes/class_environment.rst b/classes/class_environment.rst index 5e8bf24ce..4840740b7 100644 --- a/classes/class_environment.rst +++ b/classes/class_environment.rst @@ -35,6 +35,12 @@ Tutorials - :doc:`../tutorials/3d/high_dynamic_range` +- `https://godotengine.org/asset-library/asset/123 `_ + +- `https://godotengine.org/asset-library/asset/110 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_file.rst b/classes/class_file.rst index 24edd7709..fba85edc1 100644 --- a/classes/class_file.rst +++ b/classes/class_file.rst @@ -35,13 +35,17 @@ Here's a sample on how to write and read from a file: file.close() return content -In the example above, the file will be saved in the user data folder as specified in the `Data paths `_ documentation. +In the example above, the file will be saved in the user data folder as specified in the `Data paths `_ documentation. + +**Note:** To access project resources once exported, it is recommended to use :ref:`ResourceLoader` instead of the ``File`` API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. Tutorials --------- - :doc:`../getting_started/step_by_step/filesystem` +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- @@ -233,7 +237,7 @@ Returns ``true`` if the file cursor has read past the end of the file. Returns ``true`` if the file exists in the given path. -**Note:** Many resources types are imported (e.g. textures or sound files), and that their source asset will not be included in the exported game, as only the imported version is used (in the ``res://.import`` folder). To check for the existence of such resources while taking into account the remapping to their imported location, use :ref:`ResourceLoader.exists`. Typically, using ``File.file_exists`` on an imported resource would work while you are developing in the editor (the source asset is present in ``res://``, but fail when exported). +**Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See :ref:`ResourceLoader.exists` for an alternative approach that takes resource remapping into account. ---- @@ -578,9 +582,7 @@ Stores a floating-point number as 32 bits in the file. - void **store_line** **(** :ref:`String` line **)** -Stores the given :ref:`String` as a line in the file. - -Text will be encoded as UTF-8. +Appends ``line`` to the file followed by a line return character (``\n``), encoding the text as UTF-8. ---- @@ -606,9 +608,7 @@ Stores a floating-point number in the file. - void **store_string** **(** :ref:`String` string **)** -Stores the given :ref:`String` in the file. - -Text will be encoded as UTF-8. +Appends ``string`` to the file without a line return, encoding the text as UTF-8. ---- diff --git a/classes/class_funcref.rst b/classes/class_funcref.rst index 70d3601b4..e3e248455 100644 --- a/classes/class_funcref.rst +++ b/classes/class_funcref.rst @@ -20,6 +20,13 @@ In GDScript, functions are not *first-class objects*. This means it is impossibl However, by creating a ``FuncRef`` using the :ref:`@GDScript.funcref` function, a reference to a function in a given object can be created, passed around and called. +Properties +---------- + ++-----------------------------+--------------------------------------------------+--------+ +| :ref:`String` | :ref:`function` | ``""`` | ++-----------------------------+--------------------------------------------------+--------+ + Methods ------- @@ -30,11 +37,26 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_valid` **(** **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_function` **(** :ref:`String` name **)** | -+-------------------------------+---------------------------------------------------------------------------------------------------------+ | void | :ref:`set_instance` **(** :ref:`Object` instance **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------+ +Property Descriptions +--------------------- + +.. _class_FuncRef_property_function: + +- :ref:`String` **function** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The name of the referenced function. + Method Descriptions ------------------- @@ -42,7 +64,7 @@ Method Descriptions - :ref:`Variant` **call_func** **(** ... **)** |vararg| -Calls the referenced function previously set by :ref:`set_function` or :ref:`@GDScript.funcref`. +Calls the referenced function previously set in :ref:`function` or :ref:`@GDScript.funcref`. ---- @@ -50,7 +72,7 @@ Calls the referenced function previously set by :ref:`set_function` **call_funcv** **(** :ref:`Array` arg_array **)** -Calls the referenced function previously set by :ref:`set_function` or :ref:`@GDScript.funcref`. Contrarily to :ref:`call_func`, this method does not support a variable number of arguments but expects all parameters to be passed via a single :ref:`Array`. +Calls the referenced function previously set in :ref:`function` or :ref:`@GDScript.funcref`. Contrarily to :ref:`call_func`, this method does not support a variable number of arguments but expects all parameters to be passed via a single :ref:`Array`. ---- @@ -62,14 +84,6 @@ Returns whether the object still exists and has the function assigned. ---- -.. _class_FuncRef_method_set_function: - -- void **set_function** **(** :ref:`String` name **)** - -The name of the referenced function to call on the object, without parentheses or any parameters. - ----- - .. _class_FuncRef_method_set_instance: - void **set_instance** **(** :ref:`Object` instance **)** diff --git a/classes/class_generic6dofjoint.rst b/classes/class_generic6dofjoint.rst index 22b66de47..ac17b2c5d 100644 --- a/classes/class_generic6dofjoint.rst +++ b/classes/class_generic6dofjoint.rst @@ -190,8 +190,6 @@ Properties +---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`linear_spring_z/stiffness` | ``0.01`` | +---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`precision` | ``1`` | -+---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ Methods ------- @@ -1630,20 +1628,6 @@ The speed that the linear motor will attempt to reach on the Z axis. | *Getter* | get_param_z() | +-----------+--------------------+ ----- - -.. _class_Generic6DOFJoint_property_precision: - -- :ref:`int` **precision** - -+-----------+----------------------+ -| *Default* | ``1`` | -+-----------+----------------------+ -| *Setter* | set_precision(value) | -+-----------+----------------------+ -| *Getter* | get_precision() | -+-----------+----------------------+ - Method Descriptions ------------------- diff --git a/classes/class_geometry.rst b/classes/class_geometry.rst index d0936a18e..02ddfb8dc 100644 --- a/classes/class_geometry.rst +++ b/classes/class_geometry.rst @@ -275,7 +275,7 @@ Given the two 3D segments (``p1``, ``p2``) and (``q1``, ``q2``), finds those two - :ref:`PoolVector2Array` **get_closest_points_between_segments_2d** **(** :ref:`Vector2` p1, :ref:`Vector2` q1, :ref:`Vector2` p2, :ref:`Vector2` q2 **)** -Given the two 2D segments (``p1``, ``p2``) and (``q1``, ``q2``), finds those two points on the two segments that are closest to each other. Returns a :ref:`PoolVector2Array` that contains this point on (``p1``, ``p2``) as well the accompanying point on (``q1``, ``q2``). +Given the two 2D segments (``p1``, ``q1``) and (``p2``, ``q2``), finds those two points on the two segments that are closest to each other. Returns a :ref:`PoolVector2Array` that contains this point on (``p1``, ``q1``) as well the accompanying point on (``p2``, ``q2``). ---- diff --git a/classes/class_giprobe.rst b/classes/class_giprobe.rst index 79b0333f6..fe5e3806e 100644 --- a/classes/class_giprobe.rst +++ b/classes/class_giprobe.rst @@ -25,6 +25,8 @@ Tutorials - :doc:`../tutorials/3d/gi_probes` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_giprobedata.rst b/classes/class_giprobedata.rst index 34f0f981a..56574705e 100644 --- a/classes/class_giprobedata.rst +++ b/classes/class_giprobedata.rst @@ -13,6 +13,11 @@ GIProbeData +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_gradient.rst b/classes/class_gradient.rst index f38f95916..bbaccf570 100644 --- a/classes/class_gradient.rst +++ b/classes/class_gradient.rst @@ -33,15 +33,15 @@ Methods +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_point` **(** :ref:`float` offset, :ref:`Color` color **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`get_color` **(** :ref:`int` point **)** |const| | +| :ref:`Color` | :ref:`get_color` **(** :ref:`int` point **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_offset` **(** :ref:`int` point **)** |const| | +| :ref:`float` | :ref:`get_offset` **(** :ref:`int` point **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_point_count` **(** **)** |const| | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`interpolate` **(** :ref:`float` offset **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_point` **(** :ref:`int` offset **)** | +| void | :ref:`remove_point` **(** :ref:`int` point **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color` **(** :ref:`int` point, :ref:`Color` color **)** | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ @@ -94,7 +94,7 @@ Adds the specified color to the end of the ramp, with the specified offset. .. _class_Gradient_method_get_color: -- :ref:`Color` **get_color** **(** :ref:`int` point **)** |const| +- :ref:`Color` **get_color** **(** :ref:`int` point **)** Returns the color of the ramp color at index ``point``. @@ -102,7 +102,7 @@ Returns the color of the ramp color at index ``point``. .. _class_Gradient_method_get_offset: -- :ref:`float` **get_offset** **(** :ref:`int` point **)** |const| +- :ref:`float` **get_offset** **(** :ref:`int` point **)** Returns the offset of the ramp color at index ``point``. @@ -126,9 +126,9 @@ Returns the interpolated color specified by ``offset``. .. _class_Gradient_method_remove_point: -- void **remove_point** **(** :ref:`int` offset **)** +- void **remove_point** **(** :ref:`int` point **)** -Removes the color at the index ``offset``. +Removes the color at the index ``point``. ---- diff --git a/classes/class_graphedit.rst b/classes/class_graphedit.rst index 4475bfb28..0f03f344a 100644 --- a/classes/class_graphedit.rst +++ b/classes/class_graphedit.rst @@ -26,6 +26,12 @@ Properties +------------------------------------------+----------------------------------------------------------------------+------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | +------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`minimap_enabled` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`minimap_opacity` | ``0.65`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`minimap_size` | ``Vector2( 240, 160 )`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ | :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | +------------------------------------------+----------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`right_disconnects` | ``false`` | @@ -90,6 +96,8 @@ Theme Properties +---------------------------------+-------------------------------+------------------------+ | :ref:`Color` | grid_minor | Color( 1, 1, 1, 0.05 ) | +---------------------------------+-------------------------------+------------------------+ +| :ref:`Texture` | minimap | | ++---------------------------------+-------------------------------+------------------------+ | :ref:`Texture` | minus | | +---------------------------------+-------------------------------+------------------------+ | :ref:`Texture` | more | | @@ -221,6 +229,54 @@ Emitted when the scroll offset is changed by the user. It will not be emitted wh Property Descriptions --------------------- +.. _class_GraphEdit_property_minimap_enabled: + +- :ref:`bool` **minimap_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_minimap_enabled(value) | ++-----------+----------------------------+ +| *Getter* | is_minimap_enabled() | ++-----------+----------------------------+ + +If ``true``, the minimap is visible. + +---- + +.. _class_GraphEdit_property_minimap_opacity: + +- :ref:`float` **minimap_opacity** + ++-----------+----------------------------+ +| *Default* | ``0.65`` | ++-----------+----------------------------+ +| *Setter* | set_minimap_opacity(value) | ++-----------+----------------------------+ +| *Getter* | get_minimap_opacity() | ++-----------+----------------------------+ + +The opacity of the minimap rectangle. + +---- + +.. _class_GraphEdit_property_minimap_size: + +- :ref:`Vector2` **minimap_size** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 240, 160 )`` | ++-----------+-------------------------+ +| *Setter* | set_minimap_size(value) | ++-----------+-------------------------+ +| *Getter* | get_minimap_size() | ++-----------+-------------------------+ + +The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle. + +---- + .. _class_GraphEdit_property_right_disconnects: - :ref:`bool` **right_disconnects** diff --git a/classes/class_gridcontainer.rst b/classes/class_gridcontainer.rst index a4ef9ad22..f045ee5aa 100644 --- a/classes/class_gridcontainer.rst +++ b/classes/class_gridcontainer.rst @@ -22,6 +22,11 @@ Notice that grid layout will preserve the columns and rows for every size of the **Note:** GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/677 `_ + Properties ---------- diff --git a/classes/class_gridmap.rst b/classes/class_gridmap.rst index 4669d3e03..a69ef70fc 100644 --- a/classes/class_gridmap.rst +++ b/classes/class_gridmap.rst @@ -29,6 +29,10 @@ Tutorials - :doc:`../tutorials/3d/using_gridmaps` +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/126 `_ + Properties ---------- @@ -242,7 +246,7 @@ GridMaps act as static bodies, meaning they aren't affected by gravity or other | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this GridMap detects collisions in. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this GridMap detects collisions in. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_hingejoint.rst b/classes/class_hingejoint.rst index 557939438..1790ed556 100644 --- a/classes/class_hingejoint.rst +++ b/classes/class_hingejoint.rst @@ -11,12 +11,12 @@ HingeJoint **Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -A hinge between two 3D bodies. +A hinge between two 3D PhysicsBodies. Description ----------- -A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. +A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. See also :ref:`Generic6DOFJoint`. Properties ---------- diff --git a/classes/class_httpclient.rst b/classes/class_httpclient.rst index dca5dfd89..3e4c5c0fe 100644 --- a/classes/class_httpclient.rst +++ b/classes/class_httpclient.rst @@ -26,6 +26,8 @@ For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/H **Note:** When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to `CORS `_. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the ``Access-Control-Allow-Origin: *`` HTTP header. +**Note:** SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. + Tutorials --------- @@ -41,7 +43,7 @@ Properties +-------------------------------------+-------------------------------------------------------------------------------+-----------+ | :ref:`StreamPeer` | :ref:`connection` | | +-------------------------------------+-------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`read_chunk_size` | ``4096`` | +| :ref:`int` | :ref:`read_chunk_size` | ``65536`` | +-------------------------------------+-------------------------------------------------------------------------------+-----------+ Methods @@ -458,7 +460,7 @@ The connection to use for this client. - :ref:`int` **read_chunk_size** +-----------+----------------------------+ -| *Default* | ``4096`` | +| *Default* | ``65536`` | +-----------+----------------------------+ | *Setter* | set_read_chunk_size(value) | +-----------+----------------------------+ diff --git a/classes/class_httprequest.rst b/classes/class_httprequest.rst index 217df7774..c52c12ea6 100644 --- a/classes/class_httprequest.rst +++ b/classes/class_httprequest.rst @@ -39,7 +39,7 @@ Can be used to make HTTP requests, i.e. download or upload files or web content # Note: Don't make simultaneous requests using a single HTTPRequest node. # The snippet below is provided for reference only. var body = {"name": "Godette"} - var error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) + error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) if error != OK: push_error("An error occurred in the HTTP request.") @@ -84,6 +84,8 @@ Can be used to make HTTP requests, i.e. download or upload files or web content **Note:** When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to `CORS `_. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the ``Access-Control-Allow-Origin: *`` HTTP header. +**Note:** SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. + Tutorials --------- @@ -97,7 +99,7 @@ Properties +-----------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`body_size_limit` | ``-1`` | +-----------------------------+----------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`download_chunk_size` | ``4096`` | +| :ref:`int` | :ref:`download_chunk_size` | ``65536`` | +-----------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`download_file` | ``""`` | +-----------------------------+----------------------------------------------------------------------------+-----------+ @@ -215,7 +217,7 @@ Maximum allowed size for response bodies. - :ref:`int` **download_chunk_size** +-----------+--------------------------------+ -| *Default* | ``4096`` | +| *Default* | ``65536`` | +-----------+--------------------------------+ | *Setter* | set_download_chunk_size(value) | +-----------+--------------------------------+ @@ -224,7 +226,7 @@ Maximum allowed size for response bodies. The size of the buffer used and maximum bytes to read per iteration. See :ref:`HTTPClient.read_chunk_size`. -Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory. +Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds. ---- diff --git a/classes/class_image.rst b/classes/class_image.rst index ef3135cce..c2dd10a48 100644 --- a/classes/class_image.rst +++ b/classes/class_image.rst @@ -16,9 +16,16 @@ Image datatype. Description ----------- -Native image datatype. Contains image data, which can be converted to a :ref:`Texture`, and several functions to interact with it. The maximum width and height for an ``Image`` are :ref:`MAX_WIDTH` and :ref:`MAX_HEIGHT`. +Native image datatype. Contains image data which can be converted to an :ref:`ImageTexture` and provides commonly used *image processing* methods. The maximum width and height for an ``Image`` are :ref:`MAX_WIDTH` and :ref:`MAX_HEIGHT`. -**Note:** The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images will fail to import. +An ``Image`` cannot be assigned to a ``texture`` property of an object directly (such as :ref:`Sprite`), and has to be converted manually to an :ref:`ImageTexture` first. + +**Note:** The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import. + +Tutorials +--------- + +- :doc:`../getting_started/workflow/assets/importing_images` Properties ---------- @@ -101,6 +108,8 @@ Methods +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_bmp_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`load_jpg_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`load_png_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | @@ -117,7 +126,7 @@ Methods +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` width, :ref:`int` height, :ref:`Interpolation` interpolation=1 **)** | +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`resize_to_po2` **(** :ref:`bool` square=false **)** | +| void | :ref:`resize_to_po2` **(** :ref:`bool` square=false, :ref:`Interpolation` interpolation=1 **)** | +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`rgbe_to_srgb` **(** **)** | +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -716,7 +725,21 @@ Returns ``true`` if all the image's pixels have an alpha value of 0. Returns ``f - :ref:`Error` **load** **(** :ref:`String` path **)** -Loads an image from file ``path``. See `Supported image formats `_ for a list of supported image formats and limitations. +Loads an image from file ``path``. See `Supported image formats `_ for a list of supported image formats and limitations. + +**Warning:** This method should only be used in the editor or in cases when you need to load external images at run-time, such as images located at the ``user://`` directory, and may not work in exported projects. + +See also :ref:`ImageTexture` description for usage examples. + +---- + +.. _class_Image_method_load_bmp_from_buffer: + +- :ref:`Error` **load_bmp_from_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Loads an image from the binary contents of a BMP file. + +**Note:** Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported. ---- @@ -780,15 +803,15 @@ Multiplies color values with alpha values. Resulting color values for a pixel ar - void **resize** **(** :ref:`int` width, :ref:`int` height, :ref:`Interpolation` interpolation=1 **)** -Resizes the image to the given ``width`` and ``height``. New pixels are calculated using ``interpolation``. See ``interpolation`` constants. +Resizes the image to the given ``width`` and ``height``. New pixels are calculated using the ``interpolation`` mode defined via :ref:`Interpolation` constants. ---- .. _class_Image_method_resize_to_po2: -- void **resize_to_po2** **(** :ref:`bool` square=false **)** +- void **resize_to_po2** **(** :ref:`bool` square=false, :ref:`Interpolation` interpolation=1 **)** -Resizes the image to the nearest power of 2 for the width and height. If ``square`` is ``true`` then set width and height to be the same. +Resizes the image to the nearest power of 2 for the width and height. If ``square`` is ``true`` then set width and height to be the same. New pixels are calculated using the ``interpolation`` mode defined via :ref:`Interpolation` constants. ---- diff --git a/classes/class_imagetexture.rst b/classes/class_imagetexture.rst index e6f127e5f..b7a6b7503 100644 --- a/classes/class_imagetexture.rst +++ b/classes/class_imagetexture.rst @@ -16,9 +16,42 @@ A :ref:`Texture` based on an :ref:`Image`. Description ----------- -A :ref:`Texture` based on an :ref:`Image`. Can be created from an :ref:`Image` with :ref:`create_from_image`. +A :ref:`Texture` based on an :ref:`Image`. For an image to be displayed, an ``ImageTexture`` has to be created from it using the :ref:`create_from_image` method: -**Note:** The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images will fail to import. +:: + + var texture = ImageTexture.new() + var image = Image.new() + image.load("res://icon.png") + texture.create_from_image(image) + $Sprite.texture = texture + +This way, textures can be created at run-time by loading images both from within the editor and externally. + +**Warning:** Prefer to load imported textures with :ref:`@GDScript.load` over loading them from within the filesystem dynamically with :ref:`Image.load`, as it may not work in exported projects: + +:: + + var texture = load("res://icon.png") + $Sprite.texture = texture + +This is because images have to be imported as :ref:`StreamTexture` first to be loaded with :ref:`@GDScript.load`. If you'd still like to load an image file just like any other :ref:`Resource`, import it as an :ref:`Image` resource instead, and then load it normally using the :ref:`@GDScript.load` method. + +But do note that the image data can still be retrieved from an imported texture as well using the :ref:`Texture.get_data` method, which returns a copy of the data: + +:: + + var texture = load("res://icon.png") + var image : Image = texture.get_data() + +An ``ImageTexture`` is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new :ref:`EditorImportPlugin`. + +**Note:** The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. + +Tutorials +--------- + +- :doc:`../getting_started/workflow/assets/importing_images` Properties ---------- @@ -117,7 +150,7 @@ Create a new ``ImageTexture`` with ``width`` and ``height``. - void **create_from_image** **(** :ref:`Image` image, :ref:`int` flags=7 **)** -Create a new ``ImageTexture`` from an :ref:`Image` with ``flags`` from :ref:`Flags`. An sRGB to linear color space conversion can take place, according to :ref:`Format`. +Initializes the texture by allocating and setting the data from an :ref:`Image` with ``flags`` from :ref:`Flags`. An sRGB to linear color space conversion can take place, according to :ref:`Format`. ---- @@ -125,7 +158,7 @@ Create a new ``ImageTexture`` from an :ref:`Image` with ``flags`` f - :ref:`Format` **get_format** **(** **)** |const| -Returns the format of the ``ImageTexture``, one of :ref:`Format`. +Returns the format of the texture, one of :ref:`Format`. ---- @@ -133,7 +166,9 @@ Returns the format of the ``ImageTexture``, one of :ref:`Format` **load** **(** :ref:`String` path **)** -Load an ``ImageTexture`` from a file path. +Loads an image from a file path and creates a texture from it. + +**Note:** the method is deprecated and will be removed in Godot 4.0, use :ref:`Image.load` and :ref:`create_from_image` instead. ---- @@ -141,7 +176,11 @@ Load an ``ImageTexture`` from a file path. - void **set_data** **(** :ref:`Image` image **)** -Sets the :ref:`Image` of this ``ImageTexture``. +Replaces the texture's data with a new :ref:`Image`. + +**Note:** The texture has to be initialized first with the :ref:`create_from_image` method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the :ref:`create_from_image` method. + +Use this method over :ref:`create_from_image` if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. ---- @@ -149,7 +188,7 @@ Sets the :ref:`Image` of this ``ImageTexture``. - void **set_size_override** **(** :ref:`Vector2` size **)** -Resizes the ``ImageTexture`` to the specified dimensions. +Resizes the texture to the specified dimensions. .. |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_immediategeometry.rst b/classes/class_immediategeometry.rst index 7e95002dd..225215803 100644 --- a/classes/class_immediategeometry.rst +++ b/classes/class_immediategeometry.rst @@ -24,6 +24,8 @@ See also :ref:`ArrayMesh`, :ref:`MeshDataTool`_ for front faces of triangle primitive modes. +**Note:** In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under :ref:`ProjectSettings.rendering/limits/buffers/immediate_buffer_size_kb`. + Methods ------- diff --git a/classes/class_input.rst b/classes/class_input.rst index b81ba9bf9..7e594e5fa 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -23,6 +23,10 @@ Tutorials - :doc:`../tutorials/inputs/index` +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + Methods ------- @@ -251,7 +255,7 @@ Adds a new mapping entry (in SDL2 format) to the mapping database. Optionally up - :ref:`Vector3` **get_accelerometer** **(** **)** |const| -Returns the acceleration of the device's accelerometer, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. +Returns the acceleration of the device's accelerometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. Note this method returns an empty :ref:`Vector3` when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. @@ -287,7 +291,7 @@ Returns the currently assigned cursor shape (see :ref:`CursorShape` **get_gravity** **(** **)** |const| -Returns the gravity of the device's accelerometer, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. +Returns the gravity of the device's accelerometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. **Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO`. @@ -297,9 +301,9 @@ Returns the gravity of the device's accelerometer, if the device has one. Otherw - :ref:`Vector3` **get_gyroscope** **(** **)** |const| -Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. +Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. -**Note:** This method only works on Android. On other platforms, it always returns :ref:`Vector3.ZERO`. +**Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO`. ---- @@ -387,9 +391,9 @@ Returns the mouse speed for the last time the cursor was moved, and this until t - :ref:`Vector3` **get_magnetometer** **(** **)** |const| -Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. +Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. -**Note:** This method only works on Android and UWP. On other platforms, it always returns :ref:`Vector3.ZERO`. +**Note:** This method only works on Android, iOS and UWP. On other platforms, it always returns :ref:`Vector3.ZERO`. ---- @@ -572,7 +576,7 @@ Stops the vibration of the joypad. Vibrate Android and iOS devices. -**Note:** It needs VIBRATE permission for Android at export settings. iOS does not support duration. +**Note:** It needs ``VIBRATE`` permission for Android at export settings. iOS does not support duration. ---- diff --git a/classes/class_inputevent.rst b/classes/class_inputevent.rst index bbf69418f..20c7cd3b3 100644 --- a/classes/class_inputevent.rst +++ b/classes/class_inputevent.rst @@ -27,6 +27,10 @@ Tutorials - :doc:`../tutorials/2d/2d_transforms` +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_inputeventaction.rst b/classes/class_inputeventaction.rst index 466f46fc9..e4b1e6e04 100644 --- a/classes/class_inputeventaction.rst +++ b/classes/class_inputeventaction.rst @@ -23,6 +23,10 @@ Tutorials - `#actions <../tutorials/inputs/inputevent.html#actions>`_ in :doc:`../tutorials/inputs/inputevent` +- `https://godotengine.org/asset-library/asset/515 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_inputeventmousemotion.rst b/classes/class_inputeventmousemotion.rst index 1d4372acd..f60060966 100644 --- a/classes/class_inputeventmousemotion.rst +++ b/classes/class_inputeventmousemotion.rst @@ -25,6 +25,8 @@ Tutorials - :doc:`../tutorials/inputs/mouse_and_input_coordinates` +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_instanceplaceholder.rst b/classes/class_instanceplaceholder.rst index 80a67c3c6..236f9b8a9 100644 --- a/classes/class_instanceplaceholder.rst +++ b/classes/class_instanceplaceholder.rst @@ -40,13 +40,15 @@ Method Descriptions - :ref:`Node` **create_instance** **(** :ref:`bool` replace=false, :ref:`PackedScene` custom_scene=null **)** +Not thread-safe. Use :ref:`Object.call_deferred` if calling from a thread. + ---- .. _class_InstancePlaceholder_method_get_instance_path: - :ref:`String` **get_instance_path** **(** **)** |const| -Gets the path to the :ref:`PackedScene` resource file that is loaded by default when calling :ref:`replace_by_instance`. +Gets the path to the :ref:`PackedScene` resource file that is loaded by default when calling :ref:`replace_by_instance`. Not thread-safe. Use :ref:`Object.call_deferred` if calling from a thread. ---- diff --git a/classes/class_int.rst b/classes/class_int.rst index 6ece4a666..7065ed32a 100644 --- a/classes/class_int.rst +++ b/classes/class_int.rst @@ -57,7 +57,7 @@ Cast a :ref:`bool` value to an integer value, ``int(true)`` will be - :ref:`int` **int** **(** :ref:`float` from **)** -Cast a float value to an integer value, this method simply removes the number fractions, so for example ``int(2.7)`` will be equals to 2, ``int(.1)`` will be equals to 0 and ``int(-2.7)`` will be equals to -2. +Cast a float value to an integer value, this method simply removes the number fractions (i.e. rounds ``from`` towards zero), so for example ``int(2.7)`` will be equals to 2, ``int(0.1)`` will be equals to 0 and ``int(-2.7)`` will be equals to -2. This operation is also called truncation. ---- diff --git a/classes/class_javascript.rst b/classes/class_javascript.rst index 1cdb1998f..bde60934d 100644 --- a/classes/class_javascript.rst +++ b/classes/class_javascript.rst @@ -18,6 +18,8 @@ Description The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. +**Note:** This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See `Compiling for the Web `_ in the documentation for more information. + Tutorials --------- diff --git a/classes/class_joint.rst b/classes/class_joint.rst index 9f5a0cedf..5815f03cd 100644 --- a/classes/class_joint.rst +++ b/classes/class_joint.rst @@ -20,6 +20,11 @@ Description Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/524 `_ + Properties ---------- diff --git a/classes/class_kinematicbody.rst b/classes/class_kinematicbody.rst index 162c98622..543f4300c 100644 --- a/classes/class_kinematicbody.rst +++ b/classes/class_kinematicbody.rst @@ -20,13 +20,21 @@ Kinematic bodies are special types of bodies that are meant to be user-controlle **Simulated motion:** When these bodies are moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`AnimationPlayer.playback_process_mode` set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). -**Kinematic characters:** KinematicBody also has an API for moving objects (the :ref:`move_and_collide` and :ref:`move_and_slide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. +**Kinematic characters:** KinematicBody also has an API for moving objects (the :ref:`move_and_collide` and :ref:`move_and_slide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. Tutorials --------- - :doc:`../tutorials/physics/kinematic_character_2d` +- `https://godotengine.org/asset-library/asset/126 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- @@ -167,7 +175,7 @@ Returns the linear velocity of the floor at the last collision point. Only valid - :ref:`KinematicCollision` **get_slide_collision** **(** :ref:`int` slide_idx **)** -Returns a :ref:`KinematicCollision`, which contains information about a collision that occurred during the last :ref:`move_and_slide` call. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). +Returns a :ref:`KinematicCollision`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). ---- @@ -175,7 +183,7 @@ Returns a :ref:`KinematicCollision`, which contains in - :ref:`int` **get_slide_count** **(** **)** |const| -Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide`. +Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -183,7 +191,7 @@ Returns the number of times the body collided and changed direction during the l - :ref:`bool` **is_on_ceiling** **(** **)** |const| -Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:`move_and_slide`. +Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -191,7 +199,7 @@ Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:` - :ref:`bool` **is_on_floor** **(** **)** |const| -Returns ``true`` if the body is on the floor. Only updates when calling :ref:`move_and_slide`. +Returns ``true`` if the body is on the floor. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -199,7 +207,7 @@ Returns ``true`` if the body is on the floor. Only updates when calling :ref:`mo - :ref:`bool` **is_on_wall** **(** **)** |const| -Returns ``true`` if the body is on a wall. Only updates when calling :ref:`move_and_slide`. +Returns ``true`` if the body is on a wall. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -217,7 +225,7 @@ If ``test_only`` is ``true``, the body does not move but the would-be collision - :ref:`Vector3` **move_and_slide** **(** :ref:`Vector3` linear_velocity, :ref:`Vector3` up_direction=Vector3( 0, 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** -Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody`` or :ref:`RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. +Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody`` or :ref:`RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in :ref:`Node._physics_process` (or in a method called by :ref:`Node._physics_process`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. diff --git a/classes/class_kinematicbody2d.rst b/classes/class_kinematicbody2d.rst index 501fad3c5..d3cc09bb1 100644 --- a/classes/class_kinematicbody2d.rst +++ b/classes/class_kinematicbody2d.rst @@ -20,7 +20,7 @@ Kinematic bodies are special types of bodies that are meant to be user-controlle **Simulated motion:** When these bodies are moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`AnimationPlayer.playback_process_mode` set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). -**Kinematic characters:** KinematicBody2D also has an API for moving objects (the :ref:`move_and_collide` and :ref:`move_and_slide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. +**Kinematic characters:** KinematicBody2D also has an API for moving objects (the :ref:`move_and_collide` and :ref:`move_and_slide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. Tutorials --------- @@ -29,6 +29,10 @@ Tutorials - :doc:`../tutorials/physics/using_kinematic_body_2d` +- `https://godotengine.org/asset-library/asset/113 `_ + +- `https://godotengine.org/asset-library/asset/120 `_ + Properties ---------- @@ -121,7 +125,7 @@ Returns the linear velocity of the floor at the last collision point. Only valid - :ref:`KinematicCollision2D` **get_slide_collision** **(** :ref:`int` slide_idx **)** -Returns a :ref:`KinematicCollision2D`, which contains information about a collision that occurred during the last :ref:`move_and_slide` call. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). +Returns a :ref:`KinematicCollision2D`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). **Example usage:** @@ -137,7 +141,7 @@ Returns a :ref:`KinematicCollision2D`, which contain - :ref:`int` **get_slide_count** **(** **)** |const| -Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide`. +Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -145,7 +149,7 @@ Returns the number of times the body collided and changed direction during the l - :ref:`bool` **is_on_ceiling** **(** **)** |const| -Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:`move_and_slide`. +Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -153,7 +157,7 @@ Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:` - :ref:`bool` **is_on_floor** **(** **)** |const| -Returns ``true`` if the body is on the floor. Only updates when calling :ref:`move_and_slide`. +Returns ``true`` if the body is on the floor. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -161,7 +165,7 @@ Returns ``true`` if the body is on the floor. Only updates when calling :ref:`mo - :ref:`bool` **is_on_wall** **(** **)** |const| -Returns ``true`` if the body is on a wall. Only updates when calling :ref:`move_and_slide`. +Returns ``true`` if the body is on a wall. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. ---- @@ -179,7 +183,7 @@ If ``test_only`` is ``true``, the body does not move but the would-be collision - :ref:`Vector2` **move_and_slide** **(** :ref:`Vector2` linear_velocity, :ref:`Vector2` up_direction=Vector2( 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** -Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody2D`` or :ref:`RigidBody2D`, it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. +Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody2D`` or :ref:`RigidBody2D`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in :ref:`Node._physics_process` (or in a method called by :ref:`Node._physics_process`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. diff --git a/classes/class_label.rst b/classes/class_label.rst index ffa27d3ea..01cb56d9e 100644 --- a/classes/class_label.rst +++ b/classes/class_label.rst @@ -20,6 +20,11 @@ Label displays plain text on the screen. It gives you control over the horizonta **Note:** Contrarily to most other :ref:`Control`\ s, Label's :ref:`Control.mouse_filter` defaults to :ref:`Control.MOUSE_FILTER_IGNORE` (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured :ref:`Control.hint_tooltip`, unless you change its mouse filter. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/515 `_ + Properties ---------- diff --git a/classes/class_light.rst b/classes/class_light.rst index c505753ea..38eb395a6 100644 --- a/classes/class_light.rst +++ b/classes/class_light.rst @@ -25,6 +25,8 @@ Tutorials - :doc:`../tutorials/3d/lights_and_shadows` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_line2d.rst b/classes/class_line2d.rst index 61cb63d85..8ceaa274d 100644 --- a/classes/class_line2d.rst +++ b/classes/class_line2d.rst @@ -20,6 +20,13 @@ A line through several points in 2D space. **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`. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/584 `_ + +- `https://godotengine.org/asset-library/asset/583 `_ + Properties ---------- diff --git a/classes/class_lineedit.rst b/classes/class_lineedit.rst index ae94a041b..7b224465d 100644 --- a/classes/class_lineedit.rst +++ b/classes/class_lineedit.rst @@ -117,6 +117,8 @@ Methods +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PopupMenu` | :ref:`get_menu` **(** **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_scroll_offset` **(** **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`menu_option` **(** :ref:`int` option **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` from=0, :ref:`int` to=-1 **)** | @@ -583,6 +585,14 @@ Returns the :ref:`PopupMenu` of this ``LineEdit``. By default, ---- +.. _class_LineEdit_method_get_scroll_offset: + +- :ref:`int` **get_scroll_offset** **(** **)** |const| + +Returns the scroll offset due to :ref:`caret_position`, as a number of characters. + +---- + .. _class_LineEdit_method_menu_option: - void **menu_option** **(** :ref:`int` option **)** diff --git a/classes/class_linkbutton.rst b/classes/class_linkbutton.rst index 57f360a9d..b2daf0e55 100644 --- a/classes/class_linkbutton.rst +++ b/classes/class_linkbutton.rst @@ -18,11 +18,11 @@ Description This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page). +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + Properties ---------- -+-----------------------------------------------------+-------------------------------------------------------+---------------------------+ -| :ref:`FocusMode` | enabled_focus_mode | ``0`` *(parent override)* | +-----------------------------------------------------+-------------------------------------------------------+---------------------------+ | :ref:`FocusMode` | focus_mode | ``0`` *(parent override)* | +-----------------------------------------------------+-------------------------------------------------------+---------------------------+ diff --git a/classes/class_mainloop.rst b/classes/class_mainloop.rst index eb0b3742c..1368523d0 100644 --- a/classes/class_mainloop.rst +++ b/classes/class_mainloop.rst @@ -249,7 +249,7 @@ Deprecated callback, does not do anything. Use :ref:`_input_event` **_iteration** **(** :ref:`float` delta **)** |virtual| -Called each physics frame with the time since the last physics frame as argument (in seconds). Equivalent to :ref:`Node._physics_process`. +Called each physics frame with the time since the last physics frame as argument (``delta``, in seconds). Equivalent to :ref:`Node._physics_process`. If implemented, the method must return a boolean value. ``true`` ends the main loop, while ``false`` lets it proceed to the next frame. diff --git a/classes/class_material.rst b/classes/class_material.rst index a23fc7581..48d7cbeea 100644 --- a/classes/class_material.rst +++ b/classes/class_material.rst @@ -20,6 +20,13 @@ Description Material is a base :ref:`Resource` used for coloring and shading geometry. All materials inherit from it and almost all :ref:`VisualInstance` derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/123 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_menubutton.rst b/classes/class_menubutton.rst index c286b4705..9cbce3bee 100644 --- a/classes/class_menubutton.rst +++ b/classes/class_menubutton.rst @@ -20,14 +20,14 @@ Special button that brings up a :ref:`PopupMenu` when clicked. New items can be created inside this :ref:`PopupMenu` using ``get_popup().add_item("My Item Name")``. You can also create them directly from the editor. To do so, select the ``MenuButton`` node, then in the toolbar at the top of the 2D editor, click **Items** then click **Add** in the popup. You will be able to give each items new properties. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + Properties ---------- +-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ | :ref:`ActionMode` | action_mode | ``0`` *(parent override)* | +-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ -| :ref:`FocusMode` | enabled_focus_mode | ``0`` *(parent override)* | -+-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ | :ref:`bool` | flat | ``true`` *(parent override)* | +-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ | :ref:`FocusMode` | focus_mode | ``0`` *(parent override)* | diff --git a/classes/class_mesh.rst b/classes/class_mesh.rst index 7a66317ef..746cc4123 100644 --- a/classes/class_mesh.rst +++ b/classes/class_mesh.rst @@ -20,6 +20,17 @@ Description Mesh is a type of :ref:`Resource` that contains vertex array-based geometry, divided in *surfaces*. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/123 `_ + +- `https://godotengine.org/asset-library/asset/126 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_meshdatatool.rst b/classes/class_meshdatatool.rst index 1a518059a..08f7a97a0 100644 --- a/classes/class_meshdatatool.rst +++ b/classes/class_meshdatatool.rst @@ -24,14 +24,21 @@ Below is an example of how MeshDataTool may be used. :: + var mesh = ArrayMesh.new() + mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, CubeMesh.new().get_mesh_arrays()) var mdt = MeshDataTool.new() mdt.create_from_surface(mesh, 0) for i in range(mdt.get_vertex_count()): var vertex = mdt.get_vertex(i) - ... + # In this example we extend the mesh by one unit, which results in seperated faces as it is flat shaded. + vertex += mdt.get_vertex_normal(i) + # Save your change. mdt.set_vertex(i, vertex) mesh.surface_remove(0) mdt.commit_to_surface(mesh) + var mi = MeshInstance.new() + mi.mesh = mesh + add_child(mi) See also :ref:`ArrayMesh`, :ref:`ImmediateGeometry` and :ref:`SurfaceTool` for procedural geometry generation. diff --git a/classes/class_meshinstance.rst b/classes/class_meshinstance.rst index 9b80cc762..17a19e019 100644 --- a/classes/class_meshinstance.rst +++ b/classes/class_meshinstance.rst @@ -20,16 +20,29 @@ Description MeshInstance is a node that takes a :ref:`Mesh` resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single :ref:`Mesh` in many places. This allows to reuse geometry and save on resources. When a :ref:`Mesh` has to be instanced more than thousands of times at close proximity, consider using a :ref:`MultiMesh` in a :ref:`MultiMeshInstance` instead. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/123 `_ + +- `https://godotengine.org/asset-library/asset/126 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- -+---------------------------------+-------------------------------------------------------+--------------------+ -| :ref:`Mesh` | :ref:`mesh` | | -+---------------------------------+-------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`skeleton` | ``NodePath("..")`` | -+---------------------------------+-------------------------------------------------------+--------------------+ -| :ref:`Skin` | :ref:`skin` | | -+---------------------------------+-------------------------------------------------------+--------------------+ ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`Mesh` | :ref:`mesh` | | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`NodePath` | :ref:`skeleton` | ``NodePath("..")`` | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`Skin` | :ref:`skin` | | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`software_skinning_transform_normals` | ``true`` | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ Methods ------- @@ -41,6 +54,8 @@ Methods +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`create_trimesh_collision` **(** **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Material` | :ref:`get_active_material` **(** :ref:`int` surface **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Material` | :ref:`get_surface_material` **(** :ref:`int` surface **)** |const| | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_surface_material_count` **(** **)** |const| | @@ -93,6 +108,24 @@ The :ref:`Mesh` resource for the instance. Sets the skin to be used by this instance. +---- + +.. _class_MeshInstance_property_software_skinning_transform_normals: + +- :ref:`bool` **software_skinning_transform_normals** + ++-----------+--------------------------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------------------------+ +| *Setter* | set_software_skinning_transform_normals(value) | ++-----------+--------------------------------------------------+ +| *Getter* | is_software_skinning_transform_normals_enabled() | ++-----------+--------------------------------------------------+ + +If ``true``, normals are transformed when software skinning is used. Set to ``false`` when normals are not needed for better performance. + +See :ref:`ProjectSettings.rendering/quality/skinning/software_skinning_fallback` for details about how software skinning is enabled. + Method Descriptions ------------------- @@ -120,6 +153,14 @@ This helper creates a :ref:`StaticBody` child node with a :ref ---- +.. _class_MeshInstance_method_get_active_material: + +- :ref:`Material` **get_active_material** **(** :ref:`int` surface **)** |const| + +Returns the :ref:`Material` that will be used by the :ref:`Mesh` when drawing. This can return the :ref:`GeometryInstance.material_override`, the surface override :ref:`Material` defined in this ``MeshInstance``, or the surface :ref:`Material` defined in the :ref:`Mesh`. For example, if :ref:`GeometryInstance.material_override` is used, all surfaces will return the override material. + +---- + .. _class_MeshInstance_method_get_surface_material: - :ref:`Material` **get_surface_material** **(** :ref:`int` surface **)** |const| diff --git a/classes/class_meshlibrary.rst b/classes/class_meshlibrary.rst index d2d7c6fea..2ab3262ed 100644 --- a/classes/class_meshlibrary.rst +++ b/classes/class_meshlibrary.rst @@ -18,6 +18,13 @@ Description A library of meshes. Contains a list of :ref:`Mesh` resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in :ref:`GridMap`. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/126 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + Methods ------- diff --git a/classes/class_multimesh.rst b/classes/class_multimesh.rst index 1549abbe4..1dca78f46 100644 --- a/classes/class_multimesh.rst +++ b/classes/class_multimesh.rst @@ -278,7 +278,7 @@ All data is packed in one large float array. An array may look like this: Transf - void **set_instance_color** **(** :ref:`int` instance, :ref:`Color` color **)** -Sets the color of a specific instance. +Sets the color of a specific instance by *multiplying* the mesh's existing vertex colors. For the color to take effect, ensure that :ref:`color_format` is non-``null`` on the ``MultiMesh`` and :ref:`SpatialMaterial.vertex_color_use_as_albedo` is ``true`` on the material. diff --git a/classes/class_multiplayerapi.rst b/classes/class_multiplayerapi.rst index 0084993db..e6dbe8eb0 100644 --- a/classes/class_multiplayerapi.rst +++ b/classes/class_multiplayerapi.rst @@ -32,6 +32,8 @@ Properties +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`refuse_new_network_connections` | ``false`` | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Node` | :ref:`root_node` | | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ Methods ------- @@ -53,8 +55,6 @@ Methods +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`send_bytes` **(** :ref:`PoolByteArray` bytes, :ref:`int` id=0, :ref:`TransferMode` mode=2 **)** | +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_root_node` **(** :ref:`Node` node **)** | -+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- @@ -197,6 +197,22 @@ The peer object to handle the RPC system (effectively enabling networking when s If ``true``, the MultiplayerAPI's :ref:`network_peer` refuses new incoming connections. +---- + +.. _class_MultiplayerAPI_property_root_node: + +- :ref:`Node` **root_node** + ++----------+----------------------+ +| *Setter* | set_root_node(value) | ++----------+----------------------+ +| *Getter* | get_root_node() | ++----------+----------------------+ + +The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. + +This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. + Method Descriptions ------------------- @@ -266,16 +282,6 @@ Method used for polling the MultiplayerAPI. You only need to worry about this if Sends the given raw ``bytes`` to a specific peer identified by ``id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Default ID is ``0``, i.e. broadcast to all peers. ----- - -.. _class_MultiplayerAPI_method_set_root_node: - -- void **set_root_node** **(** :ref:`Node` node **)** - -Sets the base root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. - -This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. - .. |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_navigation.rst b/classes/class_navigation.rst index 6e88e86e1..c73f72daa 100644 --- a/classes/class_navigation.rst +++ b/classes/class_navigation.rst @@ -18,6 +18,11 @@ Description Provides navigation and pathfinding within a collection of :ref:`NavigationMesh`\ es. By default, these will be automatically collected from child :ref:`NavigationMeshInstance` nodes, but they can also be added on the fly with :ref:`navmesh_add`. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/124 `_ + Properties ---------- diff --git a/classes/class_navigation2d.rst b/classes/class_navigation2d.rst index f3f33066a..ed92e719c 100644 --- a/classes/class_navigation2d.rst +++ b/classes/class_navigation2d.rst @@ -18,6 +18,11 @@ Description Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of :ref:`NavigationPolygon` resources. By default, these are automatically collected from child :ref:`NavigationPolygonInstance` nodes, but they can also be added on the fly with :ref:`navpoly_add`. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/117 `_ + Methods ------- diff --git a/classes/class_navigationmesh.rst b/classes/class_navigationmesh.rst index dfdcce267..d589dee97 100644 --- a/classes/class_navigationmesh.rst +++ b/classes/class_navigationmesh.rst @@ -13,6 +13,11 @@ NavigationMesh +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/124 `_ + Properties ---------- diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst index 90d380181..2ed409290 100644 --- a/classes/class_navigationpolygon.rst +++ b/classes/class_navigationpolygon.rst @@ -39,6 +39,11 @@ Using :ref:`add_polygon` and indices polygon.add_polygon(indices) $NavigationPolygonInstance.navpoly = polygon +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/117 `_ + Methods ------- diff --git a/classes/class_networkedmultiplayerpeer.rst b/classes/class_networkedmultiplayerpeer.rst index 0aaf95716..69166f29f 100644 --- a/classes/class_networkedmultiplayerpeer.rst +++ b/classes/class_networkedmultiplayerpeer.rst @@ -25,6 +25,8 @@ Tutorials - :doc:`../tutorials/networking/high_level_multiplayer` +- `https://godotengine.org/asset-library/asset/537 `_ + Properties ---------- diff --git a/classes/class_ninepatchrect.rst b/classes/class_ninepatchrect.rst index 65ec096c9..ba3b570a9 100644 --- a/classes/class_ninepatchrect.rst +++ b/classes/class_ninepatchrect.rst @@ -74,11 +74,15 @@ Enumerations enum **AxisStretchMode**: -- **AXIS_STRETCH_MODE_STRETCH** = **0** --- Doesn't do anything at the time of writing. +- **AXIS_STRETCH_MODE_STRETCH** = **0** --- Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. -- **AXIS_STRETCH_MODE_TILE** = **1** --- Doesn't do anything at the time of writing. +- **AXIS_STRETCH_MODE_TILE** = **1** --- Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. -- **AXIS_STRETCH_MODE_TILE_FIT** = **2** --- Doesn't do anything at the time of writing. +**Note:** Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like :ref:`AXIS_STRETCH_MODE_STRETCH`. + +- **AXIS_STRETCH_MODE_TILE_FIT** = **2** --- Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than :ref:`AXIS_STRETCH_MODE_STRETCH`. The texture must be seamless for this to work without displaying artifacts between edges. + +**Note:** Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like :ref:`AXIS_STRETCH_MODE_STRETCH`. Property Descriptions --------------------- @@ -95,7 +99,7 @@ Property Descriptions | *Getter* | get_h_axis_stretch_mode() | +-----------+--------------------------------+ -Doesn't do anything at the time of writing. +The stretch mode to use for horizontal stretching/tiling. See :ref:`AxisStretchMode` for possible values. ---- @@ -111,7 +115,7 @@ Doesn't do anything at the time of writing. | *Getter* | get_v_axis_stretch_mode() | +-----------+--------------------------------+ -Doesn't do anything at the time of writing. +The stretch mode to use for vertical stretching/tiling. See :ref:`AxisStretchMode` for possible values. ---- @@ -159,7 +163,7 @@ The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's botto | *Getter* | get_patch_margin() | +-----------+-------------------------+ -The height of the 9-slice's left column. +The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ---- @@ -175,7 +179,7 @@ The height of the 9-slice's left column. | *Getter* | get_patch_margin() | +-----------+-------------------------+ -The height of the 9-slice's right column. +The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ---- @@ -191,7 +195,7 @@ The height of the 9-slice's right column. | *Getter* | get_patch_margin() | +-----------+-------------------------+ -The height of the 9-slice's top row. +The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ---- diff --git a/classes/class_node.rst b/classes/class_node.rst index 3c43498eb..97844f0fc 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -28,7 +28,7 @@ Once all nodes have been added in the scene tree, they receive the :ref:`NOTIFIC This means that when adding a node to the scene tree, the following order will be used for the callbacks: :ref:`_enter_tree` of the parent, :ref:`_enter_tree` of the children, :ref:`_ready` of the children and finally :ref:`_ready` of the parent (recursively for the entire scene tree). -**Processing:** Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback :ref:`_process`, toggled with :ref:`set_process`) happens as fast as possible and is dependent on the frame rate, so the processing time *delta* is passed as an argument. Physics processing (callback :ref:`_physics_process`, toggled with :ref:`set_physics_process`) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine. +**Processing:** Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback :ref:`_process`, toggled with :ref:`set_process`) happens as fast as possible and is dependent on the frame rate, so the processing time *delta* (in seconds) is passed as an argument. Physics processing (callback :ref:`_physics_process`, toggled with :ref:`set_physics_process`) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine. Nodes can also process input events. When present, the :ref:`_input` function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the :ref:`_unhandled_input` function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI :ref:`Control` nodes), ensuring that the node only receives the events that were meant for it. @@ -45,6 +45,8 @@ Tutorials - :doc:`../getting_started/step_by_step/scenes_and_nodes` +- `https://github.com/godotengine/godot-demo-projects/ `_ + Properties ---------- @@ -529,6 +531,8 @@ The :ref:`MultiplayerAPI` instance associated with this no The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed. +**Note:** Auto-generated names might include the ``@`` character, which is reserved for unique names when using :ref:`add_child`. When setting the name manually, any ``@`` will be removed. + ---- .. _class_Node_property_owner: @@ -630,7 +634,7 @@ For gameplay input, :ref:`_unhandled_input` - void **_physics_process** **(** :ref:`float` delta **)** |virtual| -Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the ``delta`` variable should be constant. +Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the ``delta`` variable should be constant. ``delta`` is in seconds. It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_physics_process`. @@ -644,7 +648,7 @@ Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS` delta **)** |virtual| -Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the ``delta`` time since the previous frame is not constant. +Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the ``delta`` time since the previous frame is not constant. ``delta`` is in seconds. It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process`. @@ -716,7 +720,7 @@ If ``legible_unique_name`` is ``true``, the child node will have an human-readab child_node.get_parent().remove_child(child_node) add_child(child_node) -**Note:** If you want a child to be persisted to a :ref:`PackedScene`, you must set :ref:`owner` in addition to calling :ref:`add_child`. This is typically relevant for `tool scripts `_ and `editor plugins `_. If :ref:`add_child` is called without setting :ref:`owner`, the newly added ``Node`` will not be visible in the scene tree, though it will be visible in the 2D/3D view. +**Note:** If you want a child to be persisted to a :ref:`PackedScene`, you must set :ref:`owner` in addition to calling :ref:`add_child`. This is typically relevant for `tool scripts `_ and `editor plugins `_. If :ref:`add_child` is called without setting :ref:`owner`, the newly added ``Node`` will not be visible in the scene tree, though it will be visible in the 2D/3D view. ---- @@ -922,7 +926,7 @@ Returns the relative :ref:`NodePath` from this node to the speci - :ref:`float` **get_physics_process_delta_time** **(** **)** |const| -Returns the time elapsed since the last physics-bound frame (see :ref:`_physics_process`). This is always a constant value in physics processing unless the frames per second is changed via :ref:`Engine.iterations_per_second`. +Returns the time elapsed (in seconds) since the last physics-bound frame (see :ref:`_physics_process`). This is always a constant value in physics processing unless the frames per second is changed via :ref:`Engine.iterations_per_second`. ---- @@ -1168,7 +1172,7 @@ Queues a node for deletion at the end of the current frame. When deleted, all of - void **raise** **(** **)** -Moves this node to the bottom of parent node's children hierarchy. This is often useful in GUIs (:ref:`Control` nodes), because their order of drawing depends on their order in the tree, i.e. the further they are on the node list, the higher they are drawn. After using ``raise``, a Control will be drawn on top of their siblings. +Moves this node to the bottom of parent node's children hierarchy. This is often useful in GUIs (:ref:`Control` nodes), because their order of drawing depends on their order in the tree. The top Node is drawn first, then any siblings below the top Node in the hierarchy are successively drawn on top of it. After using ``raise``, a Control will be drawn on top of its siblings. ---- @@ -1322,7 +1326,9 @@ Enables or disables physics (i.e. fixed framerate) processing. When a node is be - void **set_physics_process_internal** **(** :ref:`bool` enable **)** -Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal :ref:`_physics_process` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (:ref:`set_physics_process`). Only useful for advanced uses to manipulate built-in nodes' behaviour. +Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal :ref:`_physics_process` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (:ref:`set_physics_process`). Only useful for advanced uses to manipulate built-in nodes' behavior. + +**Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. ---- @@ -1346,7 +1352,9 @@ Enables or disables input processing. This is not required for GUI controls! Ena - void **set_process_internal** **(** :ref:`bool` enable **)** -Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal :ref:`_process` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (:ref:`set_process`). Only useful for advanced uses to manipulate built-in nodes' behaviour. +Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal :ref:`_process` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (:ref:`set_process`). Only useful for advanced uses to manipulate built-in nodes' behavior. + +**Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. ---- diff --git a/classes/class_node2d.rst b/classes/class_node2d.rst index 47e2434a2..69f3102e9 100644 --- a/classes/class_node2d.rst +++ b/classes/class_node2d.rst @@ -25,6 +25,8 @@ Tutorials - :doc:`../tutorials/2d/custom_drawing_in_2d` +- `https://github.com/godotengine/godot-demo-projects/tree/master/2d `_ + Properties ---------- diff --git a/classes/class_nodepath.rst b/classes/class_nodepath.rst index 28270be33..5887e250d 100644 --- a/classes/class_nodepath.rst +++ b/classes/class_nodepath.rst @@ -35,6 +35,11 @@ Some examples of NodePaths include the following: @"/root/Main" # If your main scene's root node were named "Main". @"/root/MyAutoload" # If you have an autoloaded node or scene. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/520 `_ + Methods ------- diff --git a/classes/class_omnilight.rst b/classes/class_omnilight.rst index 7e98981a5..137e45f41 100644 --- a/classes/class_omnilight.rst +++ b/classes/class_omnilight.rst @@ -18,6 +18,8 @@ Description An Omnidirectional light is a type of :ref:`Light` that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters. +**Note:** By default, only 32 OmniLights may affect a single mesh *resource* at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase :ref:`ProjectSettings.rendering/limits/rendering/max_lights_per_object` at the cost of shader compilation times. + Tutorials --------- diff --git a/classes/class_opensimplexnoise.rst b/classes/class_opensimplexnoise.rst index a972caa90..f863006a7 100644 --- a/classes/class_opensimplexnoise.rst +++ b/classes/class_opensimplexnoise.rst @@ -52,23 +52,23 @@ Properties Methods ------- -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Image` | :ref:`get_image` **(** :ref:`int` width, :ref:`int` height **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_noise_1d` **(** :ref:`float` x **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_noise_2d` **(** :ref:`float` x, :ref:`float` y **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_noise_2dv` **(** :ref:`Vector2` pos **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_noise_3d` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_noise_3dv` **(** :ref:`Vector3` pos **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_noise_4d` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Image` | :ref:`get_seamless_image` **(** :ref:`int` size **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_image` **(** :ref:`int` width, :ref:`int` height **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_1d` **(** :ref:`float` x **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_2d` **(** :ref:`float` x, :ref:`float` y **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_2dv` **(** :ref:`Vector2` pos **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_3d` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_3dv` **(** :ref:`Vector3` pos **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_4d` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_seamless_image` **(** :ref:`int` size **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -158,7 +158,7 @@ Method Descriptions .. _class_OpenSimplexNoise_method_get_image: -- :ref:`Image` **get_image** **(** :ref:`int` width, :ref:`int` height **)** +- :ref:`Image` **get_image** **(** :ref:`int` width, :ref:`int` height **)** |const| Generate a noise image with the requested ``width`` and ``height``, based on the current noise parameters. @@ -166,7 +166,7 @@ Generate a noise image with the requested ``width`` and ``height``, based on the .. _class_OpenSimplexNoise_method_get_noise_1d: -- :ref:`float` **get_noise_1d** **(** :ref:`float` x **)** +- :ref:`float` **get_noise_1d** **(** :ref:`float` x **)** |const| Returns the 1D noise value ``[-1,1]`` at the given x-coordinate. @@ -176,7 +176,7 @@ Returns the 1D noise value ``[-1,1]`` at the given x-coordinate. .. _class_OpenSimplexNoise_method_get_noise_2d: -- :ref:`float` **get_noise_2d** **(** :ref:`float` x, :ref:`float` y **)** +- :ref:`float` **get_noise_2d** **(** :ref:`float` x, :ref:`float` y **)** |const| Returns the 2D noise value ``[-1,1]`` at the given position. @@ -184,7 +184,7 @@ Returns the 2D noise value ``[-1,1]`` at the given position. .. _class_OpenSimplexNoise_method_get_noise_2dv: -- :ref:`float` **get_noise_2dv** **(** :ref:`Vector2` pos **)** +- :ref:`float` **get_noise_2dv** **(** :ref:`Vector2` pos **)** |const| Returns the 2D noise value ``[-1,1]`` at the given position. @@ -192,7 +192,7 @@ Returns the 2D noise value ``[-1,1]`` at the given position. .. _class_OpenSimplexNoise_method_get_noise_3d: -- :ref:`float` **get_noise_3d** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** +- :ref:`float` **get_noise_3d** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** |const| Returns the 3D noise value ``[-1,1]`` at the given position. @@ -200,7 +200,7 @@ Returns the 3D noise value ``[-1,1]`` at the given position. .. _class_OpenSimplexNoise_method_get_noise_3dv: -- :ref:`float` **get_noise_3dv** **(** :ref:`Vector3` pos **)** +- :ref:`float` **get_noise_3dv** **(** :ref:`Vector3` pos **)** |const| Returns the 3D noise value ``[-1,1]`` at the given position. @@ -208,7 +208,7 @@ Returns the 3D noise value ``[-1,1]`` at the given position. .. _class_OpenSimplexNoise_method_get_noise_4d: -- :ref:`float` **get_noise_4d** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** +- :ref:`float` **get_noise_4d** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** |const| Returns the 4D noise value ``[-1,1]`` at the given position. @@ -216,7 +216,7 @@ Returns the 4D noise value ``[-1,1]`` at the given position. .. _class_OpenSimplexNoise_method_get_seamless_image: -- :ref:`Image` **get_seamless_image** **(** :ref:`int` size **)** +- :ref:`Image` **get_seamless_image** **(** :ref:`int` size **)** |const| Generate a tileable noise image, based on the current noise parameters. Generated seamless images are always square (``size`` × ``size``). diff --git a/classes/class_optionbutton.rst b/classes/class_optionbutton.rst index 803280549..95d434f4a 100644 --- a/classes/class_optionbutton.rst +++ b/classes/class_optionbutton.rst @@ -18,6 +18,8 @@ Description OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + Properties ---------- diff --git a/classes/class_os.rst b/classes/class_os.rst index 2f032a281..bc608837a 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -18,6 +18,11 @@ Description Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/677 `_ + Properties ---------- @@ -125,6 +130,8 @@ Methods +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_name` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_native_handle` **(** :ref:`HandleType` handle_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_power_percent_left` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_power_seconds_left` **(** **)** | @@ -277,6 +284,8 @@ Methods +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_window_always_on_top` **(** :ref:`bool` enabled **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_window_mouse_passthrough` **(** :ref:`PoolVector2Array` region **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_window_title` **(** :ref:`String` title **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`shell_open` **(** :ref:`String` uri **)** | @@ -389,6 +398,58 @@ enum **Month**: ---- +.. _enum_OS_HandleType: + +.. _class_OS_constant_APPLICATION_HANDLE: + +.. _class_OS_constant_DISPLAY_HANDLE: + +.. _class_OS_constant_WINDOW_HANDLE: + +.. _class_OS_constant_WINDOW_VIEW: + +.. _class_OS_constant_OPENGL_CONTEXT: + +enum **HandleType**: + +- **APPLICATION_HANDLE** = **0** --- Application handle: + +- Windows: ``HINSTANCE`` of the application + +- MacOS: ``NSApplication*`` 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 + +- **WINDOW_HANDLE** = **2** --- Window handle: + +- Windows: ``HWND`` of the main window + +- Linux: ``X11::Window*`` of the main window + +- MacOS: ``NSWindow*`` of the main window (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 + +- MacOS: ``NSView*`` of the main windows view (not yet implemented) + +- **OPENGL_CONTEXT** = **4** --- OpenGL Context: + +- Windows: ``HGLRC`` + +- Linux: ``X11::GLXContext`` + +- MacOS: ``NSOpenGLContext*`` (not yet implemented) + +---- + .. _enum_OS_ScreenOrientation: .. _class_OS_constant_SCREEN_ORIENTATION_LANDSCAPE: @@ -1132,6 +1193,16 @@ Returns the name of the host OS. Possible values are: ``"Android"``, ``"iOS"``, ---- +.. _class_OS_method_get_native_handle: + +- :ref:`int` **get_native_handle** **(** :ref:`HandleType` handle_type **)** + +Returns internal structure pointers for use in GDNative plugins. + +**Note:** This method is implemented on Linux and Windows (other OSs will soon be supported). + +---- + .. _class_OS_method_get_power_percent_left: - :ref:`int` **get_power_percent_left** **(** **)** @@ -1212,7 +1283,9 @@ Returns the number of displays attached to the host machine. Returns the dots per inch density of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used. -On Android devices, the actual screen densities are grouped into six generalized densities: +**Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used. + +**Note:** On Android devices, the actual screen densities are grouped into six generalized densities: :: @@ -1385,6 +1458,8 @@ Returns a string that is unique to the device. Returns the current UNIX epoch timestamp. +**Important:** This is the system clock that the user can manully set. **Never use** this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. **Always use** :ref:`get_ticks_usec` or :ref:`get_ticks_msec` for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease). + ---- .. _class_OS_method_get_unix_time_from_datetime: @@ -1499,7 +1574,7 @@ Returns ``true`` if an environment variable exists. - :ref:`bool` **has_feature** **(** :ref:`String` tag_name **)** |const| -Returns ``true`` if the feature for the given feature tag is supported in the currently running instance, depending on platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the `Feature Tags `_ documentation for more details. +Returns ``true`` if the feature for the given feature tag is supported in the currently running instance, depending on platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the `Feature Tags `_ documentation for more details. **Note:** Tag names are case-sensitive. @@ -1859,6 +1934,31 @@ Sets whether the window should always be on top. ---- +.. _class_OS_method_set_window_mouse_passthrough: + +- void **set_window_mouse_passthrough** **(** :ref:`PoolVector2Array` region **)** + +Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. + +Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior). + +:: + + # Set region, using Path2D node. + OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points()) + + # Set region, using Polygon2D node. + OS.set_window_mouse_passthrough($Polygon2D.polygon) + + # Reset region to default. + OS.set_window_mouse_passthrough([]) + +**Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + .. _class_OS_method_set_window_title: - void **set_window_title** **(** :ref:`String` title **)** diff --git a/classes/class_packedscene.rst b/classes/class_packedscene.rst index 0ac670d2b..361fbb6be 100644 --- a/classes/class_packedscene.rst +++ b/classes/class_packedscene.rst @@ -55,6 +55,11 @@ Can be used to save a node to a file. When saving, the node as well as all the n if error != OK: push_error("An error occurred while saving the scene to disk.") +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/520 `_ + Properties ---------- diff --git a/classes/class_packetpeerudp.rst b/classes/class_packetpeerudp.rst index d3a064b6a..cd1001336 100644 --- a/classes/class_packetpeerudp.rst +++ b/classes/class_packetpeerudp.rst @@ -64,7 +64,7 @@ Closes the UDP socket the ``PacketPeerUDP`` is currently listening on. Calling this method connects this UDP peer to the given ``host``/``port`` pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to :ref:`set_dest_address` are not allowed). This method does not send any data to the remote peer, to do that, use :ref:`PacketPeer.put_var` or :ref:`PacketPeer.put_packet` as usual. See also :ref:`UDPServer`. -Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. +**Note:** Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. ---- @@ -160,6 +160,20 @@ Note: :ref:`set_broadcast_enabled`. +**Note:** :ref:`wait` can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: + +:: + + # Server + socket.set_dest_address("127.0.0.1", 789) + socket.put_packet("Time to stop".to_ascii()) + + # Client + while socket.wait() == OK: + var data = socket.get_packet().get_string_from_ascii() + if data == "Time to stop": + return + .. |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_panel.rst b/classes/class_panel.rst index 7102b7e87..9d66aca45 100644 --- a/classes/class_panel.rst +++ b/classes/class_panel.rst @@ -18,6 +18,15 @@ Description Panel is a :ref:`Control` that displays an opaque background. It's commonly used as a parent and container for other types of :ref:`Control` nodes. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/520 `_ + +- `https://godotengine.org/asset-library/asset/516 `_ + +- `https://godotengine.org/asset-library/asset/523 `_ + Theme Properties ---------------- diff --git a/classes/class_panelcontainer.rst b/classes/class_panelcontainer.rst index 4dcd081b7..dfac265b5 100644 --- a/classes/class_panelcontainer.rst +++ b/classes/class_panelcontainer.rst @@ -20,6 +20,11 @@ Description Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/520 `_ + Theme Properties ---------------- diff --git a/classes/class_particles.rst b/classes/class_particles.rst index 0f3742c17..6a5de6c57 100644 --- a/classes/class_particles.rst +++ b/classes/class_particles.rst @@ -11,7 +11,7 @@ Particles **Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -3D particle emitter. +GPU-based 3D particle emitter. Description ----------- @@ -20,11 +20,17 @@ Description Use the ``process_material`` property to add a :ref:`ParticlesMaterial` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial` which will be applied to all particles. +**Note:** ``Particles`` only work when using the GLES3 renderer. If using the GLES2 renderer, use :ref:`CPUParticles` instead. You can convert ``Particles`` to :ref:`CPUParticles` by selecting the node, clicking the **Particles** menu at the top of the 3D editor viewport then choosing **Convert to CPUParticles**. + +**Note:** After working on a Particles node, remember to update its :ref:`visibility_aabb` by selecting it, clicking the **Particles** menu at the top of the 3D editor viewport then choose **Generate Visibility AABB**. Otherwise, particles may suddenly disappear depending on the camera position and angle. + Tutorials --------- - :doc:`../tutorials/3d/vertex_animation/controlling_thousands_of_fish` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- @@ -122,7 +128,9 @@ Property Descriptions | *Getter* | get_amount() | +-----------+-------------------+ -Number of particles to emit. +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. ---- @@ -290,7 +298,7 @@ If ``true``, results in fractional delta calculation which has a smoother partic | *Getter* | get_lifetime() | +-----------+---------------------+ -Amount of time each particle will exist. +The amount of time each particle will exist (in seconds). ---- diff --git a/classes/class_particles2d.rst b/classes/class_particles2d.rst index afb3fdb85..ea967620e 100644 --- a/classes/class_particles2d.rst +++ b/classes/class_particles2d.rst @@ -11,7 +11,7 @@ Particles2D **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -2D particle emitter. +GPU-based 2D particle emitter. Description ----------- @@ -20,11 +20,17 @@ Description Use the ``process_material`` property to add a :ref:`ParticlesMaterial` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial` which will be applied to all particles. +**Note:** ``Particles2D`` only work when using the GLES3 renderer. If using the GLES2 renderer, use :ref:`CPUParticles2D` instead. You can convert ``Particles2D`` to :ref:`CPUParticles2D` by selecting the node, clicking the **Particles** menu at the top of the 2D editor viewport then choosing **Convert to CPUParticles2D**. + +**Note:** After working on a Particles node, remember to update its :ref:`visibility_rect` by selecting it, clicking the **Particles** menu at the top of the 2D editor viewport then choose **Generate Visibility Rect**. Otherwise, particles may suddenly disappear depending on the camera position and angle. + Tutorials --------- - :doc:`../tutorials/2d/particle_systems_2d` +- `https://godotengine.org/asset-library/asset/515 `_ + Properties ---------- @@ -101,7 +107,9 @@ Property Descriptions | *Getter* | get_amount() | +-----------+-------------------+ -Number of particles emitted in one emission cycle. +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. ---- @@ -197,7 +205,7 @@ If ``true``, results in fractional delta calculation which has a smoother partic | *Getter* | get_lifetime() | +-----------+---------------------+ -Amount of time each particle will exist. +The amount of time each particle will exist (in seconds). ---- diff --git a/classes/class_physics2dshapequeryparameters.rst b/classes/class_physics2dshapequeryparameters.rst index 7168a4c34..60c5175b5 100644 --- a/classes/class_physics2dshapequeryparameters.rst +++ b/classes/class_physics2dshapequeryparameters.rst @@ -93,7 +93,7 @@ If ``true``, the query will take :ref:`PhysicsBody2D`\ s in | *Getter* | get_collision_layer() | +-----------+----------------------------+ -The physics layer(s) the query will take into account (as a bitmask). See `Collision layers and masks `_ in the documentation for more information. +The physics layer(s) the query will take into account (as a bitmask). See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_physicsbody.rst b/classes/class_physicsbody.rst index c846c5a17..df1c30c6f 100644 --- a/classes/class_physicsbody.rst +++ b/classes/class_physicsbody.rst @@ -72,7 +72,7 @@ The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the :ref:`collision_mask` property. -A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. +A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -88,7 +88,7 @@ A contact is detected if object A is in any of the layers that object B scans, o | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this area scans for collisions. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this area scans for collisions. See `Collision layers and masks `_ in the documentation for more information. Method Descriptions ------------------- diff --git a/classes/class_physicsbody2d.rst b/classes/class_physicsbody2d.rst index 1622af8f2..cdf26639c 100644 --- a/classes/class_physicsbody2d.rst +++ b/classes/class_physicsbody2d.rst @@ -76,7 +76,7 @@ The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the :ref:`collision_mask` property. -A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. +A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -92,7 +92,7 @@ A contact is detected if object A is in any of the layers that object B scans, o | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this area scans for collisions. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this area scans for collisions. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_physicsshapequeryparameters.rst b/classes/class_physicsshapequeryparameters.rst index 52915dd59..8033ac373 100644 --- a/classes/class_physicsshapequeryparameters.rst +++ b/classes/class_physicsshapequeryparameters.rst @@ -91,7 +91,7 @@ If ``true``, the query will take :ref:`PhysicsBody`\ s into a | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layer(s) the query will take into account (as a bitmask). See `Collision layers and masks `_ in the documentation for more information. +The physics layer(s) the query will take into account (as a bitmask). See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_pinjoint.rst b/classes/class_pinjoint.rst index 06f794ed7..8bd50035c 100644 --- a/classes/class_pinjoint.rst +++ b/classes/class_pinjoint.rst @@ -11,12 +11,12 @@ PinJoint **Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -Pin joint for 3D shapes. +Pin joint for 3D PhysicsBodies. Description ----------- -Pin joint for 3D rigid bodies. It pins 2 bodies (rigid or static) together. +Pin joint for 3D rigid bodies. It pins 2 bodies (rigid or static) together. See also :ref:`Generic6DOFJoint`. Properties ---------- diff --git a/classes/class_planemesh.rst b/classes/class_planemesh.rst index ca376ea5b..d411523f2 100644 --- a/classes/class_planemesh.rst +++ b/classes/class_planemesh.rst @@ -18,6 +18,8 @@ Description Class representing a planar :ref:`PrimitiveMesh`. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Z axes; this default rotation isn't suited for use with billboarded materials. For billboarded materials, use :ref:`QuadMesh` instead. +**Note:** When using a large textured ``PlaneMesh`` (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase :ref:`subdivide_depth` and :ref:`subdivide_width` until you no longer notice UV jittering. + Properties ---------- diff --git a/classes/class_poolstringarray.rst b/classes/class_poolstringarray.rst index 7a0bdb070..bdb11b57e 100644 --- a/classes/class_poolstringarray.rst +++ b/classes/class_poolstringarray.rst @@ -18,6 +18,11 @@ An :ref:`Array` specifically designed to hold :ref:`String`_ + Methods ------- diff --git a/classes/class_poolvector2array.rst b/classes/class_poolvector2array.rst index 6f3097f80..8b93e8a0c 100644 --- a/classes/class_poolvector2array.rst +++ b/classes/class_poolvector2array.rst @@ -18,6 +18,11 @@ An :ref:`Array` specifically designed to hold :ref:`Vector2`_ + Methods ------- diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index 6747b1b9e..69be3f55e 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -63,7 +63,7 @@ Methods +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_radio_check_shortcut` **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_separator` **(** :ref:`String` label="" **)** | +| void | :ref:`add_separator` **(** :ref:`String` label="", :ref:`int` id=-1 **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_shortcut` **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -162,6 +162,8 @@ Theme Properties +---------------------------------+-------------------------+------------------------------+ | :ref:`Color` | font_color_hover | Color( 0.88, 0.88, 0.88, 1 ) | +---------------------------------+-------------------------+------------------------------+ +| :ref:`Color` | font_color_separator | Color( 0.88, 0.88, 0.88, 1 ) | ++---------------------------------+-------------------------+------------------------------+ | :ref:`StyleBox` | hover | | +---------------------------------+-------------------------+------------------------------+ | :ref:`int` | hseparation | 4 | @@ -428,9 +430,11 @@ An ``id`` can optionally be provided. If no ``id`` is provided, one will be crea .. _class_PopupMenu_method_add_separator: -- void **add_separator** **(** :ref:`String` label="" **)** +- void **add_separator** **(** :ref:`String` label="", :ref:`int` id=-1 **)** -Adds a separator between items. Separators also occupy an index. +Adds a separator between items. Separators also occupy an index, which you can set by using the ``id`` parameter. + +A ``label`` can optionally be provided, which will appear at the center of the separator. ---- diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index ee6904225..9e5071bca 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -22,6 +22,15 @@ When naming a Project Settings property, use the full path to the setting includ **Overriding:** Any project setting can be overridden by creating a file named ``override.cfg`` in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/677 `_ + Properties ---------- @@ -270,6 +279,8 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`input_devices/pointing/emulate_touch_from_mouse` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`input_devices/pointing/ios/touch_delay` | ``0.15`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`layer_names/2d_physics/layer_1` | ``""`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`layer_names/2d_physics/layer_10` | ``""`` | @@ -442,7 +453,9 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`logging/file_logging/max_log_files` | ``5`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`memory/limits/message_queue/max_size_kb` | ``1024`` | +| :ref:`int` | :ref:`memory/limits/command_queue/multithreading_queue_size_kb` | ``256`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`memory/limits/message_queue/max_size_kb` | ``4096`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`memory/limits/multithreaded_server/rid_pool_prealloc` | ``60`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ @@ -570,6 +583,8 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/limits/buffers/immediate_buffer_size_kb` | ``2048`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/rendering/max_lights_per_object` | ``32`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/limits/rendering/max_renderable_elements` | ``65536`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/limits/rendering/max_renderable_lights` | ``4096`` | @@ -578,10 +593,18 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/limits/time/time_rollover_secs` | ``3600`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/2d/ninepatch_mode` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/2d/use_camera_snap` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/2d/use_nvidia_rect_flicker_workaround` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/2d/use_pixel_snap` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/2d/use_software_skinning` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/2d/use_transform_snap` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/depth/hdr` | ``true`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/depth/hdr.mobile` | ``false`` | @@ -602,6 +625,10 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/quality/filters/msaa` | ``0`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/filters/use_debanding` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/filters/use_fxaa` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/filters/use_nearest_mipmap_filter` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/quality/intended_usage/framebuffer_allocation` | ``2`` | @@ -650,6 +677,12 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/quality/shadows/filter_mode.mobile` | ``0`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/skinning/force_software_skinning` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/skinning/software_skinning_fallback` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/quality/spatial_partitioning/render_tree_balance` | ``0.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/subsurface_scattering/follow_surface` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/quality/subsurface_scattering/quality` | ``1`` | @@ -678,37 +711,37 @@ Properties Methods ------- -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_property_info` **(** :ref:`Dictionary` hint **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** :ref:`String` name **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_order` **(** :ref:`String` name **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`get_setting` **(** :ref:`String` name **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`globalize_path` **(** :ref:`String` path **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_setting` **(** :ref:`String` name **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`load_resource_pack` **(** :ref:`String` pack, :ref:`bool` replace_files=true **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`localize_path` **(** :ref:`String` path **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`property_can_revert` **(** :ref:`String` name **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`property_get_revert` **(** :ref:`String` name **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save` **(** **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_custom` **(** :ref:`String` file **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_initial_value` **(** :ref:`String` name, :ref:`Variant` value **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_order` **(** :ref:`String` name, :ref:`int` position **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_setting` **(** :ref:`String` name, :ref:`Variant` value **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_property_info` **(** :ref:`Dictionary` hint **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** :ref:`String` name **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_order` **(** :ref:`String` name **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_setting` **(** :ref:`String` name **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`globalize_path` **(** :ref:`String` path **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_setting` **(** :ref:`String` name **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`load_resource_pack` **(** :ref:`String` pack, :ref:`bool` replace_files=true, :ref:`int` offset=0 **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`localize_path` **(** :ref:`String` path **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`property_can_revert` **(** :ref:`String` name **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`property_get_revert` **(** :ref:`String` name **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save` **(** **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_custom` **(** :ref:`String` file **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_initial_value` **(** :ref:`String` name, :ref:`Variant` value **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_order` **(** :ref:`String` name, :ref:`int` position **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_setting` **(** :ref:`String` name, :ref:`Variant` value **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -835,7 +868,7 @@ Icon set in ``.icns`` format used on macOS to set the game's icon. This is done The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files. The window title will be set to match the project name automatically on startup. -**Note:** Changing this value will also change the user data folder's path if :ref:`application/config/use_custom_user_dir` is ``false``. After renaming the project, you will no longer be able to access existing data in ``user://`` unless you rename the old folder to match the new project name. See `Data paths `_ in the documentation for more information. +**Note:** Changing this value will also change the user data folder's path if :ref:`application/config/use_custom_user_dir` is ``false``. After renaming the project, you will no longer be able to access existing data in ``user://`` unless you rename the old folder to match the new project name. See `Data paths `_ in the documentation for more information. ---- @@ -1753,7 +1786,9 @@ Sets the window background to transparent when it starts. | *Default* | ``false`` | +-----------+-----------+ -Force the window to be always on top. +Forces the main window to be always on top. + +**Note:** This setting is ignored on iOS, Android, and HTML5. ---- @@ -1765,7 +1800,9 @@ Force the window to be always on top. | *Default* | ``false`` | +-----------+-----------+ -Force the window to be borderless. +Forces the main window to be borderless. + +**Note:** This setting is ignored on iOS, Android, and HTML5. ---- @@ -1777,7 +1814,11 @@ Force the window to be borderless. | *Default* | ``false`` | +-----------+-----------+ -Sets the window to full screen when it starts. +Sets the main window to full screen when the project starts. Note that this is not *exclusive* fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. + +Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports `multiple resolutions `_ when enabling fullscreen mode. + +**Note:** This setting is ignored on iOS, Android, and HTML5. ---- @@ -1803,6 +1844,8 @@ Sets the game's main viewport height. On desktop platforms, this is the default Allows the window to be resizable by default. +**Note:** This setting is ignored on iOS and Android. + ---- .. _class_ProjectSettings_property_display/window/size/test_height: @@ -1887,7 +1930,7 @@ If ``Use Vsync`` is enabled and this setting is ``true``, enables vertical synch | *Default* | ``"res://script_templates"`` | +-----------+------------------------------+ -Search path for project-specific script templates. Script templates will be search both in the editor-specific path and in this project-specific path. +Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path. ---- @@ -2163,6 +2206,18 @@ If ``true``, sends touch input events when clicking or dragging the mouse. ---- +.. _class_ProjectSettings_property_input_devices/pointing/ios/touch_delay: + +- :ref:`float` **input_devices/pointing/ios/touch_delay** + ++-----------+----------+ +| *Default* | ``0.15`` | ++-----------+----------+ + +Default delay for touch events. This only affects iOS devices. + +---- + .. _class_ProjectSettings_property_layer_names/2d_physics/layer_1: - :ref:`String` **layer_names/2d_physics/layer_1** @@ -3167,6 +3222,8 @@ If ``true``, logs all output to files. | *Default* | ``true`` | +-----------+----------+ +Desktop override for :ref:`logging/file_logging/enable_file_logging`, as log files are not readily accessible on mobile/Web platforms. + ---- .. _class_ProjectSettings_property_logging/file_logging/log_path: @@ -3193,12 +3250,22 @@ Specifies the maximum amount of log files allowed (used for rotation). ---- +.. _class_ProjectSettings_property_memory/limits/command_queue/multithreading_queue_size_kb: + +- :ref:`int` **memory/limits/command_queue/multithreading_queue_size_kb** + ++-----------+---------+ +| *Default* | ``256`` | ++-----------+---------+ + +---- + .. _class_ProjectSettings_property_memory/limits/message_queue/max_size_kb: - :ref:`int` **memory/limits/message_queue/max_size_kb** +-----------+----------+ -| *Default* | ``1024`` | +| *Default* | ``4096`` | +-----------+----------+ Godot uses a message queue to defer some function calls. If you run out of space on it (you will see an error), you can increase the size here. @@ -3273,7 +3340,7 @@ Maximum number of warnings allowed to be sent as output from the debugger. Over | *Default* | ``16`` | +-----------+--------+ -Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped. +Default size of packet peer stream for deserializing Godot data (in bytes, specified as a power of two). The default value ``16`` is equal to 65,536 bytes. Over this size, data is dropped. ---- @@ -3493,6 +3560,8 @@ Cell size used for the broad-phase 2D hash grid algorithm (in pixels). The default angular damp in 2D. +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + ---- .. _class_ProjectSettings_property_physics/2d/default_gravity: @@ -3543,6 +3612,8 @@ The default gravity direction in 2D. The default linear damp in 2D. +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + ---- .. _class_ProjectSettings_property_physics/2d/large_object_surface_threshold_in_cells: @@ -3643,6 +3714,8 @@ Sets whether the 3D physics world will be created with support for :ref:`SoftBod The default angular damp in 3D. +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + ---- .. _class_ProjectSettings_property_physics/3d/default_gravity: @@ -3693,6 +3766,8 @@ The default gravity direction in 3D. The default linear damp in 3D. +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + ---- .. _class_ProjectSettings_property_physics/3d/physics_engine: @@ -4011,6 +4086,18 @@ Max buffer size for drawing immediate objects (ImmediateGeometry nodes). Nodes u ---- +.. _class_ProjectSettings_property_rendering/limits/rendering/max_lights_per_object: + +- :ref:`int` **rendering/limits/rendering/max_lights_per_object** + ++-----------+--------+ +| *Default* | ``32`` | ++-----------+--------+ + +Max number of lights renderable per object. This is further limited by hardware support. Most devices only support 409 lights, while many devices (especially mobile) only support 102. Setting this low will slightly reduce memory usage and may decrease shader compile times. + +---- + .. _class_ProjectSettings_property_rendering/limits/rendering/max_renderable_elements: - :ref:`int` **rendering/limits/rendering/max_renderable_elements** @@ -4019,7 +4106,7 @@ Max buffer size for drawing immediate objects (ImmediateGeometry nodes). Nodes u | *Default* | ``65536`` | +-----------+-----------+ -Max amount of elements renderable in a frame. If more than this are visible per frame, they will be dropped. Keep in mind elements refer to mesh surfaces and not meshes themselves. +Max amount of elements renderable in a frame. If more elements than this are visible per frame, they will not be drawn. Keep in mind elements refer to mesh surfaces and not meshes themselves. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. ---- @@ -4031,7 +4118,7 @@ Max amount of elements renderable in a frame. If more than this are visible per | *Default* | ``4096`` | +-----------+----------+ -Max number of lights renderable in a frame. If more than this number are used, they will be ignored. On some systems (particularly web) setting this number as low as possible can increase the speed of shader compilation. +Max number of lights renderable in a frame. If more lights than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. ---- @@ -4043,7 +4130,7 @@ Max number of lights renderable in a frame. If more than this number are used, t | *Default* | ``1024`` | +-----------+----------+ -Max number of reflection probes renderable in a frame. If more than this number are used, they will be ignored. On some systems (particularly web) setting this number as low as possible can increase the speed of shader compilation. +Max number of reflection probes renderable in a frame. If more reflection probes than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. ---- @@ -4059,6 +4146,30 @@ Shaders have a time variable that constantly increases. At some point, it needs ---- +.. _class_ProjectSettings_property_rendering/quality/2d/ninepatch_mode: + +- :ref:`int` **rendering/quality/2d/ninepatch_mode** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Choose between default mode where corner scalings are preserved matching the artwork, and scaling mode. + +Not available in GLES3 when :ref:`rendering/batching/options/use_batching` is off. + +---- + +.. _class_ProjectSettings_property_rendering/quality/2d/use_camera_snap: + +- :ref:`bool` **rendering/quality/2d/use_camera_snap** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +---- + .. _class_ProjectSettings_property_rendering/quality/2d/use_nvidia_rect_flicker_workaround: - :ref:`bool` **rendering/quality/2d/use_nvidia_rect_flicker_workaround** @@ -4087,6 +4198,34 @@ Consider using the project setting :ref:`rendering/batching/precision/uv_contrac ---- +.. _class_ProjectSettings_property_rendering/quality/2d/use_software_skinning: + +- :ref:`bool` **rendering/quality/2d/use_software_skinning** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, performs 2D skinning on the CPU rather than the GPU. This provides greater compatibility with a wide range of hardware, and also may be faster in some circumstances. + +Currently only available when :ref:`rendering/batching/options/use_batching` is active. + +---- + +.. _class_ProjectSettings_property_rendering/quality/2d/use_transform_snap: + +- :ref:`bool` **rendering/quality/2d/use_transform_snap** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, forces snapping of 2D object transforms to the nearest whole coordinate. + +Can help prevent unwanted relative movement in pixel art styles. + +---- + .. _class_ProjectSettings_property_rendering/quality/depth/hdr: - :ref:`bool` **rendering/quality/depth/hdr** @@ -4215,6 +4354,32 @@ Sets the number of MSAA samples to use. MSAA is used to reduce aliasing around t ---- +.. _class_ProjectSettings_property_rendering/quality/filters/use_debanding: + +- :ref:`bool` **rendering/quality/filters/use_debanding** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +**Note:** Only available on the GLES3 backend. :ref:`rendering/quality/depth/hdr` must also be ``true`` for debanding to be effective. + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/use_fxaa: + +- :ref:`bool` **rendering/quality/filters/use_fxaa** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Enables FXAA in the root Viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. + +---- + .. _class_ProjectSettings_property_rendering/quality/filters/use_nearest_mipmap_filter: - :ref:`bool` **rendering/quality/filters/use_nearest_mipmap_filter** @@ -4505,6 +4670,52 @@ Lower-end override for :ref:`rendering/quality/shadows/filter_mode` **rendering/quality/skinning/force_software_skinning** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Forces :ref:`MeshInstance` to always perform skinning on the CPU (applies to both GLES2 and GLES3). + +See also :ref:`rendering/quality/skinning/software_skinning_fallback`. + +---- + +.. _class_ProjectSettings_property_rendering/quality/skinning/software_skinning_fallback: + +- :ref:`bool` **rendering/quality/skinning/software_skinning_fallback** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Allows :ref:`MeshInstance` to perform skinning on the CPU when the hardware doesn't support the default GPU skinning process with GLES2. + +If ``false``, an alternative skinning process on the GPU is used in this case (slower in most cases). + +See also :ref:`rendering/quality/skinning/force_software_skinning`. + +**Note:** When the software skinning fallback is triggered, custom vertex shaders will behave in a different way, because the bone transform will be already applied to the modelview matrix. + +---- + +.. _class_ProjectSettings_property_rendering/quality/spatial_partitioning/render_tree_balance: + +- :ref:`float` **rendering/quality/spatial_partitioning/render_tree_balance** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The rendering octree balance can be changed to favor smaller (``0``), or larger (``1``) branches. + +Larger branches can increase performance significantly in some projects. + +---- + .. _class_ProjectSettings_property_rendering/quality/subsurface_scattering/follow_surface: - :ref:`bool` **rendering/quality/subsurface_scattering/follow_surface** @@ -4713,7 +4924,23 @@ Returns the value of a setting. - :ref:`String` **globalize_path** **(** :ref:`String` path **)** |const| -Converts a localized path (``res://``) to a full native OS path. +Returns the absolute, native OS path corresponding to the localized ``path`` (starting with ``res://`` or ``user://``). The returned path will vary depending on the operating system and user preferences. See `File paths in Godot projects `_ to see what those paths convert to. See also :ref:`localize_path`. + +**Note:** :ref:`globalize_path` with ``res://`` will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project: + +:: + + var path = "" + if OS.has_feature("editor"): + # Running from an editor binary. + # `path` will contain the absolute path to `hello.txt` located in the project root. + path = ProjectSettings.globalize_path("res://hello.txt") + else: + # Running from an exported project. + # `path` will contain the absolute path to `hello.txt` next to the executable. + # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path, + # but is close enough in spirit. + path = OS.get_executable_path().get_base_dir().plus_file("hello.txt") ---- @@ -4727,19 +4954,21 @@ Returns ``true`` if a configuration value is present. .. _class_ProjectSettings_method_load_resource_pack: -- :ref:`bool` **load_resource_pack** **(** :ref:`String` pack, :ref:`bool` replace_files=true **)** +- :ref:`bool` **load_resource_pack** **(** :ref:`String` pack, :ref:`bool` replace_files=true, :ref:`int` offset=0 **)** Loads the contents of the .pck or .zip file specified by ``pack`` into the resource filesystem (``res://``). Returns ``true`` on success. **Note:** If a file from ``pack`` shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from ``pack`` unless ``replace_files`` is set to ``false``. +**Note:** The optional ``offset`` parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. + ---- .. _class_ProjectSettings_method_localize_path: - :ref:`String` **localize_path** **(** :ref:`String` path **)** |const| -Convert a path to a localized path (``res://`` path). +Returns the localized path (starting with ``res://``) corresponding to the absolute, native OS ``path``. See also :ref:`globalize_path`. ---- diff --git a/classes/class_proximitygroup.rst b/classes/class_proximitygroup.rst index c47003898..c81ceadab 100644 --- a/classes/class_proximitygroup.rst +++ b/classes/class_proximitygroup.rst @@ -32,16 +32,16 @@ Properties Methods ------- -+------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`broadcast` **(** :ref:`String` name, :ref:`Variant` parameters **)** | -+------+------------------------------------------------------------------------------------------------------------------------------------------------+ ++------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`broadcast` **(** :ref:`String` method, :ref:`Variant` parameters **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- .. _class_ProximityGroup_signal_broadcast: -- **broadcast** **(** :ref:`String` group_name, :ref:`Array` parameters **)** +- **broadcast** **(** :ref:`String` method, :ref:`Array` parameters **)** Enumerations ------------ @@ -106,7 +106,7 @@ Method Descriptions .. _class_ProximityGroup_method_broadcast: -- void **broadcast** **(** :ref:`String` name, :ref:`Variant` parameters **)** +- void **broadcast** **(** :ref:`String` method, :ref:`Variant` parameters **)** .. |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_quadmesh.rst b/classes/class_quadmesh.rst index fdf992697..8484a3dbf 100644 --- a/classes/class_quadmesh.rst +++ b/classes/class_quadmesh.rst @@ -18,6 +18,13 @@ Description Class representing a square :ref:`PrimitiveMesh`. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this default rotation is more suited for use with billboarded materials. Unlike :ref:`PlaneMesh`, this mesh doesn't provide subdivision options. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/127 `_ + +- `https://godotengine.org/asset-library/asset/129 `_ + Properties ---------- diff --git a/classes/class_quat.rst b/classes/class_quat.rst index d98140327..4f8fa54e9 100644 --- a/classes/class_quat.rst +++ b/classes/class_quat.rst @@ -25,6 +25,8 @@ Tutorials - `#interpolating-with-quaternions <../tutorials/3d/using_transforms.html#interpolating-with-quaternions>`_ in :doc:`../tutorials/3d/using_transforms` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_randomnumbergenerator.rst b/classes/class_randomnumbergenerator.rst index e1ee81a59..c4f160080 100644 --- a/classes/class_randomnumbergenerator.rst +++ b/classes/class_randomnumbergenerator.rst @@ -32,9 +32,9 @@ To generate a random float number (within a given range) based on a time-dependa Properties ---------- -+-----------------------+--------------------------------------------------------+--------------------------+ -| :ref:`int` | :ref:`seed` | ``-6398989897141750821`` | -+-----------------------+--------------------------------------------------------+--------------------------+ ++-----------------------+--------------------------------------------------------+-------+ +| :ref:`int` | :ref:`seed` | ``0`` | ++-----------------------+--------------------------------------------------------+-------+ Methods ------- @@ -60,18 +60,20 @@ Property Descriptions - :ref:`int` **seed** -+-----------+--------------------------+ -| *Default* | ``-6398989897141750821`` | -+-----------+--------------------------+ -| *Setter* | set_seed(value) | -+-----------+--------------------------+ -| *Getter* | get_seed() | -+-----------+--------------------------+ ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_seed(value) | ++-----------+-----------------+ +| *Getter* | get_seed() | ++-----------+-----------------+ The seed used by the random number generator. A given seed will give a reproducible sequence of pseudo-random numbers. **Note:** The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally. +**Note:** The default value of this property is pseudo-random, and changes when calling :ref:`randomize`. The ``0`` value documented here is a placeholder, and not the actual default seed. + Method Descriptions ------------------- diff --git a/classes/class_raycast.rst b/classes/class_raycast.rst index d38affc47..16072b8a4 100644 --- a/classes/class_raycast.rst +++ b/classes/class_raycast.rst @@ -31,6 +31,8 @@ Tutorials - :doc:`../tutorials/physics/ray-casting` +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- @@ -142,7 +144,7 @@ If ``true``, collision with :ref:`PhysicsBody`\ s will be rep | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks `_ in the documentation for more information. +The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_raycast2d.rst b/classes/class_raycast2d.rst index c8a4e3a6b..8f2f0f5fc 100644 --- a/classes/class_raycast2d.rst +++ b/classes/class_raycast2d.rst @@ -142,7 +142,7 @@ If ``true``, collision with :ref:`PhysicsBody2D`\ s will be | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks `_ in the documentation for more information. +The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_rect2.rst b/classes/class_rect2.rst index 896ceca20..978d3ece1 100644 --- a/classes/class_rect2.rst +++ b/classes/class_rect2.rst @@ -14,13 +14,21 @@ Rect2 Description ----------- -Rect2 consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. +``Rect2`` consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + +It uses floating-point coordinates. + +The 3D counterpart to ``Rect2`` is :ref:`AABB`. Tutorials --------- - :doc:`../tutorials/math/index` +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + Properties ---------- diff --git a/classes/class_rectangleshape2d.rst b/classes/class_rectangleshape2d.rst index 0f8a8fa9d..6e52f0752 100644 --- a/classes/class_rectangleshape2d.rst +++ b/classes/class_rectangleshape2d.rst @@ -18,6 +18,13 @@ Description Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/121 `_ + +- `https://godotengine.org/asset-library/asset/113 `_ + Properties ---------- diff --git a/classes/class_reference.rst b/classes/class_reference.rst index 8fab16c98..970f67f60 100644 --- a/classes/class_reference.rst +++ b/classes/class_reference.rst @@ -24,6 +24,8 @@ Unlike :ref:`Object`\ s, References keep an internal reference cou In the vast majority of use cases, instantiating and using ``Reference``-derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused. +**Note:** In C#, references will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free references that are no longer in use. This means that unused references will linger on for a while before being removed. + Tutorials --------- diff --git a/classes/class_referencerect.rst b/classes/class_referencerect.rst index f99f22b52..3e2604466 100644 --- a/classes/class_referencerect.rst +++ b/classes/class_referencerect.rst @@ -16,7 +16,7 @@ Reference frame for GUI. Description ----------- -A rectangle box that displays only a :ref:`border_color` border color around its rectangle. ``ReferenceRect`` has no fill :ref:`Color`. +A rectangle box that displays only a :ref:`border_color` border color around its rectangle. ``ReferenceRect`` has no fill :ref:`Color`. If you need to display a rectangle filled with a solid color, consider using :ref:`ColorRect` instead. Properties ---------- @@ -24,6 +24,8 @@ Properties +---------------------------+----------------------------------------------------------------+-------------------------+ | :ref:`Color` | :ref:`border_color` | ``Color( 1, 0, 0, 1 )`` | +---------------------------+----------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`border_width` | ``1.0`` | ++---------------------------+----------------------------------------------------------------+-------------------------+ | :ref:`bool` | :ref:`editor_only` | ``true`` | +---------------------------+----------------------------------------------------------------+-------------------------+ @@ -46,6 +48,22 @@ Sets the border :ref:`Color` of the ``ReferenceRect``. ---- +.. _class_ReferenceRect_property_border_width: + +- :ref:`float` **border_width** + ++-----------+-------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------+ +| *Setter* | set_border_width(value) | ++-----------+-------------------------+ +| *Getter* | get_border_width() | ++-----------+-------------------------+ + +Sets the border width of the ``ReferenceRect``. The border grows both inwards and outwards with respect to the rectangle box. + +---- + .. _class_ReferenceRect_property_editor_only: - :ref:`bool` **editor_only** diff --git a/classes/class_resource.rst b/classes/class_resource.rst index ba27bc6c2..68ad45c91 100644 --- a/classes/class_resource.rst +++ b/classes/class_resource.rst @@ -20,6 +20,8 @@ Description Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Unlike :ref:`Object`\ s, they are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a :ref:`Node`, which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a :ref:`Node` or another resource. +**Note:** In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. + Tutorials --------- @@ -64,6 +66,8 @@ Signals Emitted whenever the resource changes. +**Note:** This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. + Property Descriptions --------------------- diff --git a/classes/class_resourceloader.rst b/classes/class_resourceloader.rst index 68252f485..1ae0f923d 100644 --- a/classes/class_resourceloader.rst +++ b/classes/class_resourceloader.rst @@ -20,7 +20,10 @@ Singleton used to load resource files from the filesystem. It uses the many :ref:`ResourceFormatLoader` classes registered in the engine (either built-in or from a plugin) to load files into memory and convert them to a format that can be used by the engine. -GDScript has a simplified :ref:`@GDScript.load` built-in method which can be used in most situations, leaving the use of ``ResourceLoader`` for more advanced scenarios. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/677 `_ Methods ------- @@ -98,11 +101,13 @@ Loads a resource at the given ``path``, caching the result for further access. The registered :ref:`ResourceFormatLoader`\ s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. -An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. +An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. Anything that inherits from :ref:`Resource` can be used as a type hint, for example :ref:`Image`. If ``no_cache`` is ``true``, the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists. -Returns an empty resource if no ResourceFormatLoader could handle the file. +Returns an empty resource if no :ref:`ResourceFormatLoader` could handle the file. + +GDScript has a simplified :ref:`@GDScript.load` built-in method which can be used in most situations, leaving the use of ``ResourceLoader`` for more advanced scenarios. ---- @@ -112,7 +117,7 @@ Returns an empty resource if no ResourceFormatLoader could handle the file. Starts loading a resource interactively. The returned :ref:`ResourceInteractiveLoader` object allows to load with high granularity, calling its :ref:`ResourceInteractiveLoader.poll` method successively to load chunks. -An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. +An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. Anything that inherits from :ref:`Resource` can be used as a type hint, for example :ref:`Image`. ---- diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst index 498bd9d81..30bcd7cb2 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -20,6 +20,8 @@ Rich text can contain custom text, fonts, images and some basic formatting. The **Note:** Assignments to :ref:`bbcode_text` clear the tag stack and reconstruct it from the property's contents. Any edits made to :ref:`bbcode_text` will erase previous edits made from other manual sources such as :ref:`append_bbcode` and the ``push_*`` / :ref:`pop` methods. +**Note:** RichTextLabel doesn't support entangled BBCode tags. For example, instead of using ``[b]bold[i]bold italic[/b]italic[/i]``, use ``[b]bold[i]bold italic[/i][/b][i]italic[/i]``. + **Note:** Unlike :ref:`Label`, RichTextLabel doesn't have a *property* to horizontally align text to the center. Instead, enable :ref:`bbcode_enabled` and surround the text in a ``[center]`` tag as follows: ``[center]Example[/center]``. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the :ref:`fit_content_height` property. Tutorials @@ -27,6 +29,10 @@ Tutorials - :doc:`../tutorials/gui/bbcode_in_richtextlabel` +- `https://godotengine.org/asset-library/asset/132 `_ + +- `https://godotengine.org/asset-library/asset/677 `_ + Properties ---------- @@ -349,7 +355,7 @@ If ``true``, the label uses BBCode formatting. The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. -**Note:** It is unadvised to use ``+=`` operator with ``bbcode_text`` (e.g. ``bbcode_text += "some string"``) as it replaces the whole text and can cause slowdowns. Use :ref:`append_bbcode` for adding text instead. +**Note:** It is unadvised to use the ``+=`` operator with ``bbcode_text`` (e.g. ``bbcode_text += "some string"``) as it replaces the whole text and can cause slowdowns. Use :ref:`append_bbcode` for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call. ---- @@ -562,6 +568,8 @@ Adds raw non-BBCode-parsed text to the tag stack. Parses ``bbcode`` and adds tags to the tag stack as needed. Returns the result of the parsing, :ref:`@GlobalScope.OK` if successful. +**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`. + ---- .. _class_RichTextLabel_method_clear: diff --git a/classes/class_rigidbody.rst b/classes/class_rigidbody.rst index f1f052832..a668982b5 100644 --- a/classes/class_rigidbody.rst +++ b/classes/class_rigidbody.rst @@ -33,6 +33,10 @@ Tutorials - :doc:`../tutorials/physics/physics_introduction` +- `https://godotengine.org/asset-library/asset/524 `_ + +- `https://godotengine.org/asset-library/asset/675 `_ + Properties ---------- @@ -200,6 +204,8 @@ Property Descriptions Damps RigidBody's rotational forces. +See :ref:`ProjectSettings.physics/3d/default_angular_damp` for more details about damping. + ---- .. _class_RigidBody_property_angular_velocity: @@ -462,6 +468,8 @@ This is multiplied by the global 3D gravity setting found in **Project > Project 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. +See :ref:`ProjectSettings.physics/3d/default_linear_damp` for more details about damping. + ---- .. _class_RigidBody_property_linear_velocity: diff --git a/classes/class_rigidbody2d.rst b/classes/class_rigidbody2d.rst index ce869000d..990c33fcf 100644 --- a/classes/class_rigidbody2d.rst +++ b/classes/class_rigidbody2d.rst @@ -28,6 +28,13 @@ If you need to override the default physics behavior or add a transformation at The center of mass is always located at the node's origin without taking into account the :ref:`CollisionShape2D` centroid offsets. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/119 `_ + +- `https://godotengine.org/asset-library/asset/148 `_ + Properties ---------- @@ -199,6 +206,8 @@ Property Descriptions Damps the body's :ref:`angular_velocity`. If ``-1``, the body will use the **Default Angular Damp** defined in **Project > Project Settings > Physics > 2d**. +See :ref:`ProjectSettings.physics/2d/default_angular_damp` for more details about damping. + ---- .. _class_RigidBody2D_property_angular_velocity: @@ -313,7 +322,7 @@ If ``true``, the body will emit signals when it collides with another RigidBody2 The maximum number of contacts that will be recorded. Requires :ref:`contact_monitor` to be set to ``true``. -**Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). +**Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end). ---- @@ -411,6 +420,8 @@ The body's moment of inertia. This is like mass, but for rotation: it determines Damps the body's :ref:`linear_velocity`. If ``-1``, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d**. +See :ref:`ProjectSettings.physics/2d/default_linear_damp` for more details about damping. + ---- .. _class_RigidBody2D_property_linear_velocity: diff --git a/classes/class_scenetree.rst b/classes/class_scenetree.rst index 14b7b3922..e9e812ab4 100644 --- a/classes/class_scenetree.rst +++ b/classes/class_scenetree.rst @@ -479,7 +479,9 @@ Method Descriptions - :ref:`Variant` **call_group** **(** :ref:`String` group, :ref:`String` method, ... **)** |vararg| -Calls ``method`` on each member of the given group. +Calls ``method`` on each member of the given group. You can pass arguments to ``method`` by specifying them at the end of the method call. + +**Note:** ``method`` may only have 5 arguments at most (7 arguments passed to this method in total). ---- @@ -487,7 +489,9 @@ Calls ``method`` on each member of the given group. - :ref:`Variant` **call_group_flags** **(** :ref:`int` flags, :ref:`String` group, :ref:`String` method, ... **)** |vararg| -Calls ``method`` on each member of the given group, respecting the given :ref:`GroupCallFlags`. +Calls ``method`` on each member of the given group, respecting the given :ref:`GroupCallFlags`. You can pass arguments to ``method`` by specifying them at the end of the method call. + +**Note:** ``method`` may only have 5 arguments at most (8 arguments passed to this method in total). ---- @@ -499,6 +503,8 @@ Changes the running scene to the one at the given ``path``, after loading it int Returns :ref:`@GlobalScope.OK` on success, :ref:`@GlobalScope.ERR_CANT_OPEN` if the ``path`` cannot be loaded into a :ref:`PackedScene`, or :ref:`@GlobalScope.ERR_CANT_CREATE` if that scene cannot be instantiated. +**Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the :ref:`change_scene` call. + ---- .. _class_SceneTree_method_change_scene_to: @@ -509,6 +515,8 @@ Changes the running scene to a new instance of the given :ref:`PackedScene` on success or :ref:`@GlobalScope.ERR_CANT_CREATE` if the scene cannot be instantiated. +**Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the :ref:`change_scene_to` call. + ---- .. _class_SceneTree_method_create_timer: @@ -636,7 +644,7 @@ Queues the given object for deletion, delaying the call to :ref:`Object.free` exit_code=-1 **)** -Quits the application. A process ``exit_code`` can optionally be passed as an argument. If this argument is ``0`` or greater, it will override the :ref:`OS.exit_code` defined before quitting the application. +Quits the application at the end of the current iteration. A process ``exit_code`` can optionally be passed as an argument. If this argument is ``0`` or greater, it will override the :ref:`OS.exit_code` defined before quitting the application. ---- diff --git a/classes/class_scripteditor.rst b/classes/class_scripteditor.rst index b4e038b8a..0a9470a87 100644 --- a/classes/class_scripteditor.rst +++ b/classes/class_scripteditor.rst @@ -103,6 +103,8 @@ Goes to the specified line in the current script. - void **open_script_create_dialog** **(** :ref:`String` base_name, :ref:`String` base_path **)** +Opens the script create dialog. The script will extend ``base_name``. The file extension can be omitted from ``base_path``. It will be added based on the selected scripting language. + .. |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_skeleton.rst b/classes/class_skeleton.rst index e38fdee9c..70704fade 100644 --- a/classes/class_skeleton.rst +++ b/classes/class_skeleton.rst @@ -22,6 +22,13 @@ The overall transform of a bone with respect to the skeleton is determined by th Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/523 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Methods ------- @@ -83,6 +90,13 @@ Methods | void | :ref:`unparent_bone_and_rest` **(** :ref:`int` bone_idx **)** | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +Signals +------- + +.. _class_Skeleton_signal_skeleton_updated: + +- **skeleton_updated** **(** **)** + Constants --------- diff --git a/classes/class_skeletonik.rst b/classes/class_skeletonik.rst index 209cde896..2ea096dc2 100644 --- a/classes/class_skeletonik.rst +++ b/classes/class_skeletonik.rst @@ -13,6 +13,11 @@ SkeletonIK +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/523 `_ + Properties ---------- diff --git a/classes/class_sliderjoint.rst b/classes/class_sliderjoint.rst index b72cf99ba..516b3b202 100644 --- a/classes/class_sliderjoint.rst +++ b/classes/class_sliderjoint.rst @@ -11,12 +11,12 @@ SliderJoint **Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -Piston kind of slider between two bodies in 3D. +Slider between two PhysicsBodies in 3D. Description ----------- -Slides across the X axis of the pivot object. +Slides across the X axis of the pivot object. See also :ref:`Generic6DOFJoint`. Properties ---------- diff --git a/classes/class_softbody.rst b/classes/class_softbody.rst index 367499c45..4c7092c90 100644 --- a/classes/class_softbody.rst +++ b/classes/class_softbody.rst @@ -106,7 +106,7 @@ The physics layers this SoftBody is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. -A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. +A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -122,7 +122,7 @@ A contact is detected if object A is in any of the layers that object B scans, o | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this SoftBody scans for collisions. See `Collision layers and masks `_ in the documentation for more information. +The physics layers this SoftBody scans for collisions. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_spatial.rst b/classes/class_spatial.rst index c240a6e14..b2bc4136a 100644 --- a/classes/class_spatial.rst +++ b/classes/class_spatial.rst @@ -29,6 +29,8 @@ Tutorials - :doc:`../tutorials/3d/introduction_to_3d` +- `https://github.com/godotengine/godot-demo-projects/tree/master/3d `_ + Properties ---------- diff --git a/classes/class_spatialmaterial.rst b/classes/class_spatialmaterial.rst index 81a2067c6..eea35e2d7 100644 --- a/classes/class_spatialmaterial.rst +++ b/classes/class_spatialmaterial.rst @@ -1099,7 +1099,9 @@ Specifies whether to use ``UV`` or ``UV2`` for the detail layer. See :ref:`Detai | *Getter* | get_distance_fade_max_distance() | +----------+---------------------------------------+ -Distance at which the object fades fully and is no longer visible. +Distance at which the object appears fully opaque. + +**Note:** If ``distance_fade_max_distance`` is less than ``distance_fade_min_distance``, the behavior will be reversed. The object will start to fade away at ``distance_fade_max_distance`` and will fully disappear once it reaches ``distance_fade_min_distance``. ---- @@ -1113,7 +1115,9 @@ Distance at which the object fades fully and is no longer visible. | *Getter* | get_distance_fade_min_distance() | +----------+---------------------------------------+ -Distance at which the object starts to fade. If the object is less than this distance away it will appear normal. +Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible. + +**Note:** If ``distance_fade_min_distance`` is greater than ``distance_fade_max_distance``, the behavior will be reversed. The object will start to fade away at ``distance_fade_max_distance`` and will fully disappear once it reaches ``distance_fade_min_distance``. ---- @@ -1567,6 +1571,8 @@ If ``true``, the shader will keep the scale set for the mesh. Otherwise the scal Controls how the object faces the camera. See :ref:`BillboardMode`. +**Note:** Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See `GitHub issue #41567 `_ for details. + ---- .. _class_SpatialMaterial_property_params_blend_mode: diff --git a/classes/class_sphereshape.rst b/classes/class_sphereshape.rst index e498698af..cdad340d6 100644 --- a/classes/class_sphereshape.rst +++ b/classes/class_sphereshape.rst @@ -18,6 +18,11 @@ Description Sphere shape for 3D collisions, which can be set into a :ref:`PhysicsBody` or :ref:`Area`. This shape is useful for modeling sphere-like 3D objects. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + Properties ---------- diff --git a/classes/class_spotlight.rst b/classes/class_spotlight.rst index 2a60c6d12..fc231abb0 100644 --- a/classes/class_spotlight.rst +++ b/classes/class_spotlight.rst @@ -18,11 +18,15 @@ Description A Spotlight is a type of :ref:`Light` node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of :ref:`Light`. +**Note:** By default, only 32 SpotLights may affect a single mesh *resource* at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase :ref:`ProjectSettings.rendering/limits/rendering/max_lights_per_object` at the cost of shader compilation times. + Tutorials --------- - :doc:`../tutorials/3d/lights_and_shadows` +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ---------- diff --git a/classes/class_springarm.rst b/classes/class_springarm.rst index 5d37d0d9c..3b256f497 100644 --- a/classes/class_springarm.rst +++ b/classes/class_springarm.rst @@ -65,7 +65,7 @@ Property Descriptions | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The layers against which the collision check shall be done. See `Collision layers and masks `_ in the documentation for more information. +The layers against which the collision check shall be done. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_sprite.rst b/classes/class_sprite.rst index bf6ea63e5..876e2a922 100644 --- a/classes/class_sprite.rst +++ b/classes/class_sprite.rst @@ -18,6 +18,11 @@ Description A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/148 `_ + Properties ---------- @@ -138,7 +143,7 @@ If ``true``, texture is flipped vertically. | *Getter* | get_frame() | +-----------+------------------+ -Current frame to display from sprite sheet. :ref:`vframes` or :ref:`hframes` must be greater than 1. +Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. ---- @@ -154,7 +159,7 @@ Current frame to display from sprite sheet. :ref:`vframes` property. :ref:`vframes` or :ref:`hframes` must be greater than 1. +Coordinates of the frame to display from sprite sheet. This is as an alias for the :ref:`frame` property. :ref:`hframes` or :ref:`vframes` must be greater than 1. ---- diff --git a/classes/class_sprite3d.rst b/classes/class_sprite3d.rst index 024eab7dd..7253c79db 100644 --- a/classes/class_sprite3d.rst +++ b/classes/class_sprite3d.rst @@ -61,7 +61,7 @@ Property Descriptions | *Getter* | get_frame() | +-----------+------------------+ -Current frame to display from sprite sheet. :ref:`vframes` or :ref:`hframes` must be greater than 1. +Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. ---- @@ -77,7 +77,7 @@ Current frame to display from sprite sheet. :ref:`vframes` property. :ref:`vframes` or :ref:`hframes` must be greater than 1. +Coordinates of the frame to display from sprite sheet. This is as an alias for the :ref:`frame` property. :ref:`hframes` or :ref:`vframes` must be greater than 1. ---- diff --git a/classes/class_staticbody.rst b/classes/class_staticbody.rst index 064414655..983fb2bfd 100644 --- a/classes/class_staticbody.rst +++ b/classes/class_staticbody.rst @@ -20,6 +20,15 @@ Static body for 3D physics. A static body is a simple body that is not intended Additionally, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels). +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/675 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_streampeertcp.rst b/classes/class_streampeertcp.rst index a2cafa982..b68626e04 100644 --- a/classes/class_streampeertcp.rst +++ b/classes/class_streampeertcp.rst @@ -107,7 +107,7 @@ Returns the status of the connection, see :ref:`Status` **is_connected_to_host** **(** **)** |const| -Returns ``true`` if this peer is currently connected to a host, ``false`` otherwise. +Returns ``true`` if this peer is currently connected or is connecting to a host, ``false`` otherwise. ---- diff --git a/classes/class_string.rst b/classes/class_string.rst index 75cca843f..c56c0204b 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -429,7 +429,13 @@ Changes the case of some letters. Replaces underscores with spaces, adds spaces - :ref:`int` **casecmp_to** **(** :ref:`String` to **)** -Performs a case-sensitive comparison to another string. Returns ``-1`` if less than, ``+1`` if greater than, or ``0`` if equal. +Performs a case-sensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points`` of each string, which roughly matches the alphabetical order. + +**Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. + +**Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. + +To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to`. ---- @@ -705,7 +711,7 @@ Returns ``true`` if this string contains a valid integer. - :ref:`bool` **is_valid_ip_address** **(** **)** -Returns ``true`` if this string contains a valid IP address. +Returns ``true`` if this string contains only a well-formatted IPv4 or IPv6 address. This method considers `reserved IP addresses `_ such as ``0.0.0.0`` as valid. ---- @@ -777,7 +783,13 @@ Returns the MD5 hash of the string as a string. - :ref:`int` **nocasecmp_to** **(** :ref:`String` to **)** -Performs a case-insensitive comparison to another string. Returns ``-1`` if less than, ``+1`` if greater than, or ``0`` if equal. +Performs a case-insensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points`` of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. + +**Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. + +**Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. + +To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`casecmp_to`. ---- diff --git a/classes/class_stylebox.rst b/classes/class_stylebox.rst index 5223e5252..ff1202328 100644 --- a/classes/class_stylebox.rst +++ b/classes/class_stylebox.rst @@ -20,6 +20,8 @@ Description StyleBox is :ref:`Resource` that provides an abstract base class for drawing stylized boxes for the UI. StyleBoxes are used for drawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below. +**Note:** For children of :ref:`Control` that have *Theme Properties*, the ``focus`` ``StyleBox`` is displayed over the ``normal``, ``hover`` or ``pressed`` ``StyleBox``. This makes the ``focus`` ``StyleBox`` more reusable across different nodes. + Properties ---------- diff --git a/classes/class_surfacetool.rst b/classes/class_surfacetool.rst index c199a34bd..28b8d2072 100644 --- a/classes/class_surfacetool.rst +++ b/classes/class_surfacetool.rst @@ -36,6 +36,11 @@ See also :ref:`ArrayMesh`, :ref:`ImmediateGeometry`_ for front faces of triangle primitive modes. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/676 `_ + Methods ------- @@ -104,6 +109,8 @@ Adds an array of bones for the next vertex to use. ``bones`` must contain 4 inte Specifies a :ref:`Color` for the next vertex to use. +**Note:** The material must have :ref:`SpatialMaterial.vertex_color_use_as_albedo` enabled for the vertex color to be visible. + ---- .. _class_SurfaceTool_method_add_index: diff --git a/classes/class_tabcontainer.rst b/classes/class_tabcontainer.rst index 92958f8e4..9e28d3450 100644 --- a/classes/class_tabcontainer.rst +++ b/classes/class_tabcontainer.rst @@ -27,6 +27,8 @@ To hide only a tab's content, nest the content inside a child :ref:`Control` | :ref:`all_tabs_in_front` | ``false`` | +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`current_tab` | ``0`` | +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ @@ -162,6 +164,22 @@ enum **TabAlign**: Property Descriptions --------------------- +.. _class_TabContainer_property_all_tabs_in_front: + +- :ref:`bool` **all_tabs_in_front** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_all_tabs_in_front(value) | ++-----------+------------------------------+ +| *Getter* | is_all_tabs_in_front() | ++-----------+------------------------------+ + +If ``true``, all tabs are drawn in front of the panel. If ``false``, inactive tabs are drawn behind the panel. + +---- + .. _class_TabContainer_property_current_tab: - :ref:`int` **current_tab** diff --git a/classes/class_tabs.rst b/classes/class_tabs.rst index 8aa4183fd..beebc99d1 100644 --- a/classes/class_tabs.rst +++ b/classes/class_tabs.rst @@ -16,7 +16,7 @@ Tabs control. Description ----------- -Simple tabs control, similar to :ref:`TabContainer` but is only in charge of drawing tabs, not interact with children. +Simple tabs control, similar to :ref:`TabContainer` but is only in charge of drawing tabs, not interacting with children. Properties ---------- @@ -43,6 +43,8 @@ Methods +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_offset_buttons_visible` **(** **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_previous_tab` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_select_with_rmb` **(** **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_tab_count` **(** **)** |const| | @@ -319,6 +321,14 @@ Returns ``true`` if the offset buttons (the ones that appear when there's not en ---- +.. _class_Tabs_method_get_previous_tab: + +- :ref:`int` **get_previous_tab** **(** **)** |const| + +Returns the previously active tab index. + +---- + .. _class_Tabs_method_get_select_with_rmb: - :ref:`bool` **get_select_with_rmb** **(** **)** |const| diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst index 96e83ffe0..70a320061 100644 --- a/classes/class_textedit.rst +++ b/classes/class_textedit.rst @@ -1025,7 +1025,7 @@ Returns the selection end line. - :ref:`String` **get_word_under_cursor** **(** **)** |const| -Returns a :ref:`String` text with the word under the mouse cursor location. +Returns a :ref:`String` text with the word under the caret (text cursor) location. ---- diff --git a/classes/class_texture.rst b/classes/class_texture.rst index da4e338ad..03953ea9e 100644 --- a/classes/class_texture.rst +++ b/classes/class_texture.rst @@ -24,6 +24,8 @@ Textures are often created by loading them from a file. See :ref:`@GDScript.load ``Texture`` is a base for other resources. It cannot be used directly. +**Note:** The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import. + Properties ---------- @@ -81,6 +83,8 @@ enum **Flags**: - **FLAG_REPEAT** = **2** --- Repeats the texture (instead of clamp to edge). +**Note:** Ignored when using an :ref:`AtlasTexture` as these don't support repetition. + - **FLAG_FILTER** = **4** --- Uses a magnifying filter, to enable smooth zooming in of the texture. - **FLAG_ANISOTROPIC_FILTER** = **8** --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. @@ -91,6 +95,8 @@ This results in better-looking textures when viewed from oblique angles. - **FLAG_MIRRORED_REPEAT** = **32** --- Repeats the texture with alternate sections mirrored. +**Note:** Ignored when using an :ref:`AtlasTexture` as these don't support repetition. + - **FLAG_VIDEO_SURFACE** = **2048** --- Texture is a video surface. Property Descriptions diff --git a/classes/class_texturebutton.rst b/classes/class_texturebutton.rst index faed03d61..a0d5ab4cd 100644 --- a/classes/class_texturebutton.rst +++ b/classes/class_texturebutton.rst @@ -20,6 +20,13 @@ Description The "normal" state must contain a texture (:ref:`texture_normal`); other textures are optional. +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_texturerect.rst b/classes/class_texturerect.rst index 316cd77df..571af67bf 100644 --- a/classes/class_texturerect.rst +++ b/classes/class_texturerect.rst @@ -20,6 +20,11 @@ Used to draw icons and sprites in a user interface. The texture's placement can **Note:** You should enable :ref:`flip_v` when using a TextureRect to display a :ref:`ViewportTexture`. Alternatively, you can enable :ref:`Viewport.render_target_v_flip` on the Viewport. Otherwise, the image will appear upside down. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/676 `_ + Properties ---------- diff --git a/classes/class_theme.rst b/classes/class_theme.rst index e01fa83fa..a9ff43b72 100644 --- a/classes/class_theme.rst +++ b/classes/class_theme.rst @@ -35,67 +35,67 @@ Properties Methods ------- -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_color` **(** :ref:`String` name, :ref:`String` type **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_constant` **(** :ref:`String` name, :ref:`String` type **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_font` **(** :ref:`String` name, :ref:`String` type **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_icon` **(** :ref:`String` name, :ref:`String` type **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_stylebox` **(** :ref:`String` name, :ref:`String` type **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`copy_default_theme` **(** **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`copy_theme` **(** :ref:`Theme` other **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_color_list` **(** :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_constant_list` **(** :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_font_list` **(** :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_icon_list` **(** :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_stylebox_list` **(** :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_stylebox_types` **(** **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`get_type_list` **(** :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` type **)** |const| | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_color` **(** :ref:`String` name, :ref:`String` type, :ref:`Color` color **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_constant` **(** :ref:`String` name, :ref:`String` type, :ref:`int` constant **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_font` **(** :ref:`String` name, :ref:`String` type, :ref:`Font` font **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_icon` **(** :ref:`String` name, :ref:`String` type, :ref:`Texture` texture **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_stylebox` **(** :ref:`String` name, :ref:`String` type, :ref:`StyleBox` texture **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_color` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_constant` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_font` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_icon` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_stylebox` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_default_theme` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_theme` **(** :ref:`Theme` other **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_color_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_constant_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_font_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_icon_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_stylebox_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_stylebox_types` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_type_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_color` **(** :ref:`String` name, :ref:`String` node_type, :ref:`Color` color **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_constant` **(** :ref:`String` name, :ref:`String` node_type, :ref:`int` constant **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_font` **(** :ref:`String` name, :ref:`String` node_type, :ref:`Font` font **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon` **(** :ref:`String` name, :ref:`String` node_type, :ref:`Texture` texture **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_stylebox` **(** :ref:`String` name, :ref:`String` node_type, :ref:`StyleBox` texture **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -125,41 +125,41 @@ Clears all values on the theme. .. _class_Theme_method_clear_color: -- void **clear_color** **(** :ref:`String` name, :ref:`String` type **)** +- void **clear_color** **(** :ref:`String` name, :ref:`String` node_type **)** -Clears the :ref:`Color` at ``name`` if the theme has ``type``. +Clears the :ref:`Color` at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_clear_constant: -- void **clear_constant** **(** :ref:`String` name, :ref:`String` type **)** +- void **clear_constant** **(** :ref:`String` name, :ref:`String` node_type **)** -Clears the constant at ``name`` if the theme has ``type``. +Clears the constant at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_clear_font: -- void **clear_font** **(** :ref:`String` name, :ref:`String` type **)** +- void **clear_font** **(** :ref:`String` name, :ref:`String` node_type **)** -Clears the :ref:`Font` at ``name`` if the theme has ``type``. +Clears the :ref:`Font` at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_clear_icon: -- void **clear_icon** **(** :ref:`String` name, :ref:`String` type **)** +- void **clear_icon** **(** :ref:`String` name, :ref:`String` node_type **)** -Clears the icon at ``name`` if the theme has ``type``. +Clears the icon at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_clear_stylebox: -- void **clear_stylebox** **(** :ref:`String` name, :ref:`String` type **)** +- void **clear_stylebox** **(** :ref:`String` name, :ref:`String` node_type **)** -Clears :ref:`StyleBox` at ``name`` if the theme has ``type``. +Clears :ref:`StyleBox` at ``name`` if the theme has ``node_type``. ---- @@ -181,81 +181,81 @@ Sets the theme's values to a copy of a given theme. .. _class_Theme_method_get_color: -- :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns the :ref:`Color` at ``name`` if the theme has ``type``. +Returns the :ref:`Color` at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_get_color_list: -- :ref:`PoolStringArray` **get_color_list** **(** :ref:`String` type **)** |const| +- :ref:`PoolStringArray` **get_color_list** **(** :ref:`String` node_type **)** |const| -Returns all the :ref:`Color`\ s as a :ref:`PoolStringArray` filled with each :ref:`Color`'s name, for use in :ref:`get_color`, if the theme has ``type``. +Returns all the :ref:`Color`\ s as a :ref:`PoolStringArray` filled with each :ref:`Color`'s name, for use in :ref:`get_color`, if the theme has ``node_type``. ---- .. _class_Theme_method_get_constant: -- :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns the constant at ``name`` if the theme has ``type``. +Returns the constant at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_get_constant_list: -- :ref:`PoolStringArray` **get_constant_list** **(** :ref:`String` type **)** |const| +- :ref:`PoolStringArray` **get_constant_list** **(** :ref:`String` node_type **)** |const| -Returns all the constants as a :ref:`PoolStringArray` filled with each constant's name, for use in :ref:`get_constant`, if the theme has ``type``. +Returns all the constants as a :ref:`PoolStringArray` filled with each constant's name, for use in :ref:`get_constant`, if the theme has ``node_type``. ---- .. _class_Theme_method_get_font: -- :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns the :ref:`Font` at ``name`` if the theme has ``type``. +Returns the :ref:`Font` at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_get_font_list: -- :ref:`PoolStringArray` **get_font_list** **(** :ref:`String` type **)** |const| +- :ref:`PoolStringArray` **get_font_list** **(** :ref:`String` node_type **)** |const| -Returns all the :ref:`Font`\ s as a :ref:`PoolStringArray` filled with each :ref:`Font`'s name, for use in :ref:`get_font`, if the theme has ``type``. +Returns all the :ref:`Font`\ s as a :ref:`PoolStringArray` filled with each :ref:`Font`'s name, for use in :ref:`get_font`, if the theme has ``node_type``. ---- .. _class_Theme_method_get_icon: -- :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns the icon :ref:`Texture` at ``name`` if the theme has ``type``. +Returns the icon :ref:`Texture` at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_get_icon_list: -- :ref:`PoolStringArray` **get_icon_list** **(** :ref:`String` type **)** |const| +- :ref:`PoolStringArray` **get_icon_list** **(** :ref:`String` node_type **)** |const| -Returns all the icons as a :ref:`PoolStringArray` filled with each :ref:`Texture`'s name, for use in :ref:`get_icon`, if the theme has ``type``. +Returns all the icons as a :ref:`PoolStringArray` filled with each :ref:`Texture`'s name, for use in :ref:`get_icon`, if the theme has ``node_type``. ---- .. _class_Theme_method_get_stylebox: -- :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns the icon :ref:`StyleBox` at ``name`` if the theme has ``type``. +Returns the icon :ref:`StyleBox` at ``name`` if the theme has ``node_type``. ---- .. _class_Theme_method_get_stylebox_list: -- :ref:`PoolStringArray` **get_stylebox_list** **(** :ref:`String` type **)** |const| +- :ref:`PoolStringArray` **get_stylebox_list** **(** :ref:`String` node_type **)** |const| -Returns all the :ref:`StyleBox`\ s as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s name, for use in :ref:`get_stylebox`, if the theme has ``type``. +Returns all the :ref:`StyleBox`\ s as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s name, for use in :ref:`get_stylebox`, if the theme has ``node_type``. ---- @@ -263,115 +263,115 @@ Returns all the :ref:`StyleBox`\ s as a :ref:`PoolStringArray` **get_stylebox_types** **(** **)** |const| -Returns all the :ref:`StyleBox` types as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s type, for use in :ref:`get_stylebox` and/or :ref:`get_stylebox_list`, if the theme has ``type``. +Returns all the :ref:`StyleBox` types as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s type, for use in :ref:`get_stylebox` and/or :ref:`get_stylebox_list`, if the theme has ``node_type``. ---- .. _class_Theme_method_get_type_list: -- :ref:`PoolStringArray` **get_type_list** **(** :ref:`String` type **)** |const| +- :ref:`PoolStringArray` **get_type_list** **(** :ref:`String` node_type **)** |const| -Returns all the types in ``type`` as a :ref:`PoolStringArray` for use in any of the ``get_*`` functions, if the theme has ``type``. +Returns all the types in ``node_type`` as a :ref:`PoolStringArray` for use in any of the ``get_*`` functions, if the theme has ``node_type``. ---- .. _class_Theme_method_has_color: -- :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns ``true`` if :ref:`Color` with ``name`` is in ``type``. +Returns ``true`` if :ref:`Color` with ``name`` is in ``node_type``. -Returns ``false`` if the theme does not have ``type``. +Returns ``false`` if the theme does not have ``node_type``. ---- .. _class_Theme_method_has_constant: -- :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns ``true`` if constant with ``name`` is in ``type``. +Returns ``true`` if constant with ``name`` is in ``node_type``. -Returns ``false`` if the theme does not have ``type``. +Returns ``false`` if the theme does not have ``node_type``. ---- .. _class_Theme_method_has_font: -- :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns ``true`` if :ref:`Font` with ``name`` is in ``type``. +Returns ``true`` if :ref:`Font` with ``name`` is in ``node_type``. -Returns ``false`` if the theme does not have ``type``. +Returns ``false`` if the theme does not have ``node_type``. ---- .. _class_Theme_method_has_icon: -- :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns ``true`` if icon :ref:`Texture` with ``name`` is in ``type``. +Returns ``true`` if icon :ref:`Texture` with ``name`` is in ``node_type``. -Returns ``false`` if the theme does not have ``type``. +Returns ``false`` if the theme does not have ``node_type``. ---- .. _class_Theme_method_has_stylebox: -- :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` type **)** |const| +- :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` node_type **)** |const| -Returns ``true`` if :ref:`StyleBox` with ``name`` is in ``type``. +Returns ``true`` if :ref:`StyleBox` with ``name`` is in ``node_type``. -Returns ``false`` if the theme does not have ``type``. +Returns ``false`` if the theme does not have ``node_type``. ---- .. _class_Theme_method_set_color: -- void **set_color** **(** :ref:`String` name, :ref:`String` type, :ref:`Color` color **)** +- void **set_color** **(** :ref:`String` name, :ref:`String` node_type, :ref:`Color` color **)** -Sets the theme's :ref:`Color` to ``color`` at ``name`` in ``type``. +Sets the theme's :ref:`Color` to ``color`` at ``name`` in ``node_type``. -Does nothing if the theme does not have ``type``. +Does nothing if the theme does not have ``node_type``. ---- .. _class_Theme_method_set_constant: -- void **set_constant** **(** :ref:`String` name, :ref:`String` type, :ref:`int` constant **)** +- void **set_constant** **(** :ref:`String` name, :ref:`String` node_type, :ref:`int` constant **)** -Sets the theme's constant to ``constant`` at ``name`` in ``type``. +Sets the theme's constant to ``constant`` at ``name`` in ``node_type``. -Does nothing if the theme does not have ``type``. +Does nothing if the theme does not have ``node_type``. ---- .. _class_Theme_method_set_font: -- void **set_font** **(** :ref:`String` name, :ref:`String` type, :ref:`Font` font **)** +- void **set_font** **(** :ref:`String` name, :ref:`String` node_type, :ref:`Font` font **)** -Sets the theme's :ref:`Font` to ``font`` at ``name`` in ``type``. +Sets the theme's :ref:`Font` to ``font`` at ``name`` in ``node_type``. -Does nothing if the theme does not have ``type``. +Does nothing if the theme does not have ``node_type``. ---- .. _class_Theme_method_set_icon: -- void **set_icon** **(** :ref:`String` name, :ref:`String` type, :ref:`Texture` texture **)** +- void **set_icon** **(** :ref:`String` name, :ref:`String` node_type, :ref:`Texture` texture **)** -Sets the theme's icon :ref:`Texture` to ``texture`` at ``name`` in ``type``. +Sets the theme's icon :ref:`Texture` to ``texture`` at ``name`` in ``node_type``. -Does nothing if the theme does not have ``type``. +Does nothing if the theme does not have ``node_type``. ---- .. _class_Theme_method_set_stylebox: -- void **set_stylebox** **(** :ref:`String` name, :ref:`String` type, :ref:`StyleBox` texture **)** +- void **set_stylebox** **(** :ref:`String` name, :ref:`String` node_type, :ref:`StyleBox` texture **)** -Sets theme's :ref:`StyleBox` to ``stylebox`` at ``name`` in ``type``. +Sets theme's :ref:`StyleBox` to ``stylebox`` at ``name`` in ``node_type``. -Does nothing if the theme does not have ``type``. +Does nothing if the theme does not have ``node_type``. .. |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_thread.rst b/classes/class_thread.rst index d796fdab7..901fc3022 100644 --- a/classes/class_thread.rst +++ b/classes/class_thread.rst @@ -27,6 +27,8 @@ Tutorials - :doc:`../tutorials/threads/thread_safe_apis` +- `https://godotengine.org/asset-library/asset/676 `_ + Methods ------- diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst index f8c356ca3..3aa3d6ed7 100644 --- a/classes/class_tilemap.rst +++ b/classes/class_tilemap.rst @@ -23,6 +23,18 @@ Tutorials - :doc:`../tutorials/2d/using_tilemaps` +- `https://godotengine.org/asset-library/asset/120 `_ + +- `https://godotengine.org/asset-library/asset/112 `_ + +- `https://godotengine.org/asset-library/asset/111 `_ + +- `https://godotengine.org/asset-library/asset/519 `_ + +- `https://godotengine.org/asset-library/asset/520 `_ + +- `https://godotengine.org/asset-library/asset/113 `_ + Properties ---------- @@ -303,7 +315,7 @@ Position for tile origin. See :ref:`TileOrigin` for pos | *Getter* | is_y_sort_mode_enabled() | +-----------+--------------------------+ -If ``true``, the TileMap's children will be drawn in order of their Y coordinate. +If ``true``, the TileMap's direct children will be drawn in order of their Y coordinate. ---- @@ -369,7 +381,7 @@ Friction value for static body collisions (see ``collision_use_kinematic``). | *Getter* | get_collision_layer() | +-----------+----------------------------+ -The collision layer(s) for all colliders in the TileMap. See `Collision layers and masks `_ in the documentation for more information. +The collision layer(s) for all colliders in the TileMap. See `Collision layers and masks `_ in the documentation for more information. ---- @@ -385,7 +397,7 @@ The collision layer(s) for all colliders in the TileMap. See `Collision layers a | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The collision mask(s) for all colliders in the TileMap. See `Collision layers and masks `_ in the documentation for more information. +The collision mask(s) for all colliders in the TileMap. See `Collision layers and masks `_ in the documentation for more information. ---- diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst index a9f691737..04bcb3bf0 100644 --- a/classes/class_tileset.rst +++ b/classes/class_tileset.rst @@ -20,6 +20,23 @@ A TileSet is a library of tiles for a :ref:`TileMap`. It contains Tiles are referenced by a unique integer ID. +Tutorials +--------- + +- :doc:`../tutorials/2d/using_tilemaps` + +- `https://godotengine.org/asset-library/asset/120 `_ + +- `https://godotengine.org/asset-library/asset/112 `_ + +- `https://godotengine.org/asset-library/asset/111 `_ + +- `https://godotengine.org/asset-library/asset/519 `_ + +- `https://godotengine.org/asset-library/asset/520 `_ + +- `https://godotengine.org/asset-library/asset/113 `_ + Methods ------- diff --git a/classes/class_timer.rst b/classes/class_timer.rst index 063b7624a..1ad28f37c 100644 --- a/classes/class_timer.rst +++ b/classes/class_timer.rst @@ -20,6 +20,11 @@ Counts down a specified interval and emits a signal on reaching 0. Can be set to **Note:** To create an one-shot timer without instantiating a node, use :ref:`SceneTree.create_timer`. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/515 `_ + Properties ---------- diff --git a/classes/class_transform.rst b/classes/class_transform.rst index 70067e143..6228a6448 100644 --- a/classes/class_transform.rst +++ b/classes/class_transform.rst @@ -27,6 +27,12 @@ Tutorials - :doc:`../tutorials/3d/using_transforms` +- `https://godotengine.org/asset-library/asset/584 `_ + +- `https://godotengine.org/asset-library/asset/125 `_ + +- `https://godotengine.org/asset-library/asset/583 `_ + Properties ---------- diff --git a/classes/class_transform2d.rst b/classes/class_transform2d.rst index 47c0e49c8..36b72e2b8 100644 --- a/classes/class_transform2d.rst +++ b/classes/class_transform2d.rst @@ -21,8 +21,14 @@ For more information, read the "Matrices and transforms" documentation article. Tutorials --------- +- :doc:`../tutorials/math/index` + - :doc:`../tutorials/math/matrices_and_transforms` +- `https://godotengine.org/asset-library/asset/584 `_ + +- `https://godotengine.org/asset-library/asset/583 `_ + Properties ---------- diff --git a/classes/class_tree.rst b/classes/class_tree.rst index d88d04db0..aea71c2a5 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -568,7 +568,15 @@ To get the item which the returned drop section is relative to, use :ref:`get_it - :ref:`TreeItem` **get_edited** **(** **)** |const| -Returns the currently edited item. This is only available for custom cell mode. +Returns the currently edited item. Can be used with :ref:`item_edited` to get the item that was modified. + +:: + + func _ready(): + $Tree.item_edited.connect(on_Tree_item_edited) + + func on_Tree_item_edited(): + print($Tree.get_edited()) # This item just got edited (e.g. checked). ---- @@ -576,7 +584,7 @@ Returns the currently edited item. This is only available for custom cell mode. - :ref:`int` **get_edited_column** **(** **)** |const| -Returns the column for the currently edited item. This is only available for custom cell mode. +Returns the column for the currently edited item. ---- diff --git a/classes/class_vboxcontainer.rst b/classes/class_vboxcontainer.rst index 05256a822..dcd9497b4 100644 --- a/classes/class_vboxcontainer.rst +++ b/classes/class_vboxcontainer.rst @@ -20,6 +20,11 @@ Description Vertical box container. See :ref:`BoxContainer`. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/676 `_ + Theme Properties ---------------- diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index 10395902b..06d1799dc 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -23,6 +23,16 @@ Tutorials - :doc:`../tutorials/math/index` +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + +- `https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab `_ + +- `https://godotengine.org/asset-library/asset/584 `_ + +- `https://github.com/godotengine/godot-demo-projects/tree/master/2d `_ + Properties ---------- @@ -268,7 +278,7 @@ Cubically interpolates between this vector and ``b`` using ``pre_a`` and ``post_ - :ref:`Vector2` **direction_to** **(** :ref:`Vector2` b **)** -Returns the normalized vector pointing from this vector to ``b``. +Returns the normalized vector pointing from this vector to ``b``. This is equivalent to using ``(b - a).normalized()``. ---- @@ -324,7 +334,7 @@ Returns ``true`` if this vector and ``v`` are approximately equal, by running :r - :ref:`bool` **is_normalized** **(** **)** -Returns ``true`` if the vector is normalized, and false otherwise. +Returns ``true`` if the vector is normalized, ``false`` otherwise. ---- diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 89b1f4709..e5cfd8fa6 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -23,6 +23,16 @@ Tutorials - :doc:`../tutorials/math/index` +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + +- `https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab `_ + +- `https://godotengine.org/asset-library/asset/584 `_ + +- `https://github.com/godotengine/godot-demo-projects/tree/master/3d `_ + Properties ---------- @@ -258,7 +268,7 @@ Performs a cubic interpolation between vectors ``pre_a``, ``a``, ``b``, ``post_b - :ref:`Vector3` **direction_to** **(** :ref:`Vector3` b **)** -Returns the normalized vector pointing from this vector to ``b``. +Returns the normalized vector pointing from this vector to ``b``. This is equivalent to using ``(b - a).normalized()``. ---- @@ -322,7 +332,7 @@ Returns ``true`` if this vector and ``v`` are approximately equal, by running :r - :ref:`bool` **is_normalized** **(** **)** -Returns ``true`` if the vector is normalized, and false otherwise. +Returns ``true`` if the vector is normalized, ``false`` otherwise. ---- diff --git a/classes/class_vehiclebody.rst b/classes/class_vehiclebody.rst index b66776582..01a7d6556 100644 --- a/classes/class_vehiclebody.rst +++ b/classes/class_vehiclebody.rst @@ -22,6 +22,11 @@ This node implements all the physics logic needed to simulate a car. It is based **Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another :ref:`PhysicsBody` class. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/524 `_ + Properties ---------- diff --git a/classes/class_vehiclewheel.rst b/classes/class_vehiclewheel.rst index 6a959b1ed..9adad966a 100644 --- a/classes/class_vehiclewheel.rst +++ b/classes/class_vehiclewheel.rst @@ -20,6 +20,11 @@ This node needs to be used as a child node of :ref:`VehicleBody` class. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/524 `_ + Properties ---------- diff --git a/classes/class_videoplayer.rst b/classes/class_videoplayer.rst index d621245df..52e2902c8 100644 --- a/classes/class_videoplayer.rst +++ b/classes/class_videoplayer.rst @@ -18,7 +18,9 @@ Description Control node for playing video streams using :ref:`VideoStream` resources. -Supported video formats are `WebM `_ (:ref:`VideoStreamWebm`), `Ogg Theora `_ (:ref:`VideoStreamTheora`), and any format exposed via a GDNative plugin using :ref:`VideoStreamGDNative`. +Supported video formats are `WebM `_ (``.webm``, :ref:`VideoStreamWebm`), `Ogg Theora `_ (``.ogv``, :ref:`VideoStreamTheora`), and any format exposed via a GDNative plugin using :ref:`VideoStreamGDNative`. + +**Note:** Due to a bug, VideoPlayer does not support localization remapping yet. Properties ---------- diff --git a/classes/class_videostreamtheora.rst b/classes/class_videostreamtheora.rst index 1531b5b4a..d54cfd9e9 100644 --- a/classes/class_videostreamtheora.rst +++ b/classes/class_videostreamtheora.rst @@ -16,7 +16,9 @@ VideoStreamTheora Description ----------- -:ref:`VideoStream` resource handling the `Ogg Theora `_ video format with ``.ogv`` extension. +:ref:`VideoStream` resource handling the `Ogg Theora `_ video format with ``.ogv`` extension. The Theora codec is less efficient than :ref:`VideoStreamWebm`'s VP8 and VP9, but it requires less CPU resources to decode. The Theora codec is decoded on the CPU. + +**Note:** While Ogg Theora videos can also have an ``.ogg`` extension, you will have to rename the extension to ``.ogv`` to use those videos within Godot. Methods ------- @@ -42,7 +44,7 @@ Returns the Ogg Theora video file handled by this ``VideoStreamTheora``. - void **set_file** **(** :ref:`String` file **)** -Sets the Ogg Theora video file that this ``VideoStreamTheora`` resource handles. The ``file`` name should have the ``.o`` extension. +Sets the Ogg Theora video file that this ``VideoStreamTheora`` resource handles. The ``file`` name should have the ``.ogv`` extension. .. |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_videostreamwebm.rst b/classes/class_videostreamwebm.rst index 12d7966b4..742f0c085 100644 --- a/classes/class_videostreamwebm.rst +++ b/classes/class_videostreamwebm.rst @@ -16,7 +16,11 @@ VideoStreamWebm Description ----------- -:ref:`VideoStream` resource handling the `WebM `_ video format with ``.webm`` extension. +:ref:`VideoStream` resource handling the `WebM `_ video format with ``.webm`` extension. Both the VP8 and VP9 codecs are supported. The VP8 and VP9 codecs are more efficient than :ref:`VideoStreamTheora`, but they require more CPU resources to decode (especially VP9). Both the VP8 and VP9 codecs are decoded on the CPU. + +**Note:** Alpha channel (also known as transparency) is not supported. The video will always appear to have a black background, even if it originally contains an alpha channel. + +**Note:** There are known bugs and performance issues with WebM video playback in Godot. If you run into problems, try using the Ogg Theora format instead: :ref:`VideoStreamTheora` Methods ------- diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst index c1d8ebccb..079e36ebe 100644 --- a/classes/class_viewport.rst +++ b/classes/class_viewport.rst @@ -35,6 +35,18 @@ Tutorials - :doc:`../tutorials/viewports/index` +- `https://godotengine.org/asset-library/asset/127 `_ + +- `https://godotengine.org/asset-library/asset/128 `_ + +- `https://godotengine.org/asset-library/asset/129 `_ + +- `https://godotengine.org/asset-library/asset/130 `_ + +- `https://godotengine.org/asset-library/asset/541 `_ + +- `https://godotengine.org/asset-library/asset/586 `_ + Properties ---------- @@ -47,10 +59,14 @@ Properties +---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ | :ref:`Transform2D` | :ref:`canvas_transform` | | +---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`debanding` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ | :ref:`DebugDraw` | :ref:`debug_draw` | ``0`` | +---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ | :ref:`bool` | :ref:`disable_3d` | ``false`` | +---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`fxaa` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ | :ref:`Transform2D` | :ref:`global_canvas_transform` | | +---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ | :ref:`bool` | :ref:`gui_disable_input` | ``false`` | @@ -428,6 +444,24 @@ The canvas transform of the viewport, useful for changing the on-screen position ---- +.. _class_Viewport_property_debanding: + +- :ref:`bool` **debanding** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_use_debanding(value) | ++-----------+--------------------------+ +| *Getter* | get_use_debanding() | ++-----------+--------------------------+ + +If ``true``, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +**Note:** Only available on the GLES3 backend. :ref:`hdr` must also be ``true`` for debanding to be effective. + +---- + .. _class_Viewport_property_debug_draw: - :ref:`DebugDraw` **debug_draw** @@ -460,6 +494,22 @@ If ``true``, the viewport will disable 3D rendering. For actual disabling use `` ---- +.. _class_Viewport_property_fxaa: + +- :ref:`bool` **fxaa** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_use_fxaa(value) | ++-----------+---------------------+ +| *Getter* | get_use_fxaa() | ++-----------+---------------------+ + +Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. + +---- + .. _class_Viewport_property_global_canvas_transform: - :ref:`Transform2D` **global_canvas_transform** @@ -486,7 +536,7 @@ The global canvas transform of the viewport. The canvas transform is relative to | *Getter* | is_input_disabled() | +-----------+--------------------------+ -If ``true``, the viewport will not receive input event. +If ``true``, the viewport will not receive input events. ---- diff --git a/classes/class_viewporttexture.rst b/classes/class_viewporttexture.rst index 510893fce..3279cc76a 100644 --- a/classes/class_viewporttexture.rst +++ b/classes/class_viewporttexture.rst @@ -20,6 +20,17 @@ Displays the content of a :ref:`Viewport` node as a dynamic :ref To create a ViewportTexture in code, use the :ref:`Viewport.get_texture` method on the target viewport. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/127 `_ + +- `https://godotengine.org/asset-library/asset/128 `_ + +- `https://godotengine.org/asset-library/asset/129 `_ + +- `https://godotengine.org/asset-library/asset/586 `_ + Properties ---------- diff --git a/classes/class_visibilitynotifier2d.rst b/classes/class_visibilitynotifier2d.rst index 083d947a0..3212643e2 100644 --- a/classes/class_visibilitynotifier2d.rst +++ b/classes/class_visibilitynotifier2d.rst @@ -24,6 +24,11 @@ If you want nodes to be disabled automatically when they exit the screen, use :r **Note:** For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by :ref:`ProjectSettings.world/2d/cell_size`. If you need precise visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/515 `_ + Properties ---------- diff --git a/classes/class_visualscriptlists.rst b/classes/class_visualscriptlists.rst index 86de05adb..337e73f7b 100644 --- a/classes/class_visualscriptlists.rst +++ b/classes/class_visualscriptlists.rst @@ -18,7 +18,7 @@ A Visual Script virtual class for in-graph editable nodes. Description ----------- -A Visual Script virtual class that defines the shape and the default behaviour of the nodes that have to be in-graph editable nodes. +A Visual Script virtual class that defines the shape and the default behavior of the nodes that have to be in-graph editable nodes. Methods ------- diff --git a/classes/class_visualscriptpropertyget.rst b/classes/class_visualscriptpropertyget.rst index ab912147d..bc53f214f 100644 --- a/classes/class_visualscriptpropertyget.rst +++ b/classes/class_visualscriptpropertyget.rst @@ -43,6 +43,8 @@ Enumerations .. _class_VisualScriptPropertyGet_constant_CALL_MODE_INSTANCE: +.. _class_VisualScriptPropertyGet_constant_CALL_MODE_BASIC_TYPE: + enum **CallMode**: - **CALL_MODE_SELF** = **0** @@ -51,6 +53,8 @@ enum **CallMode**: - **CALL_MODE_INSTANCE** = **2** +- **CALL_MODE_BASIC_TYPE** = **3** + Property Descriptions --------------------- diff --git a/classes/class_visualserver.rst b/classes/class_visualserver.rst index 1f4015f94..a0adfacf3 100644 --- a/classes/class_visualserver.rst +++ b/classes/class_visualserver.rst @@ -404,6 +404,8 @@ Methods +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`light_omni_set_shadow_mode` **(** :ref:`RID` light, :ref:`LightOmniShadowMode` mode **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_bake_mode` **(** :ref:`RID` light, :ref:`LightBakeMode` bake_mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`light_set_color` **(** :ref:`RID` light, :ref:`Color` color **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`light_set_cull_mask` **(** :ref:`RID` light, :ref:`int` mask **)** | @@ -780,6 +782,10 @@ Methods +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`viewport_set_use_arvr` **(** :ref:`RID` viewport, :ref:`bool` use_arvr **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_use_debanding` **(** :ref:`RID` viewport, :ref:`bool` debanding **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_use_fxaa` **(** :ref:`RID` viewport, :ref:`bool` fxaa **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`viewport_set_vflip` **(** :ref:`RID` viewport, :ref:`bool` enabled **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1189,6 +1195,24 @@ enum **LightParam**: ---- +.. _enum_VisualServer_LightBakeMode: + +.. _class_VisualServer_constant_LIGHT_BAKE_DISABLED: + +.. _class_VisualServer_constant_LIGHT_BAKE_INDIRECT: + +.. _class_VisualServer_constant_LIGHT_BAKE_ALL: + +enum **LightBakeMode**: + +- **LIGHT_BAKE_DISABLED** = **0** + +- **LIGHT_BAKE_INDIRECT** = **1** + +- **LIGHT_BAKE_ALL** = **2** + +---- + .. _enum_VisualServer_LightOmniShadowMode: .. _class_VisualServer_constant_LIGHT_OMNI_SHADOW_DUAL_PARABOLOID: @@ -3052,7 +3076,9 @@ Not yet implemented. Always returns ``false``. - :ref:`bool` **has_os_feature** **(** :ref:`String` feature **)** |const| -Returns ``true`` if the OS supports a certain feature. Features might be ``s3tc``, ``etc``, ``etc2`` and ``pvrtc``. +Returns ``true`` if the OS supports a certain feature. Features might be ``s3tc``, ``etc``, ``etc2``, ``pvrtc`` and ``skinning_fallback``. + +When rendering with GLES2, returns ``true`` with ``skinning_fallback`` in case the hardware doesn't support the default GPU skinning process. ---- @@ -3408,6 +3434,14 @@ Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual para ---- +.. _class_VisualServer_method_light_set_bake_mode: + +- void **light_set_bake_mode** **(** :ref:`RID` light, :ref:`LightBakeMode` bake_mode **)** + +Sets the bake mode for this light, see :ref:`LightBakeMode` for options. The bake mode affects how the light will be baked in :ref:`BakedLightmap`\ s and :ref:`GIProbe`\ s. + +---- + .. _class_VisualServer_method_light_set_color: - void **light_set_color** **(** :ref:`RID` light, :ref:`Color` color **)** @@ -3476,7 +3510,7 @@ Sets the color of the shadow cast by the light. Equivalent to :ref:`Light.shadow - void **light_set_use_gi** **(** :ref:`RID` light, :ref:`bool` enabled **)** -Sets whether GI probes capture light information from this light. +Sets whether GI probes capture light information from this light. *Deprecated method.* Use :ref:`light_set_bake_mode` instead. This method is only kept for compatibility reasons and calls :ref:`light_set_bake_mode` internally, setting the bake mode to :ref:`LIGHT_BAKE_DISABLED` or :ref:`LIGHT_BAKE_INDIRECT` depending on the given parameter. ---- @@ -4982,6 +5016,24 @@ If ``true``, the viewport uses augmented or virtual reality technologies. See :r ---- +.. _class_VisualServer_method_viewport_set_use_debanding: + +- void **viewport_set_use_debanding** **(** :ref:`RID` viewport, :ref:`bool` debanding **)** + +If ``true``, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +**Note:** Only available on the GLES3 backend. :ref:`Viewport.hdr` must also be ``true`` for debanding to be effective. + +---- + +.. _class_VisualServer_method_viewport_set_use_fxaa: + +- void **viewport_set_use_fxaa** **(** :ref:`RID` viewport, :ref:`bool` fxaa **)** + +Enables fast approximate antialiasing for this viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. + +---- + .. _class_VisualServer_method_viewport_set_vflip: - void **viewport_set_vflip** **(** :ref:`RID` viewport, :ref:`bool` enabled **)** diff --git a/classes/class_visualshadernode.rst b/classes/class_visualshadernode.rst index e29a10851..de44e66e7 100644 --- a/classes/class_visualshadernode.rst +++ b/classes/class_visualshadernode.rst @@ -11,7 +11,7 @@ VisualShaderNode **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` -**Inherited By:** :ref:`VisualShaderNodeBooleanConstant`, :ref:`VisualShaderNodeColorConstant`, :ref:`VisualShaderNodeColorFunc`, :ref:`VisualShaderNodeColorOp`, :ref:`VisualShaderNodeCompare`, :ref:`VisualShaderNodeCubeMap`, :ref:`VisualShaderNodeCustom`, :ref:`VisualShaderNodeDeterminant`, :ref:`VisualShaderNodeDotProduct`, :ref:`VisualShaderNodeFaceForward`, :ref:`VisualShaderNodeFresnel`, :ref:`VisualShaderNodeGroupBase`, :ref:`VisualShaderNodeIf`, :ref:`VisualShaderNodeInput`, :ref:`VisualShaderNodeIs`, :ref:`VisualShaderNodeOuterProduct`, :ref:`VisualShaderNodeOutput`, :ref:`VisualShaderNodeScalarClamp`, :ref:`VisualShaderNodeScalarConstant`, :ref:`VisualShaderNodeScalarDerivativeFunc`, :ref:`VisualShaderNodeScalarFunc`, :ref:`VisualShaderNodeScalarInterp`, :ref:`VisualShaderNodeScalarOp`, :ref:`VisualShaderNodeScalarSmoothStep`, :ref:`VisualShaderNodeSwitch`, :ref:`VisualShaderNodeTexture`, :ref:`VisualShaderNodeTransformCompose`, :ref:`VisualShaderNodeTransformConstant`, :ref:`VisualShaderNodeTransformDecompose`, :ref:`VisualShaderNodeTransformFunc`, :ref:`VisualShaderNodeTransformMult`, :ref:`VisualShaderNodeTransformVecMult`, :ref:`VisualShaderNodeUniform`, :ref:`VisualShaderNodeVec3Constant`, :ref:`VisualShaderNodeVectorClamp`, :ref:`VisualShaderNodeVectorCompose`, :ref:`VisualShaderNodeVectorDecompose`, :ref:`VisualShaderNodeVectorDerivativeFunc`, :ref:`VisualShaderNodeVectorDistance`, :ref:`VisualShaderNodeVectorFunc`, :ref:`VisualShaderNodeVectorInterp`, :ref:`VisualShaderNodeVectorLen`, :ref:`VisualShaderNodeVectorOp`, :ref:`VisualShaderNodeVectorRefract`, :ref:`VisualShaderNodeVectorScalarMix`, :ref:`VisualShaderNodeVectorScalarSmoothStep`, :ref:`VisualShaderNodeVectorScalarStep`, :ref:`VisualShaderNodeVectorSmoothStep` +**Inherited By:** :ref:`VisualShaderNodeBooleanConstant`, :ref:`VisualShaderNodeColorConstant`, :ref:`VisualShaderNodeColorFunc`, :ref:`VisualShaderNodeColorOp`, :ref:`VisualShaderNodeCompare`, :ref:`VisualShaderNodeCubeMap`, :ref:`VisualShaderNodeCustom`, :ref:`VisualShaderNodeDeterminant`, :ref:`VisualShaderNodeDotProduct`, :ref:`VisualShaderNodeFaceForward`, :ref:`VisualShaderNodeFresnel`, :ref:`VisualShaderNodeGroupBase`, :ref:`VisualShaderNodeIf`, :ref:`VisualShaderNodeInput`, :ref:`VisualShaderNodeIs`, :ref:`VisualShaderNodeOuterProduct`, :ref:`VisualShaderNodeOutput`, :ref:`VisualShaderNodeScalarClamp`, :ref:`VisualShaderNodeScalarConstant`, :ref:`VisualShaderNodeScalarDerivativeFunc`, :ref:`VisualShaderNodeScalarFunc`, :ref:`VisualShaderNodeScalarInterp`, :ref:`VisualShaderNodeScalarOp`, :ref:`VisualShaderNodeScalarSmoothStep`, :ref:`VisualShaderNodeSwitch`, :ref:`VisualShaderNodeTexture`, :ref:`VisualShaderNodeTransformCompose`, :ref:`VisualShaderNodeTransformConstant`, :ref:`VisualShaderNodeTransformDecompose`, :ref:`VisualShaderNodeTransformFunc`, :ref:`VisualShaderNodeTransformMult`, :ref:`VisualShaderNodeTransformVecMult`, :ref:`VisualShaderNodeUniform`, :ref:`VisualShaderNodeUniformRef`, :ref:`VisualShaderNodeVec3Constant`, :ref:`VisualShaderNodeVectorClamp`, :ref:`VisualShaderNodeVectorCompose`, :ref:`VisualShaderNodeVectorDecompose`, :ref:`VisualShaderNodeVectorDerivativeFunc`, :ref:`VisualShaderNodeVectorDistance`, :ref:`VisualShaderNodeVectorFunc`, :ref:`VisualShaderNodeVectorInterp`, :ref:`VisualShaderNodeVectorLen`, :ref:`VisualShaderNodeVectorOp`, :ref:`VisualShaderNodeVectorRefract`, :ref:`VisualShaderNodeVectorScalarMix`, :ref:`VisualShaderNodeVectorScalarSmoothStep`, :ref:`VisualShaderNodeVectorScalarStep`, :ref:`VisualShaderNodeVectorSmoothStep` Base class for nodes in a visual shader graph. diff --git a/classes/class_visualshadernodeuniformref.rst b/classes/class_visualshadernodeuniformref.rst new file mode 100644 index 000000000..502af4f57 --- /dev/null +++ b/classes/class_visualshadernodeuniformref.rst @@ -0,0 +1,47 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeUniformRef.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeUniformRef: + +VisualShaderNodeUniformRef +========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A reference to an existing :ref:`VisualShaderNodeUniform`. + +Description +----------- + +Creating a reference to a :ref:`VisualShaderNodeUniform` allows you to reuse this uniform in different shaders or shader stages easily. + +Properties +---------- + ++-----------------------------+-----------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`uniform_name` | ``"[None]"`` | ++-----------------------------+-----------------------------------------------------------------------------+--------------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeUniformRef_property_uniform_name: + +- :ref:`String` **uniform_name** + ++-----------+-------------------------+ +| *Default* | ``"[None]"`` | ++-----------+-------------------------+ +| *Setter* | set_uniform_name(value) | ++-----------+-------------------------+ +| *Getter* | get_uniform_name() | ++-----------+-------------------------+ + +The name of the uniform which this reference points to. + +.. |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_webrtcpeerconnection.rst b/classes/class_webrtcpeerconnection.rst index 9d44f5def..bd7ee94fd 100644 --- a/classes/class_webrtcpeerconnection.rst +++ b/classes/class_webrtcpeerconnection.rst @@ -38,13 +38,13 @@ Methods +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`close` **(** **)** | +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`WebRTCDataChannel` | :ref:`create_data_channel` **(** :ref:`String` label, :ref:`Dictionary` options={ } **)** | +| :ref:`WebRTCDataChannel` | :ref:`create_data_channel` **(** :ref:`String` label, :ref:`Dictionary` options={ } **)** | +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`create_offer` **(** **)** | +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ConnectionState` | :ref:`get_connection_state` **(** **)** |const| | +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`initialize` **(** :ref:`Dictionary` configuration={ } **)** | +| :ref:`Error` | :ref:`initialize` **(** :ref:`Dictionary` configuration={ } **)** | +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`poll` **(** **)** | +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -132,7 +132,7 @@ Close the peer connection and all data channels associated with it. Note, you ca .. _class_WebRTCPeerConnection_method_create_data_channel: -- :ref:`WebRTCDataChannel` **create_data_channel** **(** :ref:`String` label, :ref:`Dictionary` options={ } **)** +- :ref:`WebRTCDataChannel` **create_data_channel** **(** :ref:`String` label, :ref:`Dictionary` options={ } **)** Returns a new :ref:`WebRTCDataChannel` (or ``null`` on failure) with given ``label`` and optionally configured via the ``options`` dictionary. This method can only be called when the connection is in state :ref:`STATE_NEW`. @@ -178,7 +178,7 @@ Returns the connection state. See :ref:`ConnectionState` **initialize** **(** :ref:`Dictionary` configuration={ } **)** +- :ref:`Error` **initialize** **(** :ref:`Dictionary` configuration={ } **)** Re-initialize this peer connection, closing any previously active connection, and going back to state :ref:`STATE_NEW`. A dictionary of ``options`` can be passed to configure the peer connection. diff --git a/classes/class_webxrinterface.rst b/classes/class_webxrinterface.rst new file mode 100644 index 000000000..bc2a50483 --- /dev/null +++ b/classes/class_webxrinterface.rst @@ -0,0 +1,425 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebXRInterface.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebXRInterface: + +WebXRInterface +============== + +**Inherits:** :ref:`ARVRInterface` **<** :ref:`Reference` **<** :ref:`Object` + +AR/VR interface using WebXR. + +Description +----------- + +WebXR is an open standard that allows creating VR and AR applications that run in the web browser. + +As such, this interface is only available when running in an HTML5 export. + +WebXR supports a wide range of devices, from the very capable (like Valve Index, HTC Vive, Oculus Rift and Quest) down to the much less capable (like Google Cardboard, Oculus Go, GearVR, or plain smartphones). + +Since WebXR is based on Javascript, it makes extensive use of callbacks, which means that ``WebXRInterface`` is forced to use signals, where other AR/VR interfaces would instead use functions that return a result immediately. This makes ``WebXRInterface`` quite a bit more complicated to intialize than other AR/VR interfaces. + +Here's the minimum code required to start an immersive VR session: + +:: + + var webxr_interface + var vr_supported = false + + func _ready(): + # We assume this node has a canvas layer with a button on it as a child. + # This button is for the user to consent to entering immersive VR mode. + $CanvasLayer/Button.connect("pressed", self, "_on_Button_pressed") + + webxr_interface = ARVRServer.find_interface("WebXR") + if webxr_interface: + # WebXR uses a lot of asynchronous callbacks, so we connect to various + # signals in order to receive them. + webxr_interface.connect("session_supported", self, "_webxr_session_supported") + webxr_interface.connect("session_started", self, "_webxr_session_started") + webxr_interface.connect("session_ended", self, "_webxr_session_ended") + webxr_interface.connect("session_failed", self, "_webxr_session_failed") + + # This returns immediately - our _webxr_session_supported() method + # (which we connected to the "session_supported" signal above) will + # be called sometime later to let us know if it's supported or not. + webxr_interface.is_session_supported("immersive-vr") + + func _webxr_session_supported(session_mode, supported): + if session_mode == 'immersive-vr': + vr_supported = supported + + func _on_Button_pressed(): + if not vr_supported: + OS.alert("Your browser doesn't support VR") + return + + # We want an immersive VR session, as opposed to AR ('immersive-ar') or a + # simple 3DoF viewer ('viewer'). + webxr_interface.session_mode = 'immersive-vr' + # 'bounded-floor' is room scale, 'local-floor' is a standing or sitting + # experience (it puts you 1.6m above the ground if you have 3DoF headset), + # whereas as 'local' puts you down at the ARVROrigin. + # This list means it'll first try to request 'bounded-floor', then + # fallback on 'local-floor' and ultimately 'local', if nothing else is + # supported. + webxr_interface.requested_reference_space_types = 'bounded-floor, local-floor, local' + # In order to use 'local-floor' or 'bounded-floor' we must also + # mark the features as required or optional. + webxr_interface.required_features = 'local-floor' + webxr_interface.optional_features = 'bounded-floor' + + # This will return false if we're unable to even request the session, + # however, it can still fail asynchronously later in the process, so we + # only know if it's really succeeded or failed when our + # _webxr_session_started() or _webxr_session_failed() methods are called. + if not webxr_interface.initialize(): + OS.alert("Failed to initialize") + return + + func _webxr_session_started(): + # This tells Godot to start rendering to the headset. + get_viewport().arvr = true + # This will be the reference space type you ultimately got, out of the + # types that you requested above. This is useful if you want the game to + # work a little differently in 'bounded-floor' versus 'local-floor'. + print ("Reference space type: " + webxr_interface.reference_space_type) + + func _webxr_session_ended(): + # If the user exits immersive mode, then we tell Godot to render to the web + # page again. + get_viewport().arvr = false + + func _webxr_session_failed(message): + OS.alert("Failed to initialize: " + message) + +There are several ways to handle "controller" input: + +- Using :ref:`ARVRController` nodes and their :ref:`ARVRController.button_pressed` and :ref:`ARVRController.button_release` signals. This is how controllers are typically handled in AR/VR apps in Godot, however, this will only work with advanced VR controllers like the Oculus Touch or Index controllers, for example. The buttons codes are defined by `Section 3.3 of the WebXR Gamepads Module `_. + +- Using :ref:`Node._unhandled_input` and :ref:`InputEventJoypadButton` or :ref:`InputEventJoypadMotion`. This works the same as normal joypads, except the :ref:`InputEvent.device` starts at 100, so the left controller is 100 and the right controller is 101, and the button codes are also defined by `Section 3.3 of the WebXR Gamepads Module `_. + +- Using the :ref:`select`, :ref:`squeeze` and related signals. This method will work for both advanced VR controllers, and non-traditional "controllers" like a tap on the screen, a spoken voice command or a button press on the device itself. The ``controller_id`` passed to these signals is the same id as used in :ref:`ARVRController.controller_id`. + +You can use one or all of these methods to allow your game or app to support a wider or narrower set of devices and input methods, or to allow more advanced interations with more advanced devices. + +Tutorials +--------- + +- `https://www.snopekgames.com/blog/2020/how-make-vr-game-webxr-godot `_ + +Properties +---------- + ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`bounds_geometry` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`optional_features` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`reference_space_type` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`requested_reference_space_types` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`required_features` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`session_mode` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`visibility_state` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ + +Methods +------- + ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ARVRPositionalTracker` | :ref:`get_controller` **(** :ref:`int` controller_id **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`is_session_supported` **(** :ref:`String` session_mode **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_WebXRInterface_signal_reference_space_reset: + +- **reference_space_reset** **(** **)** + +Emitted to indicate that the reference space has been reset or reconfigured. + +When (or whether) this is emitted depends on the user's browser or device, but may include when the user has changed the dimensions of their play space (which you may be able to access via :ref:`bounds_geometry`) or pressed/held a button to recenter their position. + +See `WebXR's XRReferenceSpace reset event `_ for more information. + +---- + +.. _class_WebXRInterface_signal_select: + +- **select** **(** :ref:`int` controller_id **)** + +Emitted after one of the "controllers" has finished its "primary action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_selectend: + +- **selectend** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has finished its "primary action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_selectstart: + +- **selectstart** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has started its "primary action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_session_ended: + +- **session_ended** **(** **)** + +Emitted when the user ends the WebXR session (which can be done using UI from the browser or device). + +At this point, you should do ``get_viewport().arvr = false`` to instruct Godot to resume rendering to the screen. + +---- + +.. _class_WebXRInterface_signal_session_failed: + +- **session_failed** **(** :ref:`String` message **)** + +Emitted by :ref:`ARVRInterface.initialize` if the session fails to start. + +``message`` may optionally contain an error message from WebXR, or an empty string if no message is available. + +---- + +.. _class_WebXRInterface_signal_session_started: + +- **session_started** **(** **)** + +Emitted by :ref:`ARVRInterface.initialize` if the session is successfully started. + +At this point, it's safe to do ``get_viewport().arvr = true`` to instruct Godot to start rendering to the AR/VR device. + +---- + +.. _class_WebXRInterface_signal_session_supported: + +- **session_supported** **(** :ref:`String` session_mode, :ref:`bool` supported **)** + +Emitted by :ref:`is_session_supported` to indicate if the given ``session_mode`` is supported or not. + +---- + +.. _class_WebXRInterface_signal_squeeze: + +- **squeeze** **(** :ref:`int` controller_id **)** + +Emitted after one of the "controllers" has finished its "primary squeeze action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_squeezeend: + +- **squeezeend** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has finished its "primary squeeze action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_squeezestart: + +- **squeezestart** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has started its "primary squeeze action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_visibility_state_changed: + +- **visibility_state_changed** **(** **)** + +Emitted when :ref:`visibility_state` has changed. + +Property Descriptions +--------------------- + +.. _class_WebXRInterface_property_bounds_geometry: + +- :ref:`PoolVector3Array` **bounds_geometry** + ++----------+-----------------------+ +| *Getter* | get_bounds_geometry() | ++----------+-----------------------+ + +The vertices of a polygon which defines the boundaries of the user's play area. + +This will only be available if :ref:`reference_space_type` is ``"bounded-floor"`` and only on certain browsers and devices that support it. + +The :ref:`reference_space_reset` signal may indicate when this changes. + +---- + +.. _class_WebXRInterface_property_optional_features: + +- :ref:`String` **optional_features** + ++----------+------------------------------+ +| *Setter* | set_optional_features(value) | ++----------+------------------------------+ +| *Getter* | get_optional_features() | ++----------+------------------------------+ + +A comma-seperated list of optional features used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +If a user's browser or device doesn't support one of the given features, initialization will continue, but you won't be able to use the requested feature. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRReferenceSpaceType `_. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_reference_space_type: + +- :ref:`String` **reference_space_type** + ++----------+----------------------------+ +| *Getter* | get_reference_space_type() | ++----------+----------------------------+ + +The reference space type (from the list of requested types set in the :ref:`requested_reference_space_types` property), that was ultimately used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +Possible values come from `WebXR's XRReferenceSpaceType `_. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_requested_reference_space_types: + +- :ref:`String` **requested_reference_space_types** + ++----------+--------------------------------------------+ +| *Setter* | set_requested_reference_space_types(value) | ++----------+--------------------------------------------+ +| *Getter* | get_requested_reference_space_types() | ++----------+--------------------------------------------+ + +A comma-seperated list of reference space types used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +The reference space types are requested in order, and the first on supported by the users device or browser will be used. The :ref:`reference_space_type` property contains the reference space type that was ultimately used. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRReferenceSpaceType `_. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_required_features: + +- :ref:`String` **required_features** + ++----------+------------------------------+ +| *Setter* | set_required_features(value) | ++----------+------------------------------+ +| *Getter* | get_required_features() | ++----------+------------------------------+ + +A comma-seperated list of required features used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +If a user's browser or device doesn't support one of the given features, initialization will fail and :ref:`session_failed` will be emitted. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRReferenceSpaceType `_. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_session_mode: + +- :ref:`String` **session_mode** + ++----------+-------------------------+ +| *Setter* | set_session_mode(value) | ++----------+-------------------------+ +| *Getter* | get_session_mode() | ++----------+-------------------------+ + +The session mode used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRSessionMode `_, including: ``"immersive-vr"``, ``"immersive-ar"``, and ``"inline"``. + +---- + +.. _class_WebXRInterface_property_visibility_state: + +- :ref:`String` **visibility_state** + ++----------+------------------------+ +| *Getter* | get_visibility_state() | ++----------+------------------------+ + +Indicates if the WebXR session's imagery is visible to the user. + +Possible values come from `WebXR's XRVisibilityState `_, including ``"hidden"``, ``"visible"``, and ``"visible-blurred"``. + +Method Descriptions +------------------- + +.. _class_WebXRInterface_method_get_controller: + +- :ref:`ARVRPositionalTracker` **get_controller** **(** :ref:`int` controller_id **)** |const| + +Gets an :ref:`ARVRPositionalTracker` for the given ``controller_id``. + +In the context of WebXR, a "controller" can be an advanced VR controller like the Oculus Touch or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the device itself. When a non-traditional controller is used, interpret the position and orientation of the :ref:`ARVRPositionalTracker` as a ray pointing at the object the user wishes to interact with. + +Use this method to get information about the controller that triggered one of these signals: + +- :ref:`selectstart` + +- :ref:`select` + +- :ref:`selectend` + +- :ref:`squeezestart` + +- :ref:`squeeze` + +- :ref:`squeezestart` + +---- + +.. _class_WebXRInterface_method_is_session_supported: + +- void **is_session_supported** **(** :ref:`String` session_mode **)** + +Checks if the given ``session_mode`` is supported by the user's browser. + +Possible values come from `WebXR's XRSessionMode `_, including: ``"immersive-vr"``, ``"immersive-ar"``, and ``"inline"``. + +This method returns nothing, instead it emits the :ref:`session_supported` signal with the result. + +.. |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_world.rst b/classes/class_world.rst index 44539d8ef..052fda108 100644 --- a/classes/class_world.rst +++ b/classes/class_world.rst @@ -49,7 +49,7 @@ Property Descriptions | *Getter* | get_direct_space_state() | +----------+--------------------------+ -Direct access to the world's physics 3D space state. Used for querying current and potential collisions. Must only be accessed from within ``_physics_process(delta)``. +Direct access to the world's physics 3D space state. Used for querying current and potential collisions. ---- diff --git a/classes/class_world2d.rst b/classes/class_world2d.rst index 0b7dd0857..94d1fd662 100644 --- a/classes/class_world2d.rst +++ b/classes/class_world2d.rst @@ -57,7 +57,7 @@ The :ref:`RID` of this world's canvas resource. Used by the :ref:`Vis | *Getter* | get_direct_space_state() | +----------+--------------------------+ -Direct access to the world's physics 2D space state. Used for querying current and potential collisions. Must only be accessed from the main thread within ``_physics_process(delta)``. +Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to ``_physics_process(delta)`` in the main thread. ---- diff --git a/classes/class_worldenvironment.rst b/classes/class_worldenvironment.rst index 49d6516b4..8dad7abfb 100644 --- a/classes/class_worldenvironment.rst +++ b/classes/class_worldenvironment.rst @@ -27,6 +27,12 @@ Tutorials - :doc:`../tutorials/3d/environment_and_post_processing` +- `https://godotengine.org/asset-library/asset/123 `_ + +- `https://godotengine.org/asset-library/asset/110 `_ + +- `https://godotengine.org/asset-library/asset/678 `_ + Properties ----------