Skip to content

Commit af7d7e6

Browse files
authored
Merge pull request #11025 from godotengine/classref/sync-09ed9d4
classref: Sync with current master branch (09ed9d4)
2 parents d316eac + 3a953d7 commit af7d7e6

File tree

72 files changed

+2519
-854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2519
-854
lines changed

classes/class_@gdscript.rst

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Methods
4141
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4242
| |void| | :ref:`assert<class_@GDScript_method_assert>`\ (\ condition\: :ref:`bool<class_bool>`, message\: :ref:`String<class_String>` = ""\ ) |
4343
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
44-
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>`\ (\ char\: :ref:`int<class_int>`\ ) |
44+
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>`\ (\ code\: :ref:`int<class_int>`\ ) |
4545
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4646
| :ref:`Variant<class_Variant>` | :ref:`convert<class_@GDScript_method_convert>`\ (\ what\: :ref:`Variant<class_Variant>`, type\: :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`\ ) |
4747
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -57,6 +57,8 @@ Methods
5757
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
5858
| :ref:`Resource<class_Resource>` | :ref:`load<class_@GDScript_method_load>`\ (\ path\: :ref:`String<class_String>`\ ) |
5959
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
60+
| :ref:`int<class_int>` | :ref:`ord<class_@GDScript_method_ord>`\ (\ char\: :ref:`String<class_String>`\ ) |
61+
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6062
| :ref:`Resource<class_Resource>` | :ref:`preload<class_@GDScript_method_preload>`\ (\ path\: :ref:`String<class_String>`\ ) |
6163
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6264
| |void| | :ref:`print_debug<class_@GDScript_method_print_debug>`\ (\ ...\ ) |vararg| |
@@ -324,6 +326,20 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPE
324326
@export_file("*.txt") var notes_path: String
325327
@export_file var level_paths: Array[String]
326328

329+
\ **Note:** The file will be stored and referenced as UID, if available. This ensures that the reference is valid even when the file is moved. You can use :ref:`ResourceUID<class_ResourceUID>` methods to convert it to path.
330+
331+
.. rst-class:: classref-item-separator
332+
333+
----
334+
335+
.. _class_@GDScript_annotation_@export_file_path:
336+
337+
.. rst-class:: classref-annotation
338+
339+
**@export_file_path**\ (\ filter\: :ref:`String<class_String>` = "", ...\ ) |vararg| :ref:`🔗<class_@GDScript_annotation_@export_file_path>`
340+
341+
Same as :ref:`@export_file<class_@GDScript_annotation_@export_file>`, except the file will be stored as a raw path. This means that it may become invalid when the file is moved. If you are exporting a :ref:`Resource<class_Resource>` path, consider using :ref:`@export_file<class_@GDScript_annotation_@export_file>` instead.
342+
327343
.. rst-class:: classref-item-separator
328344

329345
----
@@ -999,15 +1015,16 @@ An optional ``message`` can be shown in addition to the generic "Assertion faile
9991015

10001016
.. rst-class:: classref-method
10011017

1002-
:ref:`String<class_String>` **char**\ (\ char\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GDScript_method_char>`
1018+
:ref:`String<class_String>` **char**\ (\ code\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GDScript_method_char>`
10031019

1004-
Returns a single character (as a :ref:`String<class_String>`) of the given Unicode code point (which is compatible with ASCII code).
1020+
Returns a single character (as a :ref:`String<class_String>` of length 1) of the given Unicode code point ``code``.
10051021

10061022
::
10071023

1008-
var upper = char(65) # upper is "A"
1009-
var lower = char(65 + 32) # lower is "a"
1010-
var euro = char(8364) # euro is "€"
1024+
print(char(65)) # Prints "A"
1025+
print(char(129302)) # Prints "🤖" (robot face emoji)
1026+
1027+
This is the inverse of :ref:`ord()<class_@GDScript_method_ord>`. See also :ref:`String.chr()<class_String_method_chr>` and :ref:`String.unicode_at()<class_String_method_unicode_at>`.
10111028

10121029
.. rst-class:: classref-item-separator
10131030

@@ -1196,6 +1213,25 @@ This function is a simplified version of :ref:`ResourceLoader.load()<class_Resou
11961213

11971214
----
11981215

1216+
.. _class_@GDScript_method_ord:
1217+
1218+
.. rst-class:: classref-method
1219+
1220+
:ref:`int<class_int>` **ord**\ (\ char\: :ref:`String<class_String>`\ ) :ref:`🔗<class_@GDScript_method_ord>`
1221+
1222+
Returns an integer representing the Unicode code point of the given character ``char``, which should be a string of length 1.
1223+
1224+
::
1225+
1226+
print(ord("A")) # Prints 65
1227+
print(ord("🤖")) # Prints 129302
1228+
1229+
This is the inverse of :ref:`char()<class_@GDScript_method_char>`. See also :ref:`String.chr()<class_String_method_chr>` and :ref:`String.unicode_at()<class_String_method_unicode_at>`.
1230+
1231+
.. rst-class:: classref-item-separator
1232+
1233+
----
1234+
11991235
.. _class_@GDScript_method_preload:
12001236

12011237
.. rst-class:: classref-method

classes/class_@globalscope.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,7 +3587,7 @@ Hints that an integer property is a bitmask using the optionally named avoidance
35873587

35883588
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_FILE** = ``13``
35893589

3590-
Hints that a :ref:`String<class_String>` property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``.
3590+
Hints that a :ref:`String<class_String>` property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. By default the file will be stored as UID whenever available. You can use :ref:`ResourceUID<class_ResourceUID>` methods to convert it back to path. For storing a raw path, use :ref:`PROPERTY_HINT_FILE_PATH<class_@GlobalScope_constant_PROPERTY_HINT_FILE_PATH>`.
35913591

35923592
.. _class_@GlobalScope_constant_PROPERTY_HINT_DIR:
35933593

@@ -3887,7 +3887,7 @@ Hints that a property will be changed on its own after setting, such as :ref:`Au
38873887

38883888
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_GROUP_ENABLE** = ``42``
38893889

3890-
Hints that a boolean property will enable the feature associated with the group that it occurs in. Only works within a group or subgroup. Use the optional hint string ``"feature"`` when the group only has variables that are meaningful when the feature is enabled.
3890+
Hints that a boolean property will enable the feature associated with the group that it occurs in. Only works within a group or subgroup. Use the optional hint string ``"feature"`` when the group only has properties that are meaningful when the feature is enabled.
38913891

38923892
\ **Note:** The ``"feature"`` hint string does not modify or reset any values.
38933893

@@ -3903,11 +3903,19 @@ Hints that a :ref:`String<class_String>` or :ref:`StringName<class_StringName>`
39033903

39043904
- If it contains ``"loose_mode"``, loose mode is enabled. This allows inserting any action name even if it's not present in the input map.
39053905

3906+
.. _class_@GlobalScope_constant_PROPERTY_HINT_FILE_PATH:
3907+
3908+
.. rst-class:: classref-enumeration-constant
3909+
3910+
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_FILE_PATH** = ``44``
3911+
3912+
Like :ref:`PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPERTY_HINT_FILE>`, but the property is stored as a raw path, not UID. That means the reference will be broken if you move the file. Consider using :ref:`PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPERTY_HINT_FILE>` when possible.
3913+
39063914
.. _class_@GlobalScope_constant_PROPERTY_HINT_MAX:
39073915

39083916
.. rst-class:: classref-enumeration-constant
39093917

3910-
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``44``
3918+
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``45``
39113919

39123920
Represents the size of the :ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` enum.
39133921

@@ -4253,7 +4261,7 @@ Used internally. Allows to not dump core virtual methods (such as :ref:`Object._
42534261

42544262
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_VIRTUAL_REQUIRED** = ``128``
42554263

4256-
Flag for a virtual method that is required.
4264+
Flag for a virtual method that is required. In GDScript, this flag is set for abstract functions.
42574265

42584266
.. _class_@GlobalScope_constant_METHOD_FLAGS_DEFAULT:
42594267

classes/class_animation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ The total length of the animation (in seconds).
575575
- |void| **set_loop_mode**\ (\ value\: :ref:`LoopMode<enum_Animation_LoopMode>`\ )
576576
- :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode**\ (\ )
577577

578-
Determines the behavior of both ends of the animation timeline during animation playback. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
578+
Determines the behavior of both ends of the animation timeline during animation playback. This indicates whether and how the animation should be restarted, and is also used to correctly interpolate animation cycles.
579579

580580
.. rst-class:: classref-item-separator
581581

classes/class_audiostream.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Generates an :ref:`AudioSample<class_AudioSample>` based on the current stream.
264264

265265
:ref:`float<class_float>` **get_length**\ (\ ) |const| :ref:`🔗<class_AudioStream_method_get_length>`
266266

267-
Returns the length of the audio stream in seconds.
267+
Returns the length of the audio stream in seconds. If this stream is an :ref:`AudioStreamRandomizer<class_AudioStreamRandomizer>`, returns the length of the last played stream. If this stream has an indefinite length (such as for :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` and :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`), returns ``0.0``.
268268

269269
.. rst-class:: classref-item-separator
270270

0 commit comments

Comments
 (0)