mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
classref: Sync with current 4.0 branch (d0c0d44)
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/gdscript/doc_classes/@GDScript.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.0/modules/gdscript/doc_classes/@GDScript.xml.
|
||||
|
||||
.. _class_@GDScript:
|
||||
|
||||
@@ -133,7 +133,7 @@ Mark the following property as exported (editable in the Inspector dock and save
|
||||
@export var string = ""
|
||||
@export var int_number = 5
|
||||
@export var float_number: float = 5
|
||||
@export var image : Image
|
||||
@export var image: Image
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -173,7 +173,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_COLOR_NO_ALPHA<class_@GlobalScope_cons
|
||||
|
||||
::
|
||||
|
||||
@export_color_no_alpha var dye_color : Color
|
||||
@export_color_no_alpha var dye_color: Color
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -465,7 +465,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_FILE<class_@GlobalScope_constan
|
||||
|
||||
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.
|
||||
|
||||
If no ``prefix`` is provided, the every following property is added to the group. The group ends when then next group or category is defined. You can also force end a group by using this annotation with empty strings for parameters, ``@export_group("", "")``.
|
||||
If no ``prefix`` is provided, then every following property will be added to the group. The group ends when then next group or category is defined. You can also force end a group by using this annotation with empty strings for parameters, ``@export_group("", "")``.
|
||||
|
||||
Groups cannot be nested, use :ref:`@export_subgroup<class_@GDScript_annotation_@export_subgroup>` to add subgroups within groups.
|
||||
|
||||
@@ -712,7 +712,7 @@ Method Descriptions
|
||||
|
||||
: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 **)**
|
||||
|
||||
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.
|
||||
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>`.
|
||||
|
||||
::
|
||||
|
||||
@@ -720,6 +720,8 @@ Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``
|
||||
var dark_blue = Color8(0, 0, 51) # Same as Color(0, 0, 0.2).
|
||||
var my_color = Color8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4).
|
||||
|
||||
\ **Note:** Due to the lower precision of :ref:`Color8<class_@GDScript_method_Color8>` compared to the standard :ref:`Color<class_Color>` constructor, a color created with :ref:`Color8<class_@GDScript_method_Color8>` will generally not be equal to the same color created with the standard :ref:`Color<class_Color>` constructor. Use :ref:`Color.is_equal_approx<class_Color_method_is_equal_approx>` for comparisons to avoid issues with floating-point precision error.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
@@ -887,7 +889,7 @@ Examples:
|
||||
print(is_instance_of(a, MyClass))
|
||||
print(is_instance_of(a, MyClass.InnerClass))
|
||||
|
||||
\ **Note:** If ``value`` and/or ``type`` are freed objects (see :ref:`@GlobalScope.is_instance_valid<class_@GlobalScope_method_is_instance_valid>`), or ``type`` is not one of the above options, this method will raise an runtime error.
|
||||
\ **Note:** If ``value`` and/or ``type`` are freed objects (see :ref:`@GlobalScope.is_instance_valid<class_@GlobalScope_method_is_instance_valid>`), or ``type`` is not one of the above options, this method will raise a runtime error.
|
||||
|
||||
See also :ref:`@GlobalScope.typeof<class_@GlobalScope_method_typeof>`, :ref:`type_exists<class_@GDScript_method_type_exists>`, :ref:`Array.is_same_typed<class_Array_method_is_same_typed>` (and other :ref:`Array<class_Array>` methods).
|
||||
|
||||
@@ -936,6 +938,8 @@ This function is a simplified version of :ref:`ResourceLoader.load<class_Resourc
|
||||
|
||||
\ **Note:** Files have to be imported into the engine first to load them using this function. If you want to load :ref:`Image<class_Image>`\ s at run-time, you may use :ref:`Image.load<class_Image_method_load>`. If you want to import audio files, you can use the snippet described in :ref:`AudioStreamMP3.data<class_AudioStreamMP3_property_data>`.
|
||||
|
||||
\ **Note:** If :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary<class_ProjectSettings_property_editor/export/convert_text_resources_to_binary>` is ``true``, :ref:`load<class_@GDScript_method_load>` will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary<class_ProjectSettings_property_editor/export/convert_text_resources_to_binary>` to ``false``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user