diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 7d16ca34a..4060982a1 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -688,11 +688,15 @@ Returns the Object that corresponds to ``instance_id``. All Objects have a uniqu - :ref:`float` **inverse_lerp** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** -Returns a normalized value considering the given range. +Returns a normalized value considering the given range. This is the opposite of :ref:`lerp`. :: - inverse_lerp(3, 5, 4) # Returns 0.5 + var middle = lerp(20, 30, 0.75) + # `middle` is now 27.5. + # Now, we pretend to have forgotten the original ratio and want to get it back. + var ratio = inverse_lerp(20, 30, 27.5) + # `ratio` is now 0.75. ---- @@ -755,7 +759,7 @@ Returns length of Variant ``var``. Length is the character count of String, elem - :ref:`Variant` **lerp** **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`float` weight **)** -Linearly interpolates between two values by a normalized value. +Linearly interpolates between two values by a normalized value. This is the opposite of :ref:`inverse_lerp`. If the ``from`` and ``to`` arguments are of type :ref:`int` or :ref:`float`, the return value is a :ref:`float`. @@ -774,7 +778,7 @@ If both are of the same vector type (:ref:`Vector2`, :ref:`Vector Linearly interpolates between two angles (in radians) by a normalized value. -Similar to :ref:`lerp` but interpolate correctly when the angles wrap around :ref:`TAU`. +Similar to :ref:`lerp`, but interpolates correctly when the angles wrap around :ref:`TAU`. :: @@ -792,7 +796,14 @@ Similar to :ref:`lerp` but interpolate correctly wh - :ref:`float` **linear2db** **(** :ref:`float` nrg **)** -Converts from linear energy to decibels (audio). +Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example: + +:: + + # "Slider" refers to a node that inherits Range such as HSlider or VSlider. + # Its range must be configured to go from 0 to 1. + # Change the bus name if you'd like to change the volume of a specific bus only. + AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear2db($Slider.value)) ---- diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 78dfa9064..969d1d569 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -46,7 +46,7 @@ Properties +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`JavaScript` | :ref:`JavaScript` | +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`Reference` | :ref:`Marshalls` | +| :ref:`Marshalls` | :ref:`Marshalls` | +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`EditorNavigationMeshGenerator` | :ref:`NavigationMeshGenerator` | +---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ @@ -2311,7 +2311,7 @@ The :ref:`JavaScript` singleton. .. _class_@GlobalScope_property_Marshalls: -- :ref:`Reference` **Marshalls** +- :ref:`Marshalls` **Marshalls** The :ref:`Marshalls` singleton. diff --git a/classes/class_animation.rst b/classes/class_animation.rst index 436b75989..704cfdeb8 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -28,7 +28,7 @@ An Animation resource contains data used to animate everything in the engine. An animation.track_insert_key(track_index, 0.0, 0) animation.track_insert_key(track_index, 0.5, 100) -Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer` or :ref:`AnimationTreePlayer` to be played back. +Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer` or :ref:`AnimationTreePlayer` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType` to see available types. Tutorials --------- @@ -174,6 +174,8 @@ Signals - **tracks_changed** **(** **)** +Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths. + Enumerations ------------ @@ -199,11 +201,11 @@ enum **TrackType**: - **TYPE_METHOD** = **2** --- Method tracks call functions with given arguments per key. -- **TYPE_BEZIER** = **3** +- **TYPE_BEZIER** = **3** --- Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a :ref:`Color`). -- **TYPE_AUDIO** = **4** +- **TYPE_AUDIO** = **4** --- Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer`. The stream can be trimmed and previewed in the animation. -- **TYPE_ANIMATION** = **5** +- **TYPE_ANIMATION** = **5** --- Animation tracks play animations in other :ref:`AnimationPlayer` nodes. ---- @@ -243,7 +245,7 @@ enum **UpdateMode**: - **UPDATE_TRIGGER** = **2** --- Update at the keyframes. -- **UPDATE_CAPTURE** = **3** +- **UPDATE_CAPTURE** = **3** --- Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds. Property Descriptions --------------------- @@ -311,108 +313,152 @@ Adds a track to the Animation. - :ref:`String` **animation_track_get_key_animation** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the animation name at the key identified by ``key_idx``. The ``track_idx`` must be the index of an Animation Track. + ---- .. _class_Animation_method_animation_track_insert_key: - :ref:`int` **animation_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`String` animation **)** +Inserts a key with value ``animation`` at the given ``time`` (in seconds). The ``track_idx`` must be the index of an Animation Track. + ---- .. _class_Animation_method_animation_track_set_key_animation: - void **animation_track_set_key_animation** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`String` animation **)** +Sets the key identified by ``key_idx`` to value ``animation``. The ``track_idx`` must be the index of an Animation Track. + ---- .. _class_Animation_method_audio_track_get_key_end_offset: - :ref:`float` **audio_track_get_key_end_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the end offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track. + +End offset is the number of seconds cut off at the ending of the audio stream. + ---- .. _class_Animation_method_audio_track_get_key_start_offset: - :ref:`float` **audio_track_get_key_start_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the start offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track. + +Start offset is the number of seconds cut off at the beginning of the audio stream. + ---- .. _class_Animation_method_audio_track_get_key_stream: - :ref:`Resource` **audio_track_get_key_stream** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track. + ---- .. _class_Animation_method_audio_track_insert_key: - :ref:`int` **audio_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Resource` stream, :ref:`float` start_offset=0, :ref:`float` end_offset=0 **)** +Inserts an Audio Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of an Audio Track. + +``stream`` is the :ref:`AudioStream` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending. + ---- .. _class_Animation_method_audio_track_set_key_end_offset: - void **audio_track_set_key_end_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** +Sets the end offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track. + ---- .. _class_Animation_method_audio_track_set_key_start_offset: - void **audio_track_set_key_start_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** +Sets the start offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track. + ---- .. _class_Animation_method_audio_track_set_key_stream: - void **audio_track_set_key_stream** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Resource` stream **)** +Sets the stream of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track. + ---- .. _class_Animation_method_bezier_track_get_key_in_handle: - :ref:`Vector2` **bezier_track_get_key_in_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_bezier_track_get_key_out_handle: - :ref:`Vector2` **bezier_track_get_key_out_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_bezier_track_get_key_value: - :ref:`float` **bezier_track_get_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +Returns the value of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_bezier_track_insert_key: - :ref:`int` **bezier_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2( 0, 0 ), :ref:`Vector2` out_handle=Vector2( 0, 0 ) **)** +Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track. + +``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point. + ---- .. _class_Animation_method_bezier_track_interpolate: - :ref:`float` **bezier_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time **)** const +Returns the interpolated value at the given ``time`` (in seconds). The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_bezier_track_set_key_in_handle: - void **bezier_track_set_key_in_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` in_handle **)** +Sets the in handle of the key identified by ``key_idx`` to value ``in_handle``. The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_bezier_track_set_key_out_handle: - void **bezier_track_set_key_out_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` out_handle **)** +Sets the out handle of the key identified by ``key_idx`` to value ``out_handle``. The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_bezier_track_set_key_value: - void **bezier_track_set_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` value **)** +Sets the value of the key identified by ``key_idx`` to the given value. The ``track_idx`` must be the index of a Bezier Track. + ---- .. _class_Animation_method_clear: diff --git a/classes/class_animationnodeblendtree.rst b/classes/class_animationnodeblendtree.rst index 0ec7bbdf4..695862e1c 100644 --- a/classes/class_animationnodeblendtree.rst +++ b/classes/class_animationnodeblendtree.rst @@ -11,7 +11,12 @@ AnimationNodeBlendTree **Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +:ref:`AnimationTree` node resource that contains many blend type nodes. +Description +----------- + +This node may contain a sub-tree of any other blend type nodes, such as mix, blend2, blend3, one shot, etc. This is one of the most commonly used roots. Tutorials --------- @@ -63,17 +68,17 @@ Constants .. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_CONNECTION_EXISTS: -- **CONNECTION_OK** = **0** +- **CONNECTION_OK** = **0** --- The connection was successful. -- **CONNECTION_ERROR_NO_INPUT** = **1** +- **CONNECTION_ERROR_NO_INPUT** = **1** --- The input node is ``null``. -- **CONNECTION_ERROR_NO_INPUT_INDEX** = **2** +- **CONNECTION_ERROR_NO_INPUT_INDEX** = **2** --- The specified input port is out of range. -- **CONNECTION_ERROR_NO_OUTPUT** = **3** +- **CONNECTION_ERROR_NO_OUTPUT** = **3** --- The output node is ``null``. -- **CONNECTION_ERROR_SAME_NODE** = **4** +- **CONNECTION_ERROR_SAME_NODE** = **4** --- Input and output nodes are the same. -- **CONNECTION_ERROR_CONNECTION_EXISTS** = **5** +- **CONNECTION_ERROR_CONNECTION_EXISTS** = **5** --- The specified connection already exists. Property Descriptions --------------------- @@ -90,6 +95,8 @@ Property Descriptions | *Getter* | get_graph_offset() | +-----------+-------------------------+ +The global offset of all sub-nodes. + Method Descriptions ------------------- @@ -97,51 +104,69 @@ Method Descriptions - void **add_node** **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** +Adds an :ref:`AnimationNode` at the given ``position``. The ``name`` is used to identify the created sub-node later. + ---- .. _class_AnimationNodeBlendTree_method_connect_node: - void **connect_node** **(** :ref:`String` input_node, :ref:`int` input_index, :ref:`String` output_node **)** +Connects the output of an :ref:`AnimationNode` as input for another :ref:`AnimationNode`, at the input port specified by ``input_index``. + ---- .. _class_AnimationNodeBlendTree_method_disconnect_node: - void **disconnect_node** **(** :ref:`String` input_node, :ref:`int` input_index **)** +Disconnects the node connected to the specified input. + ---- .. _class_AnimationNodeBlendTree_method_get_node: - :ref:`AnimationNode` **get_node** **(** :ref:`String` name **)** const +Returns the sub-node with the specified ``name``. + ---- .. _class_AnimationNodeBlendTree_method_get_node_position: - :ref:`Vector2` **get_node_position** **(** :ref:`String` name **)** const +Returns the position of the sub-node with the specified ``name``. + ---- .. _class_AnimationNodeBlendTree_method_has_node: - :ref:`bool` **has_node** **(** :ref:`String` name **)** const +Returns ``true`` if a sub-node with specified ``name`` exists. + ---- .. _class_AnimationNodeBlendTree_method_remove_node: - void **remove_node** **(** :ref:`String` name **)** +Removes a sub-node. + ---- .. _class_AnimationNodeBlendTree_method_rename_node: - void **rename_node** **(** :ref:`String` name, :ref:`String` new_name **)** +Changes the name of a sub-node. + ---- .. _class_AnimationNodeBlendTree_method_set_node_position: - void **set_node_position** **(** :ref:`String` name, :ref:`Vector2` position **)** +Modifies the position of a sub-node. + diff --git a/classes/class_animationnodeoneshot.rst b/classes/class_animationnodeoneshot.rst index ad7b1b853..be8bd9c05 100644 --- a/classes/class_animationnodeoneshot.rst +++ b/classes/class_animationnodeoneshot.rst @@ -11,7 +11,12 @@ AnimationNodeOneShot **Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Plays an animation once in :ref:`AnimationNodeBlendTree`. +Description +----------- + +A resource to add to an :ref:`AnimationNodeBlendTree`. This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters. Tutorials --------- @@ -74,6 +79,8 @@ Property Descriptions | *Getter* | has_autorestart() | +-----------+------------------------+ +If ``true``, the sub-animation will restart automatically after finishing. + ---- .. _class_AnimationNodeOneShot_property_autorestart_delay: @@ -88,6 +95,8 @@ Property Descriptions | *Getter* | get_autorestart_delay() | +-----------+------------------------------+ +The delay after which the automatic restart is triggered, in seconds. + ---- .. _class_AnimationNodeOneShot_property_autorestart_random_delay: @@ -102,6 +111,8 @@ Property Descriptions | *Getter* | get_autorestart_random_delay() | +-----------+-------------------------------------+ +If :ref:`autorestart` is ``true``, a random additional delay (in seconds) between 0 and this value will be added to :ref:`autorestart_delay`. + ---- .. _class_AnimationNodeOneShot_property_fadein_time: diff --git a/classes/class_animationnodeoutput.rst b/classes/class_animationnodeoutput.rst index 606206c12..ab5c4937d 100644 --- a/classes/class_animationnodeoutput.rst +++ b/classes/class_animationnodeoutput.rst @@ -11,7 +11,7 @@ AnimationNodeOutput **Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` - +Generic output node to be added to :ref:`AnimationNodeBlendTree`. Tutorials --------- diff --git a/classes/class_animationnodetimescale.rst b/classes/class_animationnodetimescale.rst index d818b0514..a169254cb 100644 --- a/classes/class_animationnodetimescale.rst +++ b/classes/class_animationnodetimescale.rst @@ -11,7 +11,12 @@ AnimationNodeTimeScale **Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A time-scaling animation node to be used with :ref:`AnimationTree`. +Description +----------- + +Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation. Tutorials --------- diff --git a/classes/class_animationnodetimeseek.rst b/classes/class_animationnodetimeseek.rst index dc6888746..94ed1abac 100644 --- a/classes/class_animationnodetimeseek.rst +++ b/classes/class_animationnodetimeseek.rst @@ -11,7 +11,12 @@ AnimationNodeTimeSeek **Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A time-seeking animation node to be used with :ref:`AnimationTree`. +Description +----------- + +This node can be used to cause a seek command to happen to any sub-children of the graph. After setting the time, this value returns to -1. Tutorials --------- diff --git a/classes/class_animationnodetransition.rst b/classes/class_animationnodetransition.rst index 393192a9e..4878bc86c 100644 --- a/classes/class_animationnodetransition.rst +++ b/classes/class_animationnodetransition.rst @@ -11,7 +11,12 @@ AnimationNodeTransition **Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A generic animation transition node for :ref:`AnimationTree`. +Description +----------- + +Simple state machine for cases which don't require a more advanced :ref:`AnimationNodeStateMachine`. Animations can be connected to the inputs and transition times can be specified. Tutorials --------- @@ -55,6 +60,8 @@ Property Descriptions | *Getter* | get_enabled_inputs() | +-----------+---------------------------+ +The number of available input ports for this node. + ---- .. _class_AnimationNodeTransition_property_xfade_time: @@ -69,6 +76,8 @@ Property Descriptions | *Getter* | get_cross_fade_time() | +-----------+----------------------------+ +Cross-fading time (in seconds) between each animation connected to the inputs. + Method Descriptions ------------------- diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index e9d800c11..1dda2ff9a 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -18,6 +18,8 @@ Description An animation player is used for general-purpose playback of :ref:`Animation` resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. +``AnimationPlayer`` is more suited than :ref:`Tween` for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an ``AnimationPlayer`` node thanks to the animation tools provided by the editor. That particular example can also be implemented with a :ref:`Tween` node, but it requires doing everything by code. + Updating the target properties of animations occurs at process time. Tutorials diff --git a/classes/class_animationtree.rst b/classes/class_animationtree.rst index 95ad6051c..a8c667683 100644 --- a/classes/class_animationtree.rst +++ b/classes/class_animationtree.rst @@ -11,7 +11,7 @@ AnimationTree **Inherits:** :ref:`Node` **<** :ref:`Object` - +A node to be used for advanced animation transitions in an :ref:`AnimationPlayer`. Tutorials --------- @@ -59,11 +59,11 @@ Enumerations enum **AnimationProcessMode**: -- **ANIMATION_PROCESS_PHYSICS** = **0** +- **ANIMATION_PROCESS_PHYSICS** = **0** --- The animations will progress during the physics frame (i.e. :ref:`Node._physics_process`). -- **ANIMATION_PROCESS_IDLE** = **1** +- **ANIMATION_PROCESS_IDLE** = **1** --- The animations will progress during the idle frame (i.e. :ref:`Node._process`). -- **ANIMATION_PROCESS_MANUAL** = **2** +- **ANIMATION_PROCESS_MANUAL** = **2** --- The animations will only progress manually (see :ref:`advance`). Property Descriptions --------------------- @@ -80,6 +80,8 @@ Property Descriptions | *Getter* | is_active() | +-----------+-------------------+ +If ``true``, the ``AnimationTree`` will be processing. + ---- .. _class_AnimationTree_property_anim_player: @@ -94,6 +96,8 @@ Property Descriptions | *Getter* | get_animation_player() | +-----------+-----------------------------+ +The path to the :ref:`AnimationPlayer` used for animating. + ---- .. _class_AnimationTree_property_process_mode: @@ -108,6 +112,8 @@ Property Descriptions | *Getter* | get_process_mode() | +-----------+-------------------------+ +The process mode of this ``AnimationTree``. See :ref:`AnimationProcessMode` for available modes. + ---- .. _class_AnimationTree_property_root_motion_track: @@ -134,6 +140,8 @@ Property Descriptions | *Getter* | get_tree_root() | +----------+----------------------+ +The root animation node of this ``AnimationTree``. See :ref:`AnimationNode`. + Method Descriptions ------------------- @@ -141,6 +149,8 @@ Method Descriptions - void **advance** **(** :ref:`float` delta **)** +Manually advance the animations by the specified time (in seconds). + ---- .. _class_AnimationTree_method_get_root_motion_transform: diff --git a/classes/class_array.rst b/classes/class_array.rst index 2f4a7590f..826283588 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -27,6 +27,14 @@ Generic array which can contain several elements of any type, accessible by a nu array[2] = "Three" print(array[-2]) # Three. +Arrays can be concatenated using the ``+`` operator: + +:: + + var array1 = ["One", 2] + var array2 = [3, "Four"] + print(array1 + array2) # ["One", 2, 3, "Four"] + Arrays are always passed by reference. Methods @@ -51,15 +59,15 @@ Methods +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`back` **(** **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`bsearch` **(** :ref:`Variant` value, :ref:`bool` before=True **)** | +| :ref:`int` | :ref:`bsearch` **(** :ref:`Variant` value, :ref:`bool` before=true **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`bsearch_custom` **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=True **)** | +| :ref:`int` | :ref:`bsearch_custom` **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=true **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`count` **(** :ref:`Variant` value **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`duplicate` **(** :ref:`bool` deep=False **)** | +| :ref:`Array` | :ref:`duplicate` **(** :ref:`bool` deep=false **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -101,7 +109,7 @@ Methods +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`slice` **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=False **)** | +| :ref:`Array` | :ref:`slice` **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`sort` **(** **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -173,7 +181,7 @@ Returns the last element of the array, or ``null`` if the array is empty. .. _class_Array_method_bsearch: -- :ref:`int` **bsearch** **(** :ref:`Variant` value, :ref:`bool` before=True **)** +- :ref:`int` **bsearch** **(** :ref:`Variant` value, :ref:`bool` before=true **)** Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array. @@ -183,7 +191,7 @@ Finds the index of an existing value (or the insertion index that maintains sort .. _class_Array_method_bsearch_custom: -- :ref:`int` **bsearch_custom** **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=True **)** +- :ref:`int` **bsearch_custom** **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=true **)** Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return ``true`` if the first argument is less than the second, and return ``false`` otherwise. @@ -209,7 +217,7 @@ Returns the number of times an element is in the array. .. _class_Array_method_duplicate: -- :ref:`Array` **duplicate** **(** :ref:`bool` deep=False **)** +- :ref:`Array` **duplicate** **(** :ref:`bool` deep=false **)** Returns a copy of the array. @@ -386,7 +394,7 @@ Returns the number of elements in the array. .. _class_Array_method_slice: -- :ref:`Array` **slice** **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=False **)** +- :ref:`Array` **slice** **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** Duplicates the subset described in the function and returns it in an array, deeply copying the array if ``deep`` is ``true``. Lower and upper index are inclusive, with the ``step`` describing the change between indices while slicing. @@ -398,7 +406,13 @@ Duplicates the subset described in the function and returns it in an array, deep Sorts the array. -**Note:** strings are sorted in alphabetical, not natural order. +**Note:** Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: + +:: + + var strings = ["string1", "string2", "string10", "string11"] + strings.sort() + print(strings) # Prints [string1, string10, string11, string2] ---- diff --git a/classes/class_arvrpositionaltracker.rst b/classes/class_arvrpositionaltracker.rst index 99d2cfdc3..b8dfb2434 100644 --- a/classes/class_arvrpositionaltracker.rst +++ b/classes/class_arvrpositionaltracker.rst @@ -50,6 +50,8 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_position` **(** **)** const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tracker_id` **(** **)** const | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_tracks_orientation` **(** **)** const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_tracks_position` **(** **)** const | @@ -146,6 +148,14 @@ Returns the world-space controller position. ---- +.. _class_ARVRPositionalTracker_method_get_tracker_id: + +- :ref:`int` **get_tracker_id** **(** **)** const + +Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the :ref:`ARVRController` and :ref:`ARVRAnchor` nodes. + +---- + .. _class_ARVRPositionalTracker_method_get_tracks_orientation: - :ref:`bool` **get_tracks_orientation** **(** **)** const diff --git a/classes/class_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst index ac0e0699c..366d6d231 100644 --- a/classes/class_audioeffectrecord.rst +++ b/classes/class_audioeffectrecord.rst @@ -11,7 +11,12 @@ AudioEffectRecord **Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Audio effect used for recording sound from a microphone. +Tutorials +--------- + +- :doc:`../tutorials/audio/recording_with_microphone` Properties ---------- @@ -46,6 +51,8 @@ Property Descriptions | *Getter* | get_format() | +-----------+-------------------+ +Specifies the format in which the sample will be recorded. See :ref:`Format` for available formats. + Method Descriptions ------------------- @@ -53,15 +60,21 @@ Method Descriptions - :ref:`AudioStreamSample` **get_recording** **(** **)** const +Returns the recorded sample. + ---- .. _class_AudioEffectRecord_method_is_recording_active: - :ref:`bool` **is_recording_active** **(** **)** const +Returns whether the recording is active or not. + ---- .. _class_AudioEffectRecord_method_set_recording_active: - void **set_recording_active** **(** :ref:`bool` record **)** +If ``true``, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample. + diff --git a/classes/class_bakedlightmap.rst b/classes/class_bakedlightmap.rst index 6bf246399..dd020690a 100644 --- a/classes/class_bakedlightmap.rst +++ b/classes/class_bakedlightmap.rst @@ -108,15 +108,15 @@ enum **BakeMode**: enum **BakeError**: -- **BAKE_ERROR_OK** = **0** +- **BAKE_ERROR_OK** = **0** --- Baking was successful. -- **BAKE_ERROR_NO_SAVE_PATH** = **1** +- **BAKE_ERROR_NO_SAVE_PATH** = **1** --- Returns if no viable save path is found. This can happen where an :ref:`image_path` is not specified or when the save location is invalid. -- **BAKE_ERROR_NO_MESHES** = **2** +- **BAKE_ERROR_NO_MESHES** = **2** --- Currently unused. -- **BAKE_ERROR_CANT_CREATE_IMAGE** = **3** +- **BAKE_ERROR_CANT_CREATE_IMAGE** = **3** --- Returns when the baker cannot save per-mesh textures to file. -- **BAKE_ERROR_USER_ABORTED** = **4** +- **BAKE_ERROR_USER_ABORTED** = **4** --- Returns if user cancels baking. Property Descriptions --------------------- @@ -300,7 +300,7 @@ Method Descriptions - :ref:`BakeError` **bake** **(** :ref:`Node` from_node=null, :ref:`bool` create_visual_debug=false **)** -Bakes the lightmaps within the currently edited scene. +Bakes the lightmaps within the currently edited scene. Returns a :ref:`BakeError` to signify if the bake was successful, or if unsuccessful, how the bake failed. ---- diff --git a/classes/class_basis.rst b/classes/class_basis.rst index e10cb5ce5..687988e80 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -58,7 +58,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`inverse` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Basis` b, :ref:`float` epsilon=0.00001 **)** | +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Basis` b, :ref:`float` epsilon=1e-05 **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`orthonormalized` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -216,7 +216,7 @@ Returns the inverse of the matrix. .. _class_Basis_method_is_equal_approx: -- :ref:`bool` **is_equal_approx** **(** :ref:`Basis` b, :ref:`float` epsilon=0.00001 **)** +- :ref:`bool` **is_equal_approx** **(** :ref:`Basis` b, :ref:`float` epsilon=1e-05 **)** Returns ``true`` if this basis and ``b`` are approximately equal, by calling ``is_equal_approx`` on each component. diff --git a/classes/class_checkbox.rst b/classes/class_checkbox.rst index d12e5ac0a..7bc231128 100644 --- a/classes/class_checkbox.rst +++ b/classes/class_checkbox.rst @@ -11,12 +11,12 @@ CheckBox **Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -Binary choice user interface widget. +Binary choice user interface widget. See also :ref:`CheckButton`. Description ----------- -A checkbox allows the user to make a binary choice (choosing only one of two possible options). +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 apperance. 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. Properties ---------- diff --git a/classes/class_checkbutton.rst b/classes/class_checkbutton.rst index f68bb3626..033fc5651 100644 --- a/classes/class_checkbutton.rst +++ b/classes/class_checkbutton.rst @@ -11,12 +11,12 @@ CheckButton **Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -Checkable button. +Checkable button. See also :ref:`CheckBox`. Description ----------- -CheckButton is a toggle button displayed as a check field. +CheckButton is a toggle button displayed as a check field. It's similar to :ref:`CheckBox` in functionality, but it has a different apperance. 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. Properties ---------- diff --git a/classes/class_collisionpolygon2d.rst b/classes/class_collisionpolygon2d.rst index 91dae95a8..802069b6f 100644 --- a/classes/class_collisionpolygon2d.rst +++ b/classes/class_collisionpolygon2d.rst @@ -111,6 +111,8 @@ If ``true``, only edges that face up, relative to ``CollisionPolygon2D``'s rotat | *Getter* | get_one_way_collision_margin() | +-----------+-------------------------------------+ +The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity. + ---- .. _class_CollisionPolygon2D_property_polygon: diff --git a/classes/class_collisionshape2d.rst b/classes/class_collisionshape2d.rst index a6436f0b5..0b6cc1530 100644 --- a/classes/class_collisionshape2d.rst +++ b/classes/class_collisionshape2d.rst @@ -83,7 +83,7 @@ Sets whether this collision shape should only detect collision on one side (top | *Getter* | get_one_way_collision_margin() | +-----------+-------------------------------------+ -The margin used for one-way collision (in pixels). +The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. ---- diff --git a/classes/class_color.rst b/classes/class_color.rst index 50a96fc8d..0eaef9709 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -48,47 +48,47 @@ Properties Methods ------- -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`Color` **(** :ref:`String` from **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`Color` **(** :ref:`int` from **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`blend` **(** :ref:`Color` over **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`contrasted` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`darkened` **(** :ref:`float` amount **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`from_hsv` **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` a=1 **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`gray` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`inverted` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Color` color **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`lightened` **(** :ref:`float` amount **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`linear_interpolate` **(** :ref:`Color` b, :ref:`float` t **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_abgr32` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_abgr64` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_argb32` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_argb64` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_html` **(** :ref:`bool` with_alpha=True **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_rgba32` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_rgba64` **(** **)** | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`String` from **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`int` from **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`blend` **(** :ref:`Color` over **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`contrasted` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`darkened` **(** :ref:`float` amount **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`from_hsv` **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` a=1.0 **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gray` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`inverted` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Color` color **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`lightened` **(** :ref:`float` amount **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`linear_interpolate` **(** :ref:`Color` b, :ref:`float` t **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_abgr32` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_abgr64` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_argb32` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_argb64` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_html` **(** :ref:`bool` with_alpha=true **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_rgba32` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_rgba64` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- @@ -901,7 +901,7 @@ Returns a new color resulting from making this color darker by the specified per .. _class_Color_method_from_hsv: -- :ref:`Color` **from_hsv** **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` a=1 **)** +- :ref:`Color` **from_hsv** **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` a=1.0 **)** Constructs a color from an HSV profile. ``h``, ``s``, and ``v`` are values between 0 and 1. @@ -1028,7 +1028,7 @@ Returns the color's 64-bit integer in ARGB format (each word represents a compon .. _class_Color_method_to_html: -- :ref:`String` **to_html** **(** :ref:`bool` with_alpha=True **)** +- :ref:`String` **to_html** **(** :ref:`bool` with_alpha=true **)** Returns the color's HTML hexadecimal color string in ARGB format (ex: ``ff34f822``). diff --git a/classes/class_concavepolygonshape.rst b/classes/class_concavepolygonshape.rst index 2f629ecd0..87a153001 100644 --- a/classes/class_concavepolygonshape.rst +++ b/classes/class_concavepolygonshape.rst @@ -18,6 +18,8 @@ Description Concave polygon shape resource, which can be set into a :ref:`PhysicsBody` or area. This shape is created by feeding a list of triangles. +Note: when used for collision, ``ConcavePolygonShape`` is intended to work with static :ref:`PhysicsBody` nodes like :ref:`StaticBody` and will not work with :ref:`KinematicBody` or :ref:`RigidBody` with a mode other than Static. + Methods ------- diff --git a/classes/class_configfile.rst b/classes/class_configfile.rst index b41145913..5787da75a 100644 --- a/classes/class_configfile.rst +++ b/classes/class_configfile.rst @@ -68,13 +68,15 @@ Methods +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`load_encrypted` **(** :ref:`String` path, :ref:`PoolByteArray` key **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load_encrypted_pass` **(** :ref:`String` path, :ref:`String` pass **)** | +| :ref:`Error` | :ref:`load_encrypted_pass` **(** :ref:`String` path, :ref:`String` password **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`parse` **(** :ref:`String` data **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`save` **(** :ref:`String` path **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`save_encrypted` **(** :ref:`String` path, :ref:`PoolByteArray` key **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_encrypted_pass` **(** :ref:`String` path, :ref:`String` pass **)** | +| :ref:`Error` | :ref:`save_encrypted_pass` **(** :ref:`String` path, :ref:`String` password **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_value` **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` value **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -86,7 +88,7 @@ Method Descriptions - void **erase_section** **(** :ref:`String` section **)** -Deletes the specified section along with all the key-value pairs inside. +Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. ---- @@ -94,13 +96,15 @@ Deletes the specified section along with all the key-value pairs inside. - void **erase_section_key** **(** :ref:`String` section, :ref:`String` key **)** +Deletes the specified key in a section. Raises an error if either the section or the key do not exist. + ---- .. _class_ConfigFile_method_get_section_keys: - :ref:`PoolStringArray` **get_section_keys** **(** :ref:`String` section **)** const -Returns an array of all defined key identifiers in the specified section. +Returns an array of all defined key identifiers in the specified section. Raises an error and returns an empty array if the section does not exist. ---- @@ -116,7 +120,7 @@ Returns an array of all defined section identifiers. - :ref:`Variant` **get_value** **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` default=null **)** const -Returns the current value for the specified section and key. If the section and/or the key do not exist, the method returns the value of the optional ``default`` argument, or ``null`` if it is omitted. +Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback ``default`` value. If ``default`` is not specified or set to ``null``, an error is also raised. ---- @@ -140,7 +144,7 @@ Returns ``true`` if the specified section-key pair exists. - :ref:`Error` **load** **(** :ref:`String` path **)** -Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. +Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. Returns one of the :ref:`Error` code constants (``OK`` on success). @@ -150,11 +154,29 @@ Returns one of the :ref:`Error` code constants (``OK`` - :ref:`Error` **load_encrypted** **(** :ref:`String` path, :ref:`PoolByteArray` key **)** +Loads the encrypted config file specified as a parameter, using the provided ``key`` to decrypt it. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + ---- .. _class_ConfigFile_method_load_encrypted_pass: -- :ref:`Error` **load_encrypted_pass** **(** :ref:`String` path, :ref:`String` pass **)** +- :ref:`Error` **load_encrypted_pass** **(** :ref:`String` path, :ref:`String` password **)** + +Loads the encrypted config file specified as a parameter, using the provided ``password`` to decrypt it. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_parse: + +- :ref:`Error` **parse** **(** :ref:`String` data **)** + +Parses the the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). ---- @@ -162,7 +184,7 @@ Returns one of the :ref:`Error` code constants (``OK`` - :ref:`Error` **save** **(** :ref:`String` path **)** -Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. +Saves the contents of the ``ConfigFile`` object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the :ref:`Error` code constants (``OK`` on success). @@ -172,11 +194,19 @@ Returns one of the :ref:`Error` code constants (``OK`` - :ref:`Error` **save_encrypted** **(** :ref:`String` path, :ref:`PoolByteArray` key **)** +Saves the contents of the ``ConfigFile`` object to the AES-256 encrypted file specified as a parameter, using the provided ``key`` to encrypt it. The output file uses an INI-style structure. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + ---- .. _class_ConfigFile_method_save_encrypted_pass: -- :ref:`Error` **save_encrypted_pass** **(** :ref:`String` path, :ref:`String` pass **)** +- :ref:`Error` **save_encrypted_pass** **(** :ref:`String` path, :ref:`String` password **)** + +Saves the contents of the ``ConfigFile`` object to the AES-256 encrypted file specified as a parameter, using the provided ``password`` to encrypt it. The output file uses an INI-style structure. + +Returns one of the :ref:`Error` code constants (``OK`` on success). ---- @@ -184,5 +214,5 @@ Returns one of the :ref:`Error` code constants (``OK`` - void **set_value** **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` value **)** -Assigns a value to the specified key of the specified section. If the section and/or the key do not exist, they are created. Passing a ``null`` value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. +Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a ``null`` value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index aa4bc7104..a4dceef47 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -98,13 +98,13 @@ Methods +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`duplicate` **(** :ref:`bool` deep=False **)** | +| :ref:`Dictionary` | :ref:`duplicate` **(** :ref:`bool` deep=false **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`erase` **(** :ref:`Variant` key **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`get` **(** :ref:`Variant` key, :ref:`Variant` default=Null **)** | +| :ref:`Variant` | :ref:`get` **(** :ref:`Variant` key, :ref:`Variant` default=null **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has` **(** :ref:`Variant` key **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ @@ -132,7 +132,7 @@ Clear the dictionary, removing all key/value pairs. .. _class_Dictionary_method_duplicate: -- :ref:`Dictionary` **duplicate** **(** :ref:`bool` deep=False **)** +- :ref:`Dictionary` **duplicate** **(** :ref:`bool` deep=false **)** Creates a copy of the dictionary, and returns it. @@ -156,7 +156,7 @@ Erase a dictionary key/value pair by key. Returns ``true`` if the given key was .. _class_Dictionary_method_get: -- :ref:`Variant` **get** **(** :ref:`Variant` key, :ref:`Variant` default=Null **)** +- :ref:`Variant` **get** **(** :ref:`Variant` key, :ref:`Variant` default=null **)** Returns the current value for the specified key in the ``Dictionary``. If the key does not exist, the method returns the value of the optional default argument, or ``null`` if it is omitted. diff --git a/classes/class_editorexportplugin.rst b/classes/class_editorexportplugin.rst index 5dd8528b6..ca9431b35 100644 --- a/classes/class_editorexportplugin.rst +++ b/classes/class_editorexportplugin.rst @@ -11,7 +11,7 @@ EditorExportPlugin **Inherits:** :ref:`Reference` **<** :ref:`Object` - +A script that is executed when exporting projects. Methods ------- @@ -47,12 +47,16 @@ 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. + ---- .. _class_EditorExportPlugin_method__export_end: - void **_export_end** **(** **)** virtual +Virtual method to be overridden by the user. Called when the export is finished. + ---- .. _class_EditorExportPlugin_method__export_file: diff --git a/classes/class_editorfiledialog.rst b/classes/class_editorfiledialog.rst index a2fddb4d7..242393520 100644 --- a/classes/class_editorfiledialog.rst +++ b/classes/class_editorfiledialog.rst @@ -11,7 +11,7 @@ EditorFileDialog **Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` - +A modified version of :ref:`FileDialog` used by the editor. Properties ---------- diff --git a/classes/class_editorfilesystem.rst b/classes/class_editorfilesystem.rst index e08ce3e5e..24c84893e 100644 --- a/classes/class_editorfilesystem.rst +++ b/classes/class_editorfilesystem.rst @@ -143,3 +143,5 @@ Update a file information. Call this if an external program (not Godot) modified - void **update_script_classes** **(** **)** +Scans the script files and updates the list of custom class names. + diff --git a/classes/class_editorinspector.rst b/classes/class_editorinspector.rst index 1d339d1e7..aa606f170 100644 --- a/classes/class_editorinspector.rst +++ b/classes/class_editorinspector.rst @@ -11,7 +11,12 @@ EditorInspector **Inherits:** :ref:`ScrollContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` +A tab used to edit properties of the selected node. +Description +----------- + +The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as Sprite2D then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. Properties ---------- diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst index 5dbdc1c4f..9090c731c 100644 --- a/classes/class_editorplugin.rst +++ b/classes/class_editorplugin.rst @@ -75,7 +75,7 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`EditorInterface` | :ref:`get_editor_interface` **(** **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Object` | :ref:`get_plugin_icon` **(** **)** virtual | +| :ref:`Texture` | :ref:`get_plugin_icon` **(** **)** virtual | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_plugin_name` **(** **)** virtual | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -495,7 +495,21 @@ Returns the :ref:`EditorInterface` object that gives you .. _class_EditorPlugin_method_get_plugin_icon: -- :ref:`Object` **get_plugin_icon** **(** **)** virtual +- :ref:`Texture` **get_plugin_icon** **(** **)** virtual + +Override this method in your plugin to return a :ref:`Texture` in order to give it an icon. + +For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. + +Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size. + +:: + + func get_plugin_icon(): + # You can use a custom icon: + return preload("res://addons/my_plugin/my_plugin_icon.svg") + # Or use a built-in icon: + return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") ---- @@ -503,6 +517,10 @@ Returns the :ref:`EditorInterface` object that gives you - :ref:`String` **get_plugin_name** **(** **)** virtual +Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor. + +For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. + ---- .. _class_EditorPlugin_method_get_script_create_dialog: diff --git a/classes/class_editorsceneimporterassimp.rst b/classes/class_editorsceneimporterassimp.rst index 95db30a64..71b10669b 100644 --- a/classes/class_editorsceneimporterassimp.rst +++ b/classes/class_editorsceneimporterassimp.rst @@ -11,12 +11,12 @@ EditorSceneImporterAssimp **Inherits:** :ref:`EditorSceneImporter` **<** :ref:`Reference` **<** :ref:`Object` -Multi-format 3D asset importer based on `Assimp `_. +FBX 3D asset importer based on `Assimp `_. Description ----------- -This is a multi-format 3D asset importer based on `Assimp `_. See `this page `_ for a full list of supported formats. +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. If exporting a FBX scene from Autodesk Maya, use these FBX export settings: diff --git a/classes/class_engine.rst b/classes/class_engine.rst index 4e70397bd..c872fc62c 100644 --- a/classes/class_engine.rst +++ b/classes/class_engine.rst @@ -99,7 +99,7 @@ If ``true``, it is running inside the editor. Useful for tool scripts. | *Getter* | get_iterations_per_second() | +-----------+----------------------------------+ -The number of fixed iterations per second (for fixed process and physics). +The number of fixed iterations per second. This controls how often physics simulation and :ref:`Node._physics_process` methods are run. This value should generally always be set to ``60`` or above, as Godot doesn't interpolate the physics step. As a result, values lower than ``60`` will look stuttery. This value can be increased to make input more reactive or work around tunneling issues, but keep in mind doing so will increase CPU usage. ---- @@ -115,7 +115,7 @@ The number of fixed iterations per second (for fixed process and physics). | *Getter* | get_physics_jitter_fix() | +-----------+-------------------------------+ -Controls how much physic ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows to smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. +Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows to smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. ---- diff --git a/classes/class_font.rst b/classes/class_font.rst index e1e9c80ce..32ec39ec9 100644 --- a/classes/class_font.rst +++ b/classes/class_font.rst @@ -100,6 +100,8 @@ Returns the size of a string, taking kerning and advance into account. - :ref:`Vector2` **get_wordwrap_string_size** **(** :ref:`String` string, :ref:`float` width **)** const +Returns the size that the string would have with word wrapping enabled with a fixed ``width``. + ---- .. _class_Font_method_has_outline: diff --git a/classes/class_hingejoint.rst b/classes/class_hingejoint.rst index 9c0791f06..e29d1b97c 100644 --- a/classes/class_hingejoint.rst +++ b/classes/class_hingejoint.rst @@ -275,21 +275,29 @@ Method Descriptions - :ref:`bool` **get_flag** **(** :ref:`Flag` flag **)** const +Returns the value of the specified flag. + ---- .. _class_HingeJoint_method_get_param: - :ref:`float` **get_param** **(** :ref:`Param` param **)** const +Returns the value of the specified parameter. + ---- .. _class_HingeJoint_method_set_flag: - void **set_flag** **(** :ref:`Flag` flag, :ref:`bool` enabled **)** +If ``true``, enables the specified flag. + ---- .. _class_HingeJoint_method_set_param: - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** +Sets the value of the specified parameter. + diff --git a/classes/class_inputeventgesture.rst b/classes/class_inputeventgesture.rst index 0b2142356..c54267cf5 100644 --- a/classes/class_inputeventgesture.rst +++ b/classes/class_inputeventgesture.rst @@ -13,7 +13,7 @@ InputEventGesture **Inherited By:** :ref:`InputEventMagnifyGesture`, :ref:`InputEventPanGesture` - +Base class for touch control gestures. Properties ---------- @@ -37,3 +37,5 @@ Property Descriptions | *Getter* | get_position() | +-----------+---------------------+ +The local gesture position relative to the :ref:`Viewport`. If used in :ref:`Control._gui_input`, the position is relative to the current :ref:`Control` that received this gesture. + diff --git a/classes/class_kinematicbody.rst b/classes/class_kinematicbody.rst index 841d0069a..adfef9aa8 100644 --- a/classes/class_kinematicbody.rst +++ b/classes/class_kinematicbody.rst @@ -219,7 +219,9 @@ If ``test_only`` is ``true``, the body does not move but the would-be collision 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. -``linear_velocity`` is the velocity vector (typically meters per second). Unlike in :ref:`move_and_collide`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity. +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. + +``linear_velocity`` is the velocity vector (typically meters per second). Unlike in :ref:`move_and_collide`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity. ``up_direction`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector3(0, 0, 0)``, everything is considered a wall. diff --git a/classes/class_kinematicbody2d.rst b/classes/class_kinematicbody2d.rst index 06cef4cb6..84194dbc1 100644 --- a/classes/class_kinematicbody2d.rst +++ b/classes/class_kinematicbody2d.rst @@ -181,7 +181,9 @@ If ``test_only`` is ``true``, the body does not move but the would-be collision 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. -``linear_velocity`` is the velocity vector in pixels per second. Unlike in :ref:`move_and_collide`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity. +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. + +``linear_velocity`` is the velocity vector in pixels per second. Unlike in :ref:`move_and_collide`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity. ``up_direction`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector2(0, 0)``, everything is considered a wall. This is useful for topdown games. diff --git a/classes/class_linkbutton.rst b/classes/class_linkbutton.rst index 708b54109..df8bce6d4 100644 --- a/classes/class_linkbutton.rst +++ b/classes/class_linkbutton.rst @@ -84,6 +84,8 @@ Property Descriptions | *Getter* | get_text() | +-----------+-----------------+ +The button's text that will be displayed inside the button's area. + ---- .. _class_LinkButton_property_underline: @@ -98,3 +100,5 @@ Property Descriptions | *Getter* | get_underline_mode() | +-----------+---------------------------+ +Determines when to show the underline. See :ref:`UnderlineMode` for options. + diff --git a/classes/class_marshalls.rst b/classes/class_marshalls.rst index 76a0d73ac..ad50eec8a 100644 --- a/classes/class_marshalls.rst +++ b/classes/class_marshalls.rst @@ -9,7 +9,7 @@ Marshalls ========= -**Inherits:** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Object` Data transformation (marshalling) and encoding helpers. diff --git a/classes/class_meshlibrary.rst b/classes/class_meshlibrary.rst index 16b138923..c40c17867 100644 --- a/classes/class_meshlibrary.rst +++ b/classes/class_meshlibrary.rst @@ -132,9 +132,7 @@ Returns the transform applied to the item's navigation mesh. - :ref:`Texture` **get_item_preview** **(** :ref:`int` id **)** const -Returns a generated item preview (a 3D rendering in isometric perspective). - -**Note:** Since item previews are only generated in an editor context, this function will return an empty :ref:`Texture` in a running project. +When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using :ref:`set_item_preview`. Returns an empty :ref:`Texture` if no preview was manually set in a running project. ---- diff --git a/classes/class_node.rst b/classes/class_node.rst index b02f70f08..a284e6912 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -904,7 +904,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.target_fps`. +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`. ---- @@ -1296,7 +1296,7 @@ Sets the node's network master to the peer with the given peer ID. The network m - void **set_physics_process** **(** :ref:`bool` enable **)** -Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PHYSICS_PROCESS` at a fixed (usually 60 FPS, see :ref:`Engine.target_fps` to change) interval (and the :ref:`_physics_process` callback will be called if exists). Enabled automatically if :ref:`_physics_process` is overridden. Any calls to this before :ref:`_ready` will be ignored. +Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PHYSICS_PROCESS` at a fixed (usually 60 FPS, see :ref:`Engine.iterations_per_second` to change) interval (and the :ref:`_physics_process` callback will be called if exists). Enabled automatically if :ref:`_physics_process` is overridden. Any calls to this before :ref:`_ready` will be ignored. ---- diff --git a/classes/class_object.rst b/classes/class_object.rst index 99cc8806c..15e6eff8f 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -9,7 +9,7 @@ Object ====== -**Inherited By:** :ref:`ARVRPositionalTracker`, :ref:`ARVRServer`, :ref:`AudioServer`, :ref:`CameraServer`, :ref:`ClassDB`, :ref:`EditorFileSystemDirectory`, :ref:`EditorNavigationMeshGenerator`, :ref:`EditorSelection`, :ref:`EditorVCSInterface`, :ref:`Engine`, :ref:`Geometry`, :ref:`GodotSharp`, :ref:`IP`, :ref:`Input`, :ref:`InputMap`, :ref:`JSON`, :ref:`JSONRPC`, :ref:`JavaClassWrapper`, :ref:`JavaScript`, :ref:`MainLoop`, :ref:`Node`, :ref:`OS`, :ref:`Performance`, :ref:`Physics2DDirectBodyState`, :ref:`Physics2DDirectSpaceState`, :ref:`Physics2DServer`, :ref:`PhysicsDirectBodyState`, :ref:`PhysicsDirectSpaceState`, :ref:`PhysicsServer`, :ref:`ProjectSettings`, :ref:`Reference`, :ref:`ResourceLoader`, :ref:`ResourceSaver`, :ref:`TranslationServer`, :ref:`TreeItem`, :ref:`UndoRedo`, :ref:`VisualScriptEditor`, :ref:`VisualServer` +**Inherited By:** :ref:`ARVRPositionalTracker`, :ref:`ARVRServer`, :ref:`AudioServer`, :ref:`CameraServer`, :ref:`ClassDB`, :ref:`EditorFileSystemDirectory`, :ref:`EditorNavigationMeshGenerator`, :ref:`EditorSelection`, :ref:`EditorVCSInterface`, :ref:`Engine`, :ref:`Geometry`, :ref:`GodotSharp`, :ref:`IP`, :ref:`Input`, :ref:`InputMap`, :ref:`JSON`, :ref:`JSONRPC`, :ref:`JavaClassWrapper`, :ref:`JavaScript`, :ref:`MainLoop`, :ref:`Marshalls`, :ref:`Node`, :ref:`OS`, :ref:`Performance`, :ref:`Physics2DDirectBodyState`, :ref:`Physics2DDirectSpaceState`, :ref:`Physics2DServer`, :ref:`PhysicsDirectBodyState`, :ref:`PhysicsDirectSpaceState`, :ref:`PhysicsServer`, :ref:`ProjectSettings`, :ref:`Reference`, :ref:`ResourceLoader`, :ref:`ResourceSaver`, :ref:`TranslationServer`, :ref:`TreeItem`, :ref:`UndoRedo`, :ref:`VisualScriptEditor`, :ref:`VisualServer` Base class for all non built-in types. diff --git a/classes/class_opensimplexnoise.rst b/classes/class_opensimplexnoise.rst index 4b1a879ac..9d61b4078 100644 --- a/classes/class_opensimplexnoise.rst +++ b/classes/class_opensimplexnoise.rst @@ -101,7 +101,9 @@ Difference in period between :ref:`octaves Project Settings > Display > Window > Per-pixel transparency > Allowed** setting is disabled. -**Note:** This property is implemented on Linux, macOS and Windows. +**Note:** This property is implemented on HTML5, Linux, macOS and Windows. ---- diff --git a/classes/class_packeddatacontainerref.rst b/classes/class_packeddatacontainerref.rst index 08be38c2e..e8c57a892 100644 --- a/classes/class_packeddatacontainerref.rst +++ b/classes/class_packeddatacontainerref.rst @@ -11,7 +11,7 @@ PackedDataContainerRef **Inherits:** :ref:`Reference` **<** :ref:`Object` - +Reference version of :ref:`PackedDataContainer`. Methods ------- diff --git a/classes/class_panoramasky.rst b/classes/class_panoramasky.rst index 474c736e3..d85fff1bb 100644 --- a/classes/class_panoramasky.rst +++ b/classes/class_panoramasky.rst @@ -18,6 +18,10 @@ Description A resource referenced in an :ref:`Environment` that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. +Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR (``.hdr``) and OpenEXR (``.exr``) image formats for this purpose. + +You can use `this tool `_ to convert a cube map to an equirectangular sky map. + Properties ---------- diff --git a/classes/class_pinjoint.rst b/classes/class_pinjoint.rst index 28c7fa1c0..fa9010b4f 100644 --- a/classes/class_pinjoint.rst +++ b/classes/class_pinjoint.rst @@ -113,9 +113,13 @@ Method Descriptions - :ref:`float` **get_param** **(** :ref:`Param` param **)** const +Returns the value of the specified parameter. + ---- .. _class_PinJoint_method_set_param: - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** +Sets the value of the specified parameter. + diff --git a/classes/class_plane.rst b/classes/class_plane.rst index b80d1c1dd..c7016a5bb 100644 --- a/classes/class_plane.rst +++ b/classes/class_plane.rst @@ -52,7 +52,7 @@ Methods +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_any_point` **(** **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point, :ref:`float` epsilon=0.00001 **)** | +| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point, :ref:`float` epsilon=1e-05 **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`intersect_3` **(** :ref:`Plane` b, :ref:`Plane` c **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -194,7 +194,7 @@ Returns a point on the plane. .. _class_Plane_method_has_point: -- :ref:`bool` **has_point** **(** :ref:`Vector3` point, :ref:`float` epsilon=0.00001 **)** +- :ref:`bool` **has_point** **(** :ref:`Vector3` point, :ref:`float` epsilon=1e-05 **)** Returns ``true`` if ``point`` is inside the plane (by a very minimum ``epsilon`` threshold). diff --git a/classes/class_polygon2d.rst b/classes/class_polygon2d.rst index 084c0c756..1c38c8324 100644 --- a/classes/class_polygon2d.rst +++ b/classes/class_polygon2d.rst @@ -346,45 +346,61 @@ Method Descriptions - void **add_bone** **(** :ref:`NodePath` path, :ref:`PoolRealArray` weights **)** +Adds a bone with the specified ``path`` and ``weights``. + ---- .. _class_Polygon2D_method_clear_bones: - void **clear_bones** **(** **)** +Removes all bones from this ``Polygon2D``. + ---- .. _class_Polygon2D_method_erase_bone: - void **erase_bone** **(** :ref:`int` index **)** +Removes the specified bone from this ``Polygon2D``. + ---- .. _class_Polygon2D_method_get_bone_count: - :ref:`int` **get_bone_count** **(** **)** const +Returns the number of bones in this ``Polygon2D``. + ---- .. _class_Polygon2D_method_get_bone_path: - :ref:`NodePath` **get_bone_path** **(** :ref:`int` index **)** const +Returns the path to the node associated with the specified bone. + ---- .. _class_Polygon2D_method_get_bone_weights: - :ref:`PoolRealArray` **get_bone_weights** **(** :ref:`int` index **)** const +Returns the height values of the specified bone. + ---- .. _class_Polygon2D_method_set_bone_path: - void **set_bone_path** **(** :ref:`int` index, :ref:`NodePath` path **)** +Sets the path to the node associated with the specified bone. + ---- .. _class_Polygon2D_method_set_bone_weights: - void **set_bone_weights** **(** :ref:`int` index, :ref:`PoolRealArray` weights **)** +Sets the weight values for the specified bone. + diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index ebf448f96..acfa0e4c2 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -3639,7 +3639,9 @@ Enables :ref:`Viewport.physics_object_picking` methods are run. + +**Note:** This property is only read when the project starts. To change the physics FPS at runtime, set :ref:`Engine.iterations_per_second` instead. ---- @@ -3653,6 +3655,8 @@ Frames per second used in the physics. Physics always needs a fixed amount of fr Fix to improve physics jitter, specially on monitors where refresh rate is different than the physics FPS. +**Note:** This property is only read when the project starts. To change the physics FPS at runtime, set :ref:`Engine.physics_jitter_fix` instead. + ---- .. _class_ProjectSettings_property_rendering/environment/default_clear_color: diff --git a/classes/class_rect2.rst b/classes/class_rect2.rst index 4745ad906..7ac65e0cc 100644 --- a/classes/class_rect2.rst +++ b/classes/class_rect2.rst @@ -60,7 +60,7 @@ Methods +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_point` **(** :ref:`Vector2` point **)** | +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`intersects` **(** :ref:`Rect2` b **)** | +| :ref:`bool` | :ref:`intersects` **(** :ref:`Rect2` b, :ref:`bool` include_borders=false **)** | +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Rect2` rect **)** | +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -203,9 +203,11 @@ Returns ``true`` if the ``Rect2`` contains a point. .. _class_Rect2_method_intersects: -- :ref:`bool` **intersects** **(** :ref:`Rect2` b **)** +- :ref:`bool` **intersects** **(** :ref:`Rect2` b, :ref:`bool` include_borders=false **)** -Returns ``true`` if the ``Rect2`` overlaps with another. +Returns ``true`` if the ``Rect2`` overlaps with ``b`` (i.e. they have at least one point in common). + +If ``include_borders`` is ``true``, they will also be considered overlapping if their borders touch, even without intersection. ---- diff --git a/classes/class_reference.rst b/classes/class_reference.rst index 3cb0b5dd0..fe9f44b66 100644 --- a/classes/class_reference.rst +++ b/classes/class_reference.rst @@ -11,7 +11,7 @@ Reference **Inherits:** :ref:`Object` -**Inherited By:** :ref:`ARVRInterface`, :ref:`AStar`, :ref:`AStar2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`Directory`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScript`, :ref:`EncodedObjectAsID`, :ref:`Expression`, :ref:`File`, :ref:`FuncRef`, :ref:`GDNative`, :ref:`GDScriptFunctionState`, :ref:`GDScriptNativeClass`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`JSONParseResult`, :ref:`JavaClass`, :ref:`KinematicCollision`, :ref:`KinematicCollision2D`, :ref:`Marshalls`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`Physics2DShapeQueryParameters`, :ref:`Physics2DShapeQueryResult`, :ref:`Physics2DTestMotionResult`, :ref:`PhysicsShapeQueryParameters`, :ref:`PhysicsShapeQueryResult`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`ResourceInteractiveLoader`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`SpatialGizmo`, :ref:`SpatialVelocityTracker`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCP_Server`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`VisualScriptFunctionState`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser` +**Inherited By:** :ref:`ARVRInterface`, :ref:`AStar`, :ref:`AStar2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`Directory`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScript`, :ref:`EncodedObjectAsID`, :ref:`Expression`, :ref:`File`, :ref:`FuncRef`, :ref:`GDNative`, :ref:`GDScriptFunctionState`, :ref:`GDScriptNativeClass`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`JSONParseResult`, :ref:`JavaClass`, :ref:`KinematicCollision`, :ref:`KinematicCollision2D`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`Physics2DShapeQueryParameters`, :ref:`Physics2DShapeQueryResult`, :ref:`Physics2DTestMotionResult`, :ref:`PhysicsShapeQueryParameters`, :ref:`PhysicsShapeQueryResult`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`ResourceInteractiveLoader`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`SpatialGizmo`, :ref:`SpatialVelocityTracker`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCP_Server`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`VisualScriptFunctionState`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser` Base class for reference-counted objects. diff --git a/classes/class_regex.rst b/classes/class_regex.rst index e9ce7cb77..1aa64faf3 100644 --- a/classes/class_regex.rst +++ b/classes/class_regex.rst @@ -25,7 +25,7 @@ To begin, the RegEx object needs to be compiled with the search pattern using :r var regex = RegEx.new() regex.compile("\\w-(\\d+)") -The search pattern must be escaped first for gdscript before it is escaped for the expression. For example, ``compile("\\d+")`` would be read by RegEx as ``\d+``. Similarly, ``compile("\"(?:\\\\.|[^\"])*\"")`` would be read as ``"(?:\\.|[^"])*"``. +The search pattern must be escaped first for GDScript before it is escaped for the expression. For example, ``compile("\\d+")`` would be read by RegEx as ``\d+``. Similarly, ``compile("\"(?:\\\\.|[^\"])*\"")`` would be read as ``"(?:\\.|[^"])*"``. Using :ref:`search` you can find the pattern within the given text. If a pattern is found, :ref:`RegExMatch` is returned and you can retrieve details of the results using functions such as :ref:`RegExMatch.get_string` and :ref:`RegExMatch.get_start`. @@ -58,6 +58,10 @@ If you need to process multiple results, :ref:`search_all`_ library. You can view the full pattern reference `here `_. + +**Tip:** You can use `Regexr `_ to test regular expressions online. + Methods ------- diff --git a/classes/class_script.rst b/classes/class_script.rst index 504331f04..76cbbc2ea 100644 --- a/classes/class_script.rst +++ b/classes/class_script.rst @@ -111,30 +111,40 @@ Returns the script's base type. - :ref:`Variant` **get_property_default_value** **(** :ref:`String` property **)** +Returns the default value of the specified property. + ---- .. _class_Script_method_get_script_constant_map: - :ref:`Dictionary` **get_script_constant_map** **(** **)** +Returns a dictionary containing constant names and their values. + ---- .. _class_Script_method_get_script_method_list: - :ref:`Array` **get_script_method_list** **(** **)** +Returns the list of methods in this ``Script``. + ---- .. _class_Script_method_get_script_property_list: - :ref:`Array` **get_script_property_list** **(** **)** +Returns the list of properties in this ``Script``. + ---- .. _class_Script_method_get_script_signal_list: - :ref:`Array` **get_script_signal_list** **(** **)** +Returns the list of user signals defined in this ``Script``. + ---- .. _class_Script_method_has_script_signal: diff --git a/classes/class_scripteditor.rst b/classes/class_scripteditor.rst index 238f85f50..82942e818 100644 --- a/classes/class_scripteditor.rst +++ b/classes/class_scripteditor.rst @@ -11,7 +11,7 @@ ScriptEditor **Inherits:** :ref:`PanelContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` - +Godot editor's script editor. Methods ------- diff --git a/classes/class_skeleton2d.rst b/classes/class_skeleton2d.rst index 7cc5958af..413ead89d 100644 --- a/classes/class_skeleton2d.rst +++ b/classes/class_skeleton2d.rst @@ -13,6 +13,11 @@ Skeleton2D Skeleton for 2D characters and animated objects. +Description +----------- + +Skeleton2D parents a hierarchy of :ref:`Bone2D` objects. It is a requirement of :ref:`Bone2D`. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones. + Tutorials --------- @@ -43,13 +48,15 @@ Method Descriptions - :ref:`Bone2D` **get_bone** **(** :ref:`int` idx **)** +Returns a :ref:`Bone2D` from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter ``idx``. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling. + ---- .. _class_Skeleton2D_method_get_bone_count: - :ref:`int` **get_bone_count** **(** **)** const -Returns the amount of bones in the skeleton. +Returns the number of :ref:`Bone2D` nodes in the node hierarchy parented by Skeleton2D. ---- @@ -57,3 +64,5 @@ Returns the amount of bones in the skeleton. - :ref:`RID` **get_skeleton** **(** **)** const +Returns the :ref:`RID` of a Skeleton2D instance. + diff --git a/classes/class_skin.rst b/classes/class_skin.rst index 1bf489b4b..8e0e47134 100644 --- a/classes/class_skin.rst +++ b/classes/class_skin.rst @@ -25,12 +25,16 @@ Methods +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_bind_count` **(** **)** const | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_bind_name` **(** :ref:`int` bind_index **)** const | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`get_bind_pose` **(** :ref:`int` bind_index **)** const | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_bind_bone` **(** :ref:`int` bind_index, :ref:`int` bone **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_bind_count` **(** :ref:`int` bind_count **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bind_name` **(** :ref:`int` bind_index, :ref:`String` name **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_bind_pose` **(** :ref:`int` bind_index, :ref:`Transform` pose **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ @@ -61,6 +65,12 @@ Method Descriptions ---- +.. _class_Skin_method_get_bind_name: + +- :ref:`String` **get_bind_name** **(** :ref:`int` bind_index **)** const + +---- + .. _class_Skin_method_get_bind_pose: - :ref:`Transform` **get_bind_pose** **(** :ref:`int` bind_index **)** const @@ -79,6 +89,12 @@ Method Descriptions ---- +.. _class_Skin_method_set_bind_name: + +- void **set_bind_name** **(** :ref:`int` bind_index, :ref:`String` name **)** + +---- + .. _class_Skin_method_set_bind_pose: - void **set_bind_pose** **(** :ref:`int` bind_index, :ref:`Transform` pose **)** diff --git a/classes/class_spatialmaterial.rst b/classes/class_spatialmaterial.rst index 501c914cc..35aeaea24 100644 --- a/classes/class_spatialmaterial.rst +++ b/classes/class_spatialmaterial.rst @@ -1423,7 +1423,7 @@ If ``true``, triplanar mapping is calculated in world space rather than object l | *Getter* | get_metallic() | +-----------+---------------------+ -The reflectivity of the object's surface. The higher the value, the more light is reflected. +A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between ``0`` and ``1`` should only be used for blending between metal and non-metal sections. To alter the amount of reflection use :ref:`roughness`. ---- diff --git a/classes/class_springarm.rst b/classes/class_springarm.rst index e1059b8f1..75e01bb9a 100644 --- a/classes/class_springarm.rst +++ b/classes/class_springarm.rst @@ -128,7 +128,7 @@ Method Descriptions - void **add_excluded_object** **(** :ref:`RID` RID **)** -Adds the object with the given :ref:`RID` to the list of objects excluded from the collision check. +Adds the :ref:`PhysicsBody` object with the given :ref:`RID` to the list of :ref:`PhysicsBody` objects excluded from the collision check. ---- @@ -136,7 +136,7 @@ Adds the object with the given :ref:`RID` to the list of objects excl - void **clear_excluded_objects** **(** **)** -Clears the list of objects excluded from the collision check. +Clears the list of :ref:`PhysicsBody` objects excluded from the collision check. ---- @@ -152,5 +152,5 @@ Returns the proportion between the current arm length (after checking for collis - :ref:`bool` **remove_excluded_object** **(** :ref:`RID` RID **)** -Removes the given :ref:`RID` from the list of objects excluded from the collision check. +Removes the given :ref:`RID` from the list of :ref:`PhysicsBody` objects excluded from the collision check. diff --git a/classes/class_spritebase3d.rst b/classes/class_spritebase3d.rst index cd0a0251d..1223ddacc 100644 --- a/classes/class_spritebase3d.rst +++ b/classes/class_spritebase3d.rst @@ -323,15 +323,21 @@ Method Descriptions - :ref:`bool` **get_draw_flag** **(** :ref:`DrawFlags` flag **)** const +Returns the value of the specified flag. + ---- .. _class_SpriteBase3D_method_get_item_rect: - :ref:`Rect2` **get_item_rect** **(** **)** const +Returns the rectangle representing this sprite. + ---- .. _class_SpriteBase3D_method_set_draw_flag: - void **set_draw_flag** **(** :ref:`DrawFlags` flag, :ref:`bool` enabled **)** +If ``true``, the specified flag will be enabled. + diff --git a/classes/class_streampeerssl.rst b/classes/class_streampeerssl.rst index 35d1bf4c3..889eda0f2 100644 --- a/classes/class_streampeerssl.rst +++ b/classes/class_streampeerssl.rst @@ -64,11 +64,11 @@ enum **Status**: - **STATUS_DISCONNECTED** = **0** --- A status representing a ``StreamPeerSSL`` that is disconnected. -- **STATUS_HANDSHAKING** = **1** +- **STATUS_HANDSHAKING** = **1** --- A status representing a ``StreamPeerSSL`` during handshaking. - **STATUS_CONNECTED** = **2** --- A status representing a ``StreamPeerSSL`` that is connected to a host. -- **STATUS_ERROR** = **3** +- **STATUS_ERROR** = **3** --- A status representing a ``StreamPeerSSL`` in error state. - **STATUS_ERROR_HOSTNAME_MISMATCH** = **4** --- An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation. diff --git a/classes/class_streamtexture.rst b/classes/class_streamtexture.rst index 9ada9b262..2e379494e 100644 --- a/classes/class_streamtexture.rst +++ b/classes/class_streamtexture.rst @@ -58,3 +58,5 @@ Method Descriptions - :ref:`Error` **load** **(** :ref:`String` path **)** +Loads the texture from the given path. + diff --git a/classes/class_string.rst b/classes/class_string.rst index 08b57a47e..e99582fc3 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -103,7 +103,7 @@ Methods +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`findn` **(** :ref:`String` what, :ref:`int` from=0 **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`format` **(** :ref:`Variant` values, :ref:`String` placeholder={_} **)** | +| :ref:`String` | :ref:`format` **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_base_dir` **(** **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -137,7 +137,7 @@ Methods +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_valid_float` **(** **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_hex_number` **(** :ref:`bool` with_prefix=False **)** | +| :ref:`bool` | :ref:`is_valid_hex_number` **(** :ref:`bool` with_prefix=false **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_valid_html_color` **(** **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -189,7 +189,7 @@ Methods +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`right` **(** :ref:`int` position **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`rsplit` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=True, :ref:`int` maxsplit=0 **)** | +| :ref:`PoolStringArray` | :ref:`rsplit` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rstrip` **(** :ref:`String` chars **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -203,11 +203,11 @@ Methods +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`similarity` **(** :ref:`String` text **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolStringArray` | :ref:`split` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=True, :ref:`int` maxsplit=0 **)** | +| :ref:`PoolStringArray` | :ref:`split` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PoolRealArray` | :ref:`split_floats` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=True **)** | +| :ref:`PoolRealArray` | :ref:`split_floats` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`strip_edges` **(** :ref:`bool` left=True, :ref:`bool` right=True **)** | +| :ref:`String` | :ref:`strip_edges` **(** :ref:`bool` left=true, :ref:`bool` right=true **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`strip_escapes` **(** **)** | +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -505,7 +505,7 @@ Finds the first occurrence of a substring, ignoring case. Returns the starting p .. _class_String_method_format: -- :ref:`String` **format** **(** :ref:`Variant` values, :ref:`String` placeholder={_} **)** +- :ref:`String` **format** **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** Formats the string by replacing all occurrences of ``placeholder`` with ``values``. @@ -661,7 +661,7 @@ Returns ``true`` if this string contains a valid float. .. _class_String_method_is_valid_hex_number: -- :ref:`bool` **is_valid_hex_number** **(** :ref:`bool` with_prefix=False **)** +- :ref:`bool` **is_valid_hex_number** **(** :ref:`bool` with_prefix=false **)** Returns ``true`` if this string contains a valid hexadecimal number. If ``with_prefix`` is ``true``, then a validity of the hexadecimal number is determined by ``0x`` prefix, for instance: ``0xDEADC0DE``. @@ -869,7 +869,7 @@ Returns the right side of the string from a given position. .. _class_String_method_rsplit: -- :ref:`PoolStringArray` **rsplit** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=True, :ref:`int` maxsplit=0 **)** +- :ref:`PoolStringArray` **rsplit** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** Splits the string by a ``delimiter`` string and returns an array of the substrings, starting from right. @@ -939,7 +939,7 @@ Returns the similarity index of the text compared to this string. 1 means totall .. _class_String_method_split: -- :ref:`PoolStringArray` **split** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=True, :ref:`int` maxsplit=0 **)** +- :ref:`PoolStringArray` **split** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** Splits the string by a ``delimiter`` string and returns an array of the substrings. @@ -959,7 +959,7 @@ Example: .. _class_String_method_split_floats: -- :ref:`PoolRealArray` **split_floats** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=True **)** +- :ref:`PoolRealArray` **split_floats** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** Splits the string in floats by using a delimiter string and returns an array of the substrings. @@ -969,7 +969,7 @@ For example, ``"1,2.5,3"`` will return ``[1,2.5,3]`` if split by ``","``. .. _class_String_method_strip_edges: -- :ref:`String` **strip_edges** **(** :ref:`bool` left=True, :ref:`bool` right=True **)** +- :ref:`String` **strip_edges** **(** :ref:`bool` left=true, :ref:`bool` right=true **)** Returns a copy of the string stripped of any non-printable character (including tabulations, spaces and line breaks) at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. diff --git a/classes/class_texturelayered.rst b/classes/class_texturelayered.rst index 76bfa854f..1439e30cc 100644 --- a/classes/class_texturelayered.rst +++ b/classes/class_texturelayered.rst @@ -18,7 +18,7 @@ Base class for 3D texture types. Description ----------- -Base class for :ref:`Texture3D` and :ref:`TextureArray`. Cannot be used directly. +Base class for :ref:`Texture3D` and :ref:`TextureArray`. Cannot be used directly, but contains all the functions necessary for accessing and using :ref:`Texture3D` and :ref:`TextureArray`. Data is set on a per-layer basis. For :ref:`Texture3D`\ s, the layer sepcifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for :ref:`TextureArray`\ s, the layer specifies the array layer. Properties ---------- @@ -65,13 +65,13 @@ Enumerations enum **Flags**: -- **FLAG_MIPMAPS** = **1** +- **FLAG_MIPMAPS** = **1** --- Texture will generate mipmaps on creation. -- **FLAG_REPEAT** = **2** +- **FLAG_REPEAT** = **2** --- Texture will repeat when UV used is outside the 0-1 range. -- **FLAG_FILTER** = **4** +- **FLAG_FILTER** = **4** --- Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels. -- **FLAGS_DEFAULT** = **4** +- **FLAGS_DEFAULT** = **4** --- Equivalent to :ref:`FLAG_FILTER`. Property Descriptions --------------------- @@ -84,6 +84,8 @@ Property Descriptions | *Default* | ``{"depth": 0,"flags": 4,"format": 37,"height": 0,"layers": [ ],"width": 0}`` | +-----------+--------------------------------------------------------------------------------+ +Returns a dictionary with all the data used by this texture. + ---- .. _class_TextureLayered_property_flags: @@ -98,6 +100,8 @@ Property Descriptions | *Getter* | get_flags() | +-----------+------------------+ +Specifies which :ref:`Flags` apply to this texture. + Method Descriptions ------------------- @@ -105,45 +109,61 @@ Method Descriptions - void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`int` depth, :ref:`Format` format, :ref:`int` flags=4 **)** +Creates the :ref:`Texture3D` or :ref:`TextureArray` with specified ``width``, ``height``, and ``depth``. See :ref:`Format` for ``format`` options. See :ref:`Flags` enumerator for ``flags`` options. + ---- .. _class_TextureLayered_method_get_depth: - :ref:`int` **get_depth** **(** **)** const +Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis). + ---- .. _class_TextureLayered_method_get_format: - :ref:`Format` **get_format** **(** **)** const +Returns the current format being used by this texture. See :ref:`Format` for details. + ---- .. _class_TextureLayered_method_get_height: - :ref:`int` **get_height** **(** **)** const +Returns the height of the texture. Height is typically represented by the Y-axis. + ---- .. _class_TextureLayered_method_get_layer_data: - :ref:`Image` **get_layer_data** **(** :ref:`int` layer **)** const +Returns an :ref:`Image` resource with the data from specified ``layer``. + ---- .. _class_TextureLayered_method_get_width: - :ref:`int` **get_width** **(** **)** const +Returns the width of the texture. Width is typically represented by the X-axis. + ---- .. _class_TextureLayered_method_set_data_partial: - void **set_data_partial** **(** :ref:`Image` image, :ref:`int` x_offset, :ref:`int` y_offset, :ref:`int` layer, :ref:`int` mipmap=0 **)** +Partially sets the data for a specified ``layer`` by overwriting using the data of the specified ``image``. ``x_offset`` and ``y_offset`` determine where the :ref:`Image` is "stamped" over the texture. The ``image`` must fit within the texture. + ---- .. _class_TextureLayered_method_set_layer_data: - void **set_layer_data** **(** :ref:`Image` image, :ref:`int` layer **)** +Sets the data for the specified layer. Data takes the form of a 2-dimensional :ref:`Image` resource. + diff --git a/classes/class_tree.rst b/classes/class_tree.rst index 049ac5db5..a01b86de1 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -127,8 +127,6 @@ Theme Properties +---------------------------------+------------------------------+------------------------------+ | :ref:`StyleBox` | cursor | | +---------------------------------+------------------------------+------------------------------+ -| :ref:`Color` | cursor_color | Color( 0, 0, 0, 1 ) | -+---------------------------------+------------------------------+------------------------------+ | :ref:`StyleBox` | cursor_unfocused | | +---------------------------------+------------------------------+------------------------------+ | :ref:`StyleBox` | custom_button | | @@ -169,8 +167,6 @@ Theme Properties +---------------------------------+------------------------------+------------------------------+ | :ref:`StyleBox` | selected_focus | | +---------------------------------+------------------------------+------------------------------+ -| :ref:`Color` | selection_color | Color( 0.1, 0.1, 1, 0.8 ) | -+---------------------------------+------------------------------+------------------------------+ | :ref:`Color` | title_button_color | Color( 0.88, 0.88, 0.88, 1 ) | +---------------------------------+------------------------------+------------------------------+ | :ref:`Font` | title_button_font | | @@ -259,6 +255,8 @@ Emitted when an item is collapsed by a click on the folding arrow. - **item_custom_button_pressed** **(** **)** +Emitted when a custom button is pressed (i.e. in a :ref:`TreeItem.CELL_MODE_CUSTOM` mode cell). + ---- .. _class_Tree_signal_item_double_clicked: diff --git a/classes/class_tween.rst b/classes/class_tween.rst index c92112019..a498daf50 100644 --- a/classes/class_tween.rst +++ b/classes/class_tween.rst @@ -18,6 +18,8 @@ Description Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name *tween* comes from *in-betweening*, an animation technique where you specify *keyframes* and the computer interpolates the frames that appear between them. +``Tween`` is more suited than :ref:`AnimationPlayer` for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a ``Tween`` node; it would be difficult to do the same thing with an :ref:`AnimationPlayer` node. + Here is a brief usage example that causes a 2D node to move smoothly between two positions: :: diff --git a/classes/class_upnp.rst b/classes/class_upnp.rst index 078ee7d4f..7153c97a6 100644 --- a/classes/class_upnp.rst +++ b/classes/class_upnp.rst @@ -262,7 +262,7 @@ Adds a mapping to forward the external ``port`` (between 1 and 65535) on the def If ``internal_port`` is ``0`` (the default), the same port number is used for both the external and the internal port (the ``port`` value). -The description (``desc``) is shown in some router UIs and can be used to point out which application added the mapping, and the lifetime of the mapping can be limited by ``duration``. However, some routers are incompatible with one or both of these, so use with caution and add fallback logic in case of errors to retry without them if in doubt. +The description (``desc``) is shown in some router UIs and can be used to point out which application added the mapping. The mapping's lease duration can be limited by specifying a ``duration`` (in seconds). However, some routers are incompatible with one or both of these, so use with caution and add fallback logic in case of errors to retry without them if in doubt. See :ref:`UPNPResult` for possible return values. diff --git a/classes/class_visualshader.rst b/classes/class_visualshader.rst index 25c3ef288..6d1afe7e6 100644 --- a/classes/class_visualshader.rst +++ b/classes/class_visualshader.rst @@ -77,11 +77,11 @@ Enumerations enum **Type**: -- **TYPE_VERTEX** = **0** +- **TYPE_VERTEX** = **0** --- A vertex shader, operating on vertices. -- **TYPE_FRAGMENT** = **1** +- **TYPE_FRAGMENT** = **1** --- A fragment shader, operating on fragments (pixels). -- **TYPE_LIGHT** = **2** +- **TYPE_LIGHT** = **2** --- A shader for light calculations. - **TYPE_MAX** = **3** --- Represents the size of the :ref:`Type` enum. @@ -111,6 +111,8 @@ Property Descriptions | *Getter* | get_graph_offset() | +-----------+-------------------------+ +The offset vector of the whole graph. + Method Descriptions ------------------- @@ -118,54 +120,72 @@ Method Descriptions - void **add_node** **(** :ref:`Type` type, :ref:`VisualShaderNode` node, :ref:`Vector2` position, :ref:`int` id **)** +Adds the specified node to the shader. + ---- .. _class_VisualShader_method_can_connect_nodes: - :ref:`bool` **can_connect_nodes** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** const +Returns ``true`` if the specified nodes and ports can be connected together. + ---- .. _class_VisualShader_method_connect_nodes: - :ref:`Error` **connect_nodes** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** +Connects the specified nodes and ports. + ---- .. _class_VisualShader_method_connect_nodes_forced: - void **connect_nodes_forced** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** +Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly. + ---- .. _class_VisualShader_method_disconnect_nodes: - void **disconnect_nodes** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** +Connects the specified nodes and ports. + ---- .. _class_VisualShader_method_get_node: - :ref:`VisualShaderNode` **get_node** **(** :ref:`Type` type, :ref:`int` id **)** const +Returns the shader node instance with specified ``type`` and ``id``. + ---- .. _class_VisualShader_method_get_node_connections: - :ref:`Array` **get_node_connections** **(** :ref:`Type` type **)** const +Returns the list of connected nodes with the specified type. + ---- .. _class_VisualShader_method_get_node_list: - :ref:`PoolIntArray` **get_node_list** **(** :ref:`Type` type **)** const +Returns the list of all nodes in the shader with the specified type. + ---- .. _class_VisualShader_method_get_node_position: - :ref:`Vector2` **get_node_position** **(** :ref:`Type` type, :ref:`int` id **)** const +Returns the position of the specified node within the shader graph. + ---- .. _class_VisualShader_method_get_valid_node_id: @@ -178,21 +198,29 @@ Method Descriptions - :ref:`bool` **is_node_connection** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** const +Returns ``true`` if the specified node and port connection exist. + ---- .. _class_VisualShader_method_remove_node: - void **remove_node** **(** :ref:`Type` type, :ref:`int` id **)** +Removes the specified node from the shader. + ---- .. _class_VisualShader_method_set_mode: - void **set_mode** **(** :ref:`Mode` mode **)** +Sets the mode of this shader. + ---- .. _class_VisualShader_method_set_node_position: - void **set_node_position** **(** :ref:`Type` type, :ref:`int` id, :ref:`Vector2` position **)** +Sets the position of the specified node. + diff --git a/classes/class_visualshadernode.rst b/classes/class_visualshadernode.rst index 66bca6c00..d1ff8c1fa 100644 --- a/classes/class_visualshadernode.rst +++ b/classes/class_visualshadernode.rst @@ -13,7 +13,7 @@ VisualShaderNode **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` - +Base class for nodes in a visual shader graph. Tutorials ---------