mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current master branch (2e7fc81)
This commit is contained in:
@@ -36,37 +36,37 @@ Methods
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`Color8<class_@GDScript_method_Color8>` **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`assert<class_@GDScript_method_assert>` **(** :ref:`bool<class_bool>` condition, :ref:`String<class_String>` message="" **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>` **(** :ref:`int<class_int>` char **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`convert<class_@GDScript_method_convert>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Object<class_Object>` | :ref:`dict_to_inst<class_@GDScript_method_dict_to_inst>` **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`get_stack<class_@GDScript_method_get_stack>` **(** **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`inst_to_dict<class_@GDScript_method_inst_to_dict>` **(** :ref:`Object<class_Object>` instance **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_instance_of<class_@GDScript_method_is_instance_of>` **(** :ref:`Variant<class_Variant>` value, :ref:`Variant<class_Variant>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`len<class_@GDScript_method_len>` **(** :ref:`Variant<class_Variant>` var **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`load<class_@GDScript_method_load>` **(** :ref:`String<class_String>` path **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`preload<class_@GDScript_method_preload>` **(** :ref:`String<class_String>` path **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`print_debug<class_@GDScript_method_print_debug>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`print_stack<class_@GDScript_method_print_stack>` **(** **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`range<class_@GDScript_method_range>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`type_exists<class_@GDScript_method_type_exists>` **(** :ref:`StringName<class_StringName>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`Color8<class_@GDScript_method_Color8>`\ (\ r8\: :ref:`int<class_int>`, g8\: :ref:`int<class_int>`, b8\: :ref:`int<class_int>`, a8\: :ref:`int<class_int>` = 255\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`assert<class_@GDScript_method_assert>`\ (\ condition\: :ref:`bool<class_bool>`, message\: :ref:`String<class_String>` = ""\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>`\ (\ char\: :ref:`int<class_int>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`convert<class_@GDScript_method_convert>`\ (\ what\: :ref:`Variant<class_Variant>`, type\: :ref:`int<class_int>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Object<class_Object>` | :ref:`dict_to_inst<class_@GDScript_method_dict_to_inst>`\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`get_stack<class_@GDScript_method_get_stack>`\ (\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`inst_to_dict<class_@GDScript_method_inst_to_dict>`\ (\ instance\: :ref:`Object<class_Object>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_instance_of<class_@GDScript_method_is_instance_of>`\ (\ value\: :ref:`Variant<class_Variant>`, type\: :ref:`Variant<class_Variant>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`len<class_@GDScript_method_len>`\ (\ var\: :ref:`Variant<class_Variant>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`load<class_@GDScript_method_load>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`preload<class_@GDScript_method_preload>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`print_debug<class_@GDScript_method_print_debug>`\ (\ ...\ ) |vararg| |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`print_stack<class_@GDScript_method_print_stack>`\ (\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`range<class_@GDScript_method_range>`\ (\ ...\ ) |vararg| |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`type_exists<class_@GDScript_method_type_exists>`\ (\ type\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -124,7 +124,7 @@ Annotations
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export** **(** **)**
|
||||
**@export**\ (\ )
|
||||
|
||||
Mark the following property as exported (editable in the Inspector dock and saved to disk). To control the type of the exported property, use the type hint notation.
|
||||
|
||||
@@ -170,7 +170,7 @@ Mark the following property as exported (editable in the Inspector dock and save
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_category** **(** :ref:`String<class_String>` name **)**
|
||||
**@export_category**\ (\ name\: :ref:`String<class_String>`\ )
|
||||
|
||||
Define a new category for the following exported properties. This helps to organize properties in the Inspector dock.
|
||||
|
||||
@@ -192,7 +192,7 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_CATEGORY<class_@GlobalScope_constant_
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_color_no_alpha** **(** **)**
|
||||
**@export_color_no_alpha**\ (\ )
|
||||
|
||||
Export a :ref:`Color<class_Color>` property without allowing its transparency (:ref:`Color.a<class_Color_property_a>`) to be edited.
|
||||
|
||||
@@ -210,7 +210,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_COLOR_NO_ALPHA<class_@GlobalScope_cons
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_dir** **(** **)**
|
||||
**@export_dir**\ (\ )
|
||||
|
||||
Export a :ref:`String<class_String>` property as a path to a directory. The path will be limited to the project folder and its subfolders. See :ref:`@export_global_dir<class_@GDScript_annotation_@export_global_dir>` to allow picking from the entire filesystem.
|
||||
|
||||
@@ -228,7 +228,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_DIR<class_@GlobalScope_constant_PROPER
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_enum** **(** :ref:`String<class_String>` names, ... **)** |vararg|
|
||||
**@export_enum**\ (\ names\: :ref:`String<class_String>`, ...\ ) |vararg|
|
||||
|
||||
Export an :ref:`int<class_int>` or :ref:`String<class_String>` property as an enumerated list of options. If the property is an :ref:`int<class_int>`, then the index of the value is stored, in the same order the values are provided. You can add explicit values using a colon. If the property is a :ref:`String<class_String>`, then the value is stored.
|
||||
|
||||
@@ -261,7 +261,7 @@ If you want to use named GDScript enums, then use :ref:`@export<class_@GDScript_
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_exp_easing** **(** :ref:`String<class_String>` hints="", ... **)** |vararg|
|
||||
**@export_exp_easing**\ (\ hints\: :ref:`String<class_String>` = "", ...\ ) |vararg|
|
||||
|
||||
Export a floating-point property with an easing editor widget. Additional hints can be provided to adjust the behavior of the widget. ``"attenuation"`` flips the curve, which makes it more intuitive for editing attenuation properties. ``"positive_only"`` limits values to only be greater than or equal to zero.
|
||||
|
||||
@@ -281,7 +281,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_EXP_EASING<class_@GlobalScope_constant
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_file** **(** :ref:`String<class_String>` filter="", ... **)** |vararg|
|
||||
**@export_file**\ (\ filter\: :ref:`String<class_String>` = "", ...\ ) |vararg|
|
||||
|
||||
Export a :ref:`String<class_String>` property as a path to a file. The path will be limited to the project folder and its subfolders. See :ref:`@export_global_file<class_@GDScript_annotation_@export_global_file>` to allow picking from the entire filesystem.
|
||||
|
||||
@@ -302,7 +302,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPE
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags** **(** :ref:`String<class_String>` names, ... **)** |vararg|
|
||||
**@export_flags**\ (\ names\: :ref:`String<class_String>`, ...\ ) |vararg|
|
||||
|
||||
Export an integer property as a bit flag field. This allows to store several "checked" or ``true`` values with one property, and comfortably select them from the Inspector dock.
|
||||
|
||||
@@ -341,7 +341,7 @@ You can also combine several flags:
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_2d_navigation** **(** **)**
|
||||
**@export_flags_2d_navigation**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for 2D navigation layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/2d_navigation/layer_1<class_ProjectSettings_property_layer_names/2d_navigation/layer_1>`.
|
||||
|
||||
@@ -359,7 +359,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_2D_NAVIGATION<class_@GlobalScop
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_2d_physics** **(** **)**
|
||||
**@export_flags_2d_physics**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for 2D physics layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/2d_physics/layer_1<class_ProjectSettings_property_layer_names/2d_physics/layer_1>`.
|
||||
|
||||
@@ -377,7 +377,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_2D_PHYSICS<class_@GlobalScope_c
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_2d_render** **(** **)**
|
||||
**@export_flags_2d_render**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for 2D render layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/2d_render/layer_1<class_ProjectSettings_property_layer_names/2d_render/layer_1>`.
|
||||
|
||||
@@ -395,7 +395,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_2D_RENDER<class_@GlobalScope_co
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_3d_navigation** **(** **)**
|
||||
**@export_flags_3d_navigation**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for 3D navigation layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/3d_navigation/layer_1<class_ProjectSettings_property_layer_names/3d_navigation/layer_1>`.
|
||||
|
||||
@@ -413,7 +413,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_NAVIGATION<class_@GlobalScop
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_3d_physics** **(** **)**
|
||||
**@export_flags_3d_physics**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for 3D physics layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/3d_physics/layer_1<class_ProjectSettings_property_layer_names/3d_physics/layer_1>`.
|
||||
|
||||
@@ -431,7 +431,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_PHYSICS<class_@GlobalScope_c
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_3d_render** **(** **)**
|
||||
**@export_flags_3d_render**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for 3D render layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/3d_render/layer_1<class_ProjectSettings_property_layer_names/3d_render/layer_1>`.
|
||||
|
||||
@@ -449,7 +449,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_RENDER<class_@GlobalScope_co
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_avoidance** **(** **)**
|
||||
**@export_flags_avoidance**\ (\ )
|
||||
|
||||
Export an integer property as a bit flag field for navigation avoidance layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/avoidance/layer_1<class_ProjectSettings_property_layer_names/avoidance/layer_1>`.
|
||||
|
||||
@@ -467,7 +467,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_AVOIDANCE<class_@GlobalScope_co
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_global_dir** **(** **)**
|
||||
**@export_global_dir**\ (\ )
|
||||
|
||||
Export a :ref:`String<class_String>` property as an absolute path to a directory. The path can be picked from the entire filesystem. See :ref:`@export_dir<class_@GDScript_annotation_@export_dir>` to limit it to the project folder and its subfolders.
|
||||
|
||||
@@ -485,7 +485,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_DIR<class_@GlobalScope_constant
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_global_file** **(** :ref:`String<class_String>` filter="", ... **)** |vararg|
|
||||
**@export_global_file**\ (\ filter\: :ref:`String<class_String>` = "", ...\ ) |vararg|
|
||||
|
||||
Export a :ref:`String<class_String>` property as an absolute path to a file. The path can be picked from the entire filesystem. See :ref:`@export_file<class_@GDScript_annotation_@export_file>` to limit it to the project folder and its subfolders.
|
||||
|
||||
@@ -506,7 +506,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_FILE<class_@GlobalScope_constan
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_group** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` prefix="" **)**
|
||||
**@export_group**\ (\ name\: :ref:`String<class_String>`, prefix\: :ref:`String<class_String>` = ""\ )
|
||||
|
||||
Define a new group for the following exported properties. This helps to organize properties in the Inspector dock. Groups can be added with an optional ``prefix``, which would make group to only consider properties that have this prefix. The grouping will break on the first property that doesn't have a prefix. The prefix is also removed from the property's name in the Inspector dock.
|
||||
|
||||
@@ -537,7 +537,7 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_GROUP<class_@GlobalScope_constant_PRO
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_multiline** **(** **)**
|
||||
**@export_multiline**\ (\ )
|
||||
|
||||
Export a :ref:`String<class_String>` property with a large :ref:`TextEdit<class_TextEdit>` widget instead of a :ref:`LineEdit<class_LineEdit>`. This adds support for multiline content and makes it easier to edit large amount of text stored in the property.
|
||||
|
||||
@@ -555,7 +555,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_MULTILINE_TEXT<class_@GlobalScope_cons
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_node_path** **(** :ref:`String<class_String>` type="", ... **)** |vararg|
|
||||
**@export_node_path**\ (\ type\: :ref:`String<class_String>` = "", ...\ ) |vararg|
|
||||
|
||||
Export a :ref:`NodePath<class_NodePath>` property with a filter for allowed node types.
|
||||
|
||||
@@ -575,7 +575,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_NODE_PATH_VALID_TYPES<class_@GlobalSco
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_placeholder** **(** :ref:`String<class_String>` placeholder **)**
|
||||
**@export_placeholder**\ (\ placeholder\: :ref:`String<class_String>`\ )
|
||||
|
||||
Export a :ref:`String<class_String>` property with a placeholder text displayed in the editor widget when no value is present.
|
||||
|
||||
@@ -593,9 +593,9 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_PLACEHOLDER_TEXT<class_@GlobalScope_co
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_range** **(** :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step=1.0, :ref:`String<class_String>` extra_hints="", ... **)** |vararg|
|
||||
**@export_range**\ (\ min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`, step\: :ref:`float<class_float>` = 1.0, extra_hints\: :ref:`String<class_String>` = "", ...\ ) |vararg|
|
||||
|
||||
Export an :ref:`int<class_int>` or :ref:`float<class_float>` property as a range value. The range must be defined by ``min`` and ``max``, as well as an optional ``step`` and a variety of extra hints. The ``step`` defaults to ``1`` for integer properties. For floating-point numbers this value depends on your ``EditorSettings.interface/inspector/default_float_step`` setting.
|
||||
Export an :ref:`int<class_int>` or :ref:`float<class_float>` property as a range value. The range must be defined by ``min`` and ``max``, as well as an optional ``step`` and a variety of extra hints. The ``step`` defaults to ``1`` for integer properties. For floating-point numbers this value depends on your :ref:`EditorSettings.interface/inspector/default_float_step<class_EditorSettings_property_interface/inspector/default_float_step>` setting.
|
||||
|
||||
If hints ``"or_greater"`` and ``"or_less"`` are provided, the editor widget will not cap the value at range boundaries. The ``"exp"`` hint will make the edited values on range to change exponentially. The ``"hide_slider"`` hint will hide the slider element of the editor widget.
|
||||
|
||||
@@ -624,7 +624,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_RANGE<class_@GlobalScope_constant_PROP
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_subgroup** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` prefix="" **)**
|
||||
**@export_subgroup**\ (\ name\: :ref:`String<class_String>`, prefix\: :ref:`String<class_String>` = ""\ )
|
||||
|
||||
Define a new subgroup for the following exported properties. This helps to organize properties in the Inspector dock. Subgroups work exactly like groups, except they need a parent group to exist. See :ref:`@export_group<class_@GDScript_annotation_@export_group>`.
|
||||
|
||||
@@ -650,7 +650,7 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_SUBGROUP<class_@GlobalScope_constant_
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@icon** **(** :ref:`String<class_String>` icon_path **)**
|
||||
**@icon**\ (\ icon_path\: :ref:`String<class_String>`\ )
|
||||
|
||||
Add a custom icon to the current script. The icon specified at ``icon_path`` is displayed in the Scene dock for every node of that class, as well as in various editor dialogs.
|
||||
|
||||
@@ -672,7 +672,7 @@ Add a custom icon to the current script. The icon specified at ``icon_path`` is
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@onready** **(** **)**
|
||||
**@onready**\ (\ )
|
||||
|
||||
Mark the following property as assigned when the :ref:`Node<class_Node>` is ready. Values for these properties are not assigned immediately when the node is initialized (:ref:`Object._init<class_Object_private_method__init>`), and instead are computed and stored right before :ref:`Node._ready<class_Node_private_method__ready>`.
|
||||
|
||||
@@ -688,7 +688,7 @@ Mark the following property as assigned when the :ref:`Node<class_Node>` is read
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@rpc** **(** :ref:`String<class_String>` mode="authority", :ref:`String<class_String>` sync="call_remote", :ref:`String<class_String>` transfer_mode="unreliable", :ref:`int<class_int>` transfer_channel=0 **)**
|
||||
**@rpc**\ (\ mode\: :ref:`String<class_String>` = "authority", sync\: :ref:`String<class_String>` = "call_remote", transfer_mode\: :ref:`String<class_String>` = "unreliable", transfer_channel\: :ref:`int<class_int>` = 0\ )
|
||||
|
||||
Mark the following method for remote procedure calls. See :doc:`High-level multiplayer <../tutorials/networking/high_level_multiplayer>`.
|
||||
|
||||
@@ -721,7 +721,7 @@ The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter, but value
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@static_unload** **(** **)**
|
||||
**@static_unload**\ (\ )
|
||||
|
||||
Make a script with static variables to not persist after all references are lost. If the script is loaded again the static variables will revert to their default values.
|
||||
|
||||
@@ -733,7 +733,7 @@ Make a script with static variables to not persist after all references are lost
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@tool** **(** **)**
|
||||
**@tool**\ (\ )
|
||||
|
||||
Mark the current script as a tool script, allowing it to be loaded and executed by the editor. See :doc:`Running code in the editor <../tutorials/plugins/running_code_in_the_editor>`.
|
||||
|
||||
@@ -752,7 +752,7 @@ Mark the current script as a tool script, allowing it to be loaded and executed
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@warning_ignore** **(** :ref:`String<class_String>` warning, ... **)** |vararg|
|
||||
**@warning_ignore**\ (\ warning\: :ref:`String<class_String>`, ...\ ) |vararg|
|
||||
|
||||
Mark the following statement to ignore the specified ``warning``. See :doc:`GDScript warning system <../tutorials/scripting/gdscript/warning_system>`.
|
||||
|
||||
@@ -777,7 +777,7 @@ Method Descriptions
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Color<class_Color>` **Color8** **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)**
|
||||
:ref:`Color<class_Color>` **Color8**\ (\ r8\: :ref:`int<class_int>`, g8\: :ref:`int<class_int>`, b8\: :ref:`int<class_int>`, a8\: :ref:`int<class_int>` = 255\ )
|
||||
|
||||
Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value. Using :ref:`Color8<class_@GDScript_method_Color8>` instead of the standard :ref:`Color<class_Color>` constructor is useful when you need to match exact color values in an :ref:`Image<class_Image>`.
|
||||
|
||||
@@ -797,7 +797,7 @@ Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **assert** **(** :ref:`bool<class_bool>` condition, :ref:`String<class_String>` message="" **)**
|
||||
|void| **assert**\ (\ condition\: :ref:`bool<class_bool>`, message\: :ref:`String<class_String>` = ""\ )
|
||||
|
||||
Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of :ref:`@GlobalScope.push_error<class_@GlobalScope_method_push_error>` for reporting errors to project developers or add-on users.
|
||||
|
||||
@@ -822,7 +822,7 @@ An optional ``message`` can be shown in addition to the generic "Assertion faile
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`String<class_String>` **char** **(** :ref:`int<class_int>` char **)**
|
||||
:ref:`String<class_String>` **char**\ (\ char\: :ref:`int<class_int>`\ )
|
||||
|
||||
Returns a single character (as a :ref:`String<class_String>`) of the given Unicode code point (which is compatible with ASCII code).
|
||||
|
||||
@@ -840,7 +840,7 @@ Returns a single character (as a :ref:`String<class_String>`) of the given Unico
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Variant<class_Variant>` **convert** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` type **)**
|
||||
:ref:`Variant<class_Variant>` **convert**\ (\ what\: :ref:`Variant<class_Variant>`, type\: :ref:`int<class_int>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`@GlobalScope.type_convert<class_@GlobalScope_method_type_convert>` instead.
|
||||
|
||||
@@ -863,7 +863,7 @@ Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :r
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Object<class_Object>` **dict_to_inst** **(** :ref:`Dictionary<class_Dictionary>` dictionary **)**
|
||||
:ref:`Object<class_Object>` **dict_to_inst**\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ )
|
||||
|
||||
Converts a ``dictionary`` (created with :ref:`inst_to_dict<class_@GDScript_method_inst_to_dict>`) back to an Object instance. Can be useful for deserializing.
|
||||
|
||||
@@ -875,7 +875,7 @@ Converts a ``dictionary`` (created with :ref:`inst_to_dict<class_@GDScript_metho
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **get_stack** **(** **)**
|
||||
:ref:`Array<class_Array>` **get_stack**\ (\ )
|
||||
|
||||
Returns an array of dictionaries representing the current call stack. See also :ref:`print_stack<class_@GDScript_method_print_stack>`.
|
||||
|
||||
@@ -908,7 +908,7 @@ Starting from ``_ready()``, ``bar()`` would print:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Dictionary<class_Dictionary>` **inst_to_dict** **(** :ref:`Object<class_Object>` instance **)**
|
||||
:ref:`Dictionary<class_Dictionary>` **inst_to_dict**\ (\ instance\: :ref:`Object<class_Object>`\ )
|
||||
|
||||
Returns the passed ``instance`` converted to a Dictionary. Can be useful for serializing.
|
||||
|
||||
@@ -937,7 +937,7 @@ Prints out:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_instance_of** **(** :ref:`Variant<class_Variant>` value, :ref:`Variant<class_Variant>` type **)**
|
||||
:ref:`bool<class_bool>` **is_instance_of**\ (\ value\: :ref:`Variant<class_Variant>`, type\: :ref:`Variant<class_Variant>`\ )
|
||||
|
||||
Returns ``true`` if ``value`` is an instance of ``type``. The ``type`` value must be one of the following:
|
||||
|
||||
@@ -970,7 +970,7 @@ See also :ref:`@GlobalScope.typeof<class_@GlobalScope_method_typeof>`, :ref:`typ
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **len** **(** :ref:`Variant<class_Variant>` var **)**
|
||||
:ref:`int<class_int>` **len**\ (\ var\: :ref:`Variant<class_Variant>`\ )
|
||||
|
||||
Returns the length of the given Variant ``var``. The length can be the character count of a :ref:`String<class_String>` or :ref:`StringName<class_StringName>`, the element count of any array type, or the size of a :ref:`Dictionary<class_Dictionary>`. For every other Variant type, a run-time error is generated and execution is stopped.
|
||||
|
||||
@@ -990,7 +990,7 @@ Returns the length of the given Variant ``var``. The length can be the character
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Resource<class_Resource>` **load** **(** :ref:`String<class_String>` path **)**
|
||||
:ref:`Resource<class_Resource>` **load**\ (\ path\: :ref:`String<class_String>`\ )
|
||||
|
||||
Returns a :ref:`Resource<class_Resource>` from the filesystem located at the absolute ``path``. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload<class_@GDScript_method_preload>`. This method is equivalent of using :ref:`ResourceLoader.load<class_ResourceLoader_method_load>` with :ref:`ResourceLoader.CACHE_MODE_REUSE<class_ResourceLoader_constant_CACHE_MODE_REUSE>`.
|
||||
|
||||
@@ -1017,7 +1017,7 @@ This function is a simplified version of :ref:`ResourceLoader.load<class_Resourc
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Resource<class_Resource>` **preload** **(** :ref:`String<class_String>` path **)**
|
||||
:ref:`Resource<class_Resource>` **preload**\ (\ path\: :ref:`String<class_String>`\ )
|
||||
|
||||
Returns a :ref:`Resource<class_Resource>` from the filesystem located at ``path``. During run-time, the resource is loaded when the script is being parsed. This function effectively acts as a reference to that resource. Note that this function requires ``path`` to be a constant :ref:`String<class_String>`. If you want to load a resource from a dynamic/variable path, use :ref:`load<class_@GDScript_method_load>`.
|
||||
|
||||
@@ -1036,7 +1036,7 @@ Returns a :ref:`Resource<class_Resource>` from the filesystem located at ``path`
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **print_debug** **(** ... **)** |vararg|
|
||||
|void| **print_debug**\ (\ ...\ ) |vararg|
|
||||
|
||||
Like :ref:`@GlobalScope.print<class_@GlobalScope_method_print>`, but includes the current stack frame when running with the debugger turned on.
|
||||
|
||||
@@ -1057,7 +1057,7 @@ The output in the console may look like the following:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **print_stack** **(** **)**
|
||||
|void| **print_stack**\ (\ )
|
||||
|
||||
Prints a stack trace at the current code location. See also :ref:`get_stack<class_@GDScript_method_get_stack>`.
|
||||
|
||||
@@ -1079,7 +1079,7 @@ The output in the console may look like the following:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **range** **(** ... **)** |vararg|
|
||||
:ref:`Array<class_Array>` **range**\ (\ ...\ ) |vararg|
|
||||
|
||||
Returns an array with the given range. :ref:`range<class_@GDScript_method_range>` can be called in three ways:
|
||||
|
||||
@@ -1141,7 +1141,7 @@ Output:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **type_exists** **(** :ref:`StringName<class_StringName>` type **)**
|
||||
:ref:`bool<class_bool>` **type_exists**\ (\ type\: :ref:`StringName<class_StringName>`\ )
|
||||
|
||||
Returns ``true`` if the given :ref:`Object<class_Object>`-derived class exists in :ref:`ClassDB<class_ClassDB>`. Note that :ref:`Variant<class_Variant>` data types are not registered in :ref:`ClassDB<class_ClassDB>`.
|
||||
|
||||
@@ -1157,3 +1157,4 @@ Returns ``true`` if the given :ref:`Object<class_Object>`-derived class exists i
|
||||
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
||||
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|
||||
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|
||||
.. |void| replace:: :abbr:`void (No return value.)`
|
||||
|
||||
Reference in New Issue
Block a user