You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mark the following method for remote procedure calls. See :doc:`High-level multiplayer <../tutorials/networking/high_level_multiplayer>`.
665
665
666
-
The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter and all arguments can be omitted, but ``transfer_channel`` always has to be the last argument. The accepted values for ``mode`` are ``"any_peer"`` or ``"authority"``, for ``sync`` are ``"call_remote"`` or ``"call_local"`` and for ``transfer_mode`` are ``"unreliable"``, ``"unreliable_ordered"`` or ``"reliable"``.
666
+
The accepted values:
667
+
668
+
- for ``mode`` are ``"any_peer"`` or ``"authority"``;
669
+
670
+
- for ``sync`` are ``"call_remote"`` or ``"call_local"``;
671
+
672
+
- and for ``transfer_mode`` are ``"unreliable"``, ``"unreliable_ordered"``, or ``"reliable"``.
673
+
674
+
The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter, but values related to the same argument must not be used more than once. ``transfer_channel`` always has to be the 4th argument (you must specify 3 preceding arguments).
667
675
668
676
::
669
677
@@ -1117,3 +1125,4 @@ Returns ``true`` if the given :ref:`Object<class_Object>`-derived class exists i
1117
1125
.. |constructor| replace:::abbr:`constructor(This method is used to construct a type.)`
1118
1126
.. |static| replace:::abbr:`static(This method doesn't need an instance to be called, so it can be called directly using the class name.)`
1119
1127
.. |operator| replace:::abbr:`operator(This method describes a valid operator to use with this type as left-hand operand.)`
1128
+
.. |bitfield| replace:::abbr:`BitField(This value is an integer composed as a bitmask of the following flags.)`
Hint that a property represents a particular type. If a property is :ref:`TYPE_STRING<class_@GlobalScope_constant_TYPE_STRING>`, allows to set a type from the create dialog. If you need to create an :ref:`Array<class_Array>` to contain elements of a specific type, the ``hint_string`` must encode nested types using ``":"`` and ``"/"`` for specifying :ref:`Resource<class_Resource>` types. For instance:
3606
+
If a property is :ref:`String<class_String>`, hints that the property represents a particular type (class). This allows to select a type from the create dialog. The property will store the selected type as a string.
3607
3607
3608
-
::
3608
+
If a property is :ref:`Array<class_Array>`, hints the editor how to show elements. The ``hint_string`` must encode nested types using ``":"`` and ``"/"``.
hintString = $"{Variant.Type.Int:D}/{PropertyHint.Range:D}:1,10,1"; // Array of integers (in range from 1 to 10).
3661
+
hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Two"; // Array of integers (an enum).
3662
+
hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Three:3,Six:6"; // Array of integers (an enum).
3663
+
hintString = $"{Variant.Type.String:D}/{PropertyHint.File:D}:*.png"; // Array of strings (file paths).
3664
+
hintString = $"{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Array of textures.
3665
+
3666
+
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}:"; // Two-dimensional array of floats.
3667
+
hintString = $"{Variant.Type.Array:D}:{Variant.Type.String:D}/{PropertyHint.MultilineText:D}:"; // Two-dimensional array of multiline strings.
3668
+
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}/{PropertyHint.Range:D}:-1,1,0.1"; // Two-dimensional array of floats (in range from -1 to 1).
3669
+
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Two-dimensional array of textures.
3670
+
3671
+
3672
+
3673
+
\ **Note:** The trailing colon is required for properly detecting built-in types.
@@ -6075,14 +6133,15 @@ Returns the minimum of two :ref:`int<class_int>` values.
6075
6133
6076
6134
:ref:`float<class_float>` **move_toward** **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to, :ref:`float<class_float>` delta **)**
6077
6135
6078
-
Moves ``from`` toward ``to`` by the ``delta`` value.
6136
+
Moves ``from`` toward ``to`` by the ``delta`` amount. Will not go past ``to``.
6079
6137
6080
6138
Use a negative ``delta`` value to move away.
6081
6139
6082
6140
::
6083
6141
6084
6142
move_toward(5, 10, 4) # Returns 9
6085
6143
move_toward(10, 5, 4) # Returns 6
6144
+
move_toward(5, 10, 9) # Returns 10
6086
6145
move_toward(10, 5, -1.5) # Returns 11.5
6087
6146
6088
6147
.. rst-class:: classref-item-separator
@@ -7108,6 +7167,8 @@ Prints:
7108
7167
"b": 2
7109
7168
}
7110
7169
7170
+
\ **Note:** Converting :ref:`Signal<class_Signal>` or :ref:`Callable<class_Callable>` is not supported and will result in an empty value for these types, regardless of their data.
7171
+
7111
7172
.. rst-class:: classref-item-separator
7112
7173
7113
7174
----
@@ -7206,3 +7267,4 @@ Wraps the integer ``value`` between ``min`` and ``max``. Can be used for creatin
7206
7267
.. |constructor| replace:::abbr:`constructor(This method is used to construct a type.)`
7207
7268
.. |static| replace:::abbr:`static(This method doesn't need an instance to be called, so it can be called directly using the class name.)`
7208
7269
.. |operator| replace:::abbr:`operator(This method describes a valid operator to use with this type as left-hand operand.)`
7270
+
.. |bitfield| replace:::abbr:`BitField(This value is an integer composed as a bitmask of the following flags.)`
0 commit comments