mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
1181 lines
96 KiB
ReStructuredText
1181 lines
96 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_Theme:
|
||
|
||
Theme
|
||
=====
|
||
|
||
**Наследует:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
Ресурс, используемый для стилизации/скининга оформления :ref:`Control<class_Control>` и :ref:`Window<class_Window>`.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Описание
|
||
----------------
|
||
|
||
Ресурс, используемый для стилизации/стиля узлов :ref:`Control<class_Control>` и :ref:`Window<class_Window>`. В то время как отдельные элементы управления могут быть стилизованы с использованием их локальных переопределений темы (см. :ref:`Control.add_theme_color_override()<class_Control_method_add_theme_color_override>`), ресурсы темы позволяют вам хранить и применять одни и те же настройки ко всем элементам управления, разделяющим один и тот же тип (например, стилизовать все :ref:`Button<class_Button>` одинаково). Один ресурс темы можно использовать для всего проекта, но вы также можете установить отдельный ресурс темы для ветви узлов управления. Ресурс темы, назначенный элементу управления, применяется к самому элементу управления, а также ко всем его прямым и косвенным дочерним элементам (при условии, что цепочка элементов управления не прерывается).
|
||
|
||
Используйте :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`, чтобы настроить тему области проекта, которая будет доступна для каждого элемента управления в вашем проекте.
|
||
|
||
Используйте :ref:`Control.theme<class_Control_property_theme>` любого узла управления, чтобы настроить тему, которая будет доступна для этого элемента управления и всех его прямых и косвенных дочерних элементов.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Обучающие материалы
|
||
--------------------------------------
|
||
|
||
- :doc:`GUI скины <../tutorials/ui/gui_skinning>`
|
||
|
||
- :doc:`Использование редактора тем <../tutorials/ui/gui_using_theme_editor>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Свойства
|
||
----------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------+--------------------------------------------------------------------+---------+
|
||
| :ref:`float<class_float>` | :ref:`default_base_scale<class_Theme_property_default_base_scale>` | ``0.0`` |
|
||
+---------------------------+--------------------------------------------------------------------+---------+
|
||
| :ref:`Font<class_Font>` | :ref:`default_font<class_Theme_property_default_font>` | |
|
||
+---------------------------+--------------------------------------------------------------------+---------+
|
||
| :ref:`int<class_int>` | :ref:`default_font_size<class_Theme_property_default_font_size>` | ``-1`` |
|
||
+---------------------------+--------------------------------------------------------------------+---------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Методы
|
||
------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_type<class_Theme_method_add_type>`\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear<class_Theme_method_clear>`\ (\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_color<class_Theme_method_clear_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_constant<class_Theme_method_clear_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_font<class_Theme_method_clear_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_font_size<class_Theme_method_clear_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_icon<class_Theme_method_clear_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_stylebox<class_Theme_method_clear_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_theme_item<class_Theme_method_clear_theme_item>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_type_variation<class_Theme_method_clear_type_variation>`\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_color<class_Theme_method_get_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_color_list<class_Theme_method_get_color_list>`\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_color_type_list<class_Theme_method_get_color_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_constant<class_Theme_method_get_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_constant_list<class_Theme_method_get_constant_list>`\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_constant_type_list<class_Theme_method_get_constant_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`get_font<class_Theme_method_get_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_list<class_Theme_method_get_font_list>`\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_font_size<class_Theme_method_get_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_size_list<class_Theme_method_get_font_size_list>`\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_size_type_list<class_Theme_method_get_font_size_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_type_list<class_Theme_method_get_font_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon<class_Theme_method_get_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_icon_list<class_Theme_method_get_icon_list>`\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_icon_type_list<class_Theme_method_get_icon_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`get_stylebox<class_Theme_method_get_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_stylebox_type_list<class_Theme_method_get_stylebox_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`get_theme_item<class_Theme_method_get_theme_item>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, theme_type\: :ref:`String<class_String>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_theme_item_type_list<class_Theme_method_get_theme_item_type_list>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_type_list<class_Theme_method_get_type_list>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`get_type_variation_base<class_Theme_method_get_type_variation_base>`\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_type_variation_list<class_Theme_method_get_type_variation_list>`\ (\ base_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_method_has_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_method_has_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_default_base_scale<class_Theme_method_has_default_base_scale>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_default_font<class_Theme_method_has_default_font>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_default_font_size<class_Theme_method_has_default_font_size>`\ (\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_font<class_Theme_method_has_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_font_size<class_Theme_method_has_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_method_has_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_method_has_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_item<class_Theme_method_has_theme_item>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_type_variation<class_Theme_method_is_type_variation>`\ (\ theme_type\: :ref:`StringName<class_StringName>`, base_type\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`merge_with<class_Theme_method_merge_with>`\ (\ other\: :ref:`Theme<class_Theme>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_type<class_Theme_method_remove_type>`\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_color<class_Theme_method_rename_color>`\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_constant<class_Theme_method_rename_constant>`\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_font<class_Theme_method_rename_font>`\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_font_size<class_Theme_method_rename_font_size>`\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_icon<class_Theme_method_rename_icon>`\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_stylebox<class_Theme_method_rename_stylebox>`\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_theme_item<class_Theme_method_rename_theme_item>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rename_type<class_Theme_method_rename_type>`\ (\ old_theme_type\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_color<class_Theme_method_set_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_constant<class_Theme_method_set_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_font<class_Theme_method_set_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_font_size<class_Theme_method_set_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, font_size\: :ref:`int<class_int>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_icon<class_Theme_method_set_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_stylebox<class_Theme_method_set_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, texture\: :ref:`StyleBox<class_StyleBox>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_theme_item<class_Theme_method_set_theme_item>`\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_type_variation<class_Theme_method_set_type_variation>`\ (\ theme_type\: :ref:`StringName<class_StringName>`, base_type\: :ref:`StringName<class_StringName>`\ ) |
|
||
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Перечисления
|
||
------------------------
|
||
|
||
.. _enum_Theme_DataType:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **DataType**: :ref:`🔗<enum_Theme_DataType>`
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_COLOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_COLOR** = ``0``
|
||
|
||
Тип элемента темы :ref:`Color<class_Color>`.
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_CONSTANT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_CONSTANT** = ``1``
|
||
|
||
Константный тип элемента темы.
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_FONT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_FONT** = ``2``
|
||
|
||
Тип элемента темы :ref:`Font<class_Font>`.
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_FONT_SIZE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_FONT_SIZE** = ``3``
|
||
|
||
Тип элемента размера шрифта темы.
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_ICON:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_ICON** = ``4``
|
||
|
||
Значок темы :ref:`Texture2D<class_Texture2D>` тип элемента.
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_STYLEBOX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_STYLEBOX** = ``5``
|
||
|
||
Тип элемента темы :ref:`StyleBox<class_StyleBox>`.
|
||
|
||
.. _class_Theme_constant_DATA_TYPE_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_MAX** = ``6``
|
||
|
||
Максимальное значение для перечисления DataType.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описания свойств
|
||
--------------------------------
|
||
|
||
.. _class_Theme_property_default_base_scale:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **default_base_scale** = ``0.0`` :ref:`🔗<class_Theme_property_default_base_scale>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_default_base_scale**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_default_base_scale**\ (\ )
|
||
|
||
Базовый масштабный коэффициент по умолчанию для этого ресурса темы. Используется некоторыми элементами управления для масштабирования их визуальных свойств на основе глобального масштабного коэффициента. Если это значение установлено на ``0.0``, используется глобальный масштабный коэффициент (см. :ref:`ThemeDB.fallback_base_scale<class_ThemeDB_property_fallback_base_scale>`).
|
||
|
||
Используйте :ref:`has_default_base_scale()<class_Theme_method_has_default_base_scale>`, чтобы проверить, является ли это значение допустимым.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_property_default_font:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Font<class_Font>` **default_font** :ref:`🔗<class_Theme_property_default_font>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_default_font**\ (\ value\: :ref:`Font<class_Font>`\ )
|
||
- :ref:`Font<class_Font>` **get_default_font**\ (\ )
|
||
|
||
Шрифт по умолчанию этого ресурса темы. Используется как значение по умолчанию при попытке получить ресурс шрифта, который не существует в этой теме или находится в недопустимом состоянии. Если шрифт по умолчанию также отсутствует или недопустим, используется резервное значение движка (см. :ref:`ThemeDB.fallback_font<class_ThemeDB_property_fallback_font>`).
|
||
|
||
Используйте :ref:`has_default_font()<class_Theme_method_has_default_font>`, чтобы проверить, является ли это значение допустимым.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_property_default_font_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **default_font_size** = ``-1`` :ref:`🔗<class_Theme_property_default_font_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_default_font_size**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_default_font_size**\ (\ )
|
||
|
||
Размер шрифта по умолчанию для этого ресурса темы. Используется как значение по умолчанию при попытке получить значение размера шрифта, которого нет в этой теме или которое находится в недопустимом состоянии. Если размер шрифта по умолчанию также отсутствует или недопустим, используется резервное значение движка (см. :ref:`ThemeDB.fallback_font_size<class_ThemeDB_property_fallback_font_size>`).
|
||
|
||
Значения ниже ``1`` недействительны и могут использоваться для сброса свойства. Используйте :ref:`has_default_font_size()<class_Theme_method_has_default_font_size>`, чтобы проверить, является ли это значение допустимым.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описания метода
|
||
------------------------------
|
||
|
||
.. _class_Theme_method_add_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_type**\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_add_type>`
|
||
|
||
Добавляет пустой тип темы для каждого допустимого типа данных.
|
||
|
||
\ **Примечание:** Пустые типы не сохраняются с темой. Этот метод существует только для выполнения изменений в памяти ресурса. Используйте доступные методы ``set_*`` для добавления элементов темы.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear**\ (\ ) :ref:`🔗<class_Theme_method_clear>`
|
||
|
||
Удаляет все свойства темы, определенные в ресурсе темы.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_color>`
|
||
|
||
Удаляет свойство :ref:`Color<class_Color>`, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_color()<class_Theme_method_has_color>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_constant>`
|
||
|
||
Удаляет константное свойство, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_constant()<class_Theme_method_has_constant>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_font>`
|
||
|
||
Удаляет свойство :ref:`Font<class_Font>`, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_font()<class_Theme_method_has_font>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_font_size>`
|
||
|
||
Удаляет свойство размера шрифта, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_font_size()<class_Theme_method_has_font_size>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_icon>`
|
||
|
||
Удаляет свойство значка, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_icon()<class_Theme_method_has_icon>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_stylebox>`
|
||
|
||
Удаляет свойство :ref:`StyleBox<class_StyleBox>`, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_stylebox()<class_Theme_method_has_stylebox>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_theme_item:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_theme_item**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_theme_item>`
|
||
|
||
Удаляет свойство темы ``data_type``, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Не выполняется, если оно не существует. Используйте :ref:`has_theme_item()<class_Theme_method_has_theme_item>` для проверки существования.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более общей логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_clear_type_variation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_type_variation**\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_clear_type_variation>`
|
||
|
||
Снимает отметку ``theme_type`` как вариации другого типа темы. См. :ref:`set_type_variation()<class_Theme_method_set_type_variation>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_color>`
|
||
|
||
Возвращает свойство :ref:`Color<class_Color>`, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает значение цвета по умолчанию, если свойство не существует. Используйте :ref:`has_color()<class_Theme_method_has_color>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_color_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_color_list**\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_color_list>`
|
||
|
||
Возвращает список имен для свойств :ref:`Color<class_Color>`, определенных с помощью ``theme_type``. Используйте :ref:`get_color_type_list()<class_Theme_method_get_color_type_list>`, чтобы получить список возможных имен типов темы.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_color_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_color_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_color_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для свойств :ref:`Color<class_Color>`. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_constant>`
|
||
|
||
Возвращает константное свойство, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает ``0``, если свойство не существует. Используйте :ref:`has_constant()<class_Theme_method_has_constant>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_constant_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_constant_list**\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_constant_list>`
|
||
|
||
Возвращает список имен для константных свойств, определенных с помощью ``theme_type``. Используйте :ref:`get_constant_type_list()<class_Theme_method_get_constant_type_list>` для получения списка возможных имен типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_constant_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_constant_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_constant_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для константных свойств. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Font<class_Font>` **get_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_font>`
|
||
|
||
Возвращает свойство :ref:`Font<class_Font>`, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает шрифт темы по умолчанию, если свойство не существует и шрифт темы по умолчанию установлен (см. :ref:`default_font<class_Theme_property_default_font>`). Используйте :ref:`has_font()<class_Theme_method_has_font>` для проверки существования свойства и :ref:`has_default_font()<class_Theme_method_has_default_font>` для проверки существования шрифта темы по умолчанию.
|
||
|
||
Возвращает значение резервного шрифта движка, если ни один из них не существует (см. :ref:`ThemeDB.fallback_font<class_ThemeDB_property_fallback_font>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_font_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_font_list**\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_font_list>`
|
||
|
||
Возвращает список имен для свойств :ref:`Font<class_Font>`, определенных с помощью ``theme_type``. Используйте :ref:`get_font_type_list()<class_Theme_method_get_font_type_list>`, чтобы получить список возможных имен типов темы.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_font_size>`
|
||
|
||
Возвращает свойство размера шрифта, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает размер шрифта темы по умолчанию, если свойство не существует и размер шрифта темы по умолчанию установлен (см. :ref:`default_font_size<class_Theme_property_default_font_size>`). Используйте :ref:`has_font_size()<class_Theme_method_has_font_size>` для проверки существования свойства и :ref:`has_default_font_size()<class_Theme_method_has_default_font_size>` для проверки существования шрифта темы по умолчанию.
|
||
|
||
Возвращает значение резервного размера шрифта движка, если ни то, ни другое не существует (см. :ref:`ThemeDB.fallback_font_size<class_ThemeDB_property_fallback_font_size>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_font_size_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_font_size_list**\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_font_size_list>`
|
||
|
||
Возвращает список имен для свойств размера шрифта, определенных с помощью ``theme_type``. Используйте :ref:`get_font_size_type_list()<class_Theme_method_get_font_size_type_list>`, чтобы получить список возможных имен типов темы.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_font_size_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_font_size_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_font_size_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для свойств размера шрифта. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_font_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_font_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_font_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для свойств :ref:`Font<class_Font>`. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_icon>`
|
||
|
||
Возвращает свойство значка, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает значение значка резервного движка, если свойство не существует (см. :ref:`ThemeDB.fallback_icon<class_ThemeDB_property_fallback_icon>`). Используйте :ref:`has_icon()<class_Theme_method_has_icon>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_icon_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_icon_list**\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_icon_list>`
|
||
|
||
Возвращает список имен для свойств значка, определенных с помощью ``theme_type``. Используйте :ref:`get_icon_type_list()<class_Theme_method_get_icon_type_list>` для получения списка возможных имен типов темы.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_icon_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_icon_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_icon_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для свойств значка. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **get_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_stylebox>`
|
||
|
||
Возвращает свойство :ref:`StyleBox<class_StyleBox>`, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает резервное значение stylebox движка, если свойство не существует (см. :ref:`ThemeDB.fallback_stylebox<class_ThemeDB_property_fallback_stylebox>`). Используйте :ref:`has_stylebox()<class_Theme_method_has_stylebox>` для проверки существования.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_stylebox_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_stylebox_list**\ (\ theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_stylebox_list>`
|
||
|
||
Возвращает список имен для свойств :ref:`StyleBox<class_StyleBox>`, определенных с помощью ``theme_type``. Используйте :ref:`get_stylebox_type_list()<class_Theme_method_get_stylebox_type_list>`, чтобы получить список возможных имен типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_stylebox_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_stylebox_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_stylebox_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для свойств :ref:`StyleBox<class_StyleBox>`. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_theme_item:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **get_theme_item**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_theme_item>`
|
||
|
||
Возвращает свойство темы ``data_type``, определенное ``name`` и ``theme_type``, если оно существует.
|
||
|
||
Возвращает резервное значение движка, если свойство не существует (см. :ref:`ThemeDB<class_ThemeDB>`). Используйте :ref:`has_theme_item()<class_Theme_method_has_theme_item>` для проверки существования.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более обобщенной логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_theme_item_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_theme_item_list**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, theme_type\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Theme_method_get_theme_item_list>`
|
||
|
||
Возвращает список имен для свойств ``data_type``, определенных с помощью ``theme_type``. Используйте :ref:`get_theme_item_type_list()<class_Theme_method_get_theme_item_type_list>`, чтобы получить список возможных имен типов темы.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более обобщенной логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_theme_item_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_theme_item_type_list**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`\ ) |const| :ref:`🔗<class_Theme_method_get_theme_item_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем для свойств ``data_type``. Используйте :ref:`get_type_list()<class_Theme_method_get_type_list>`, чтобы получить список всех уникальных типов тем.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более обобщенной логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_type_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_type_list**\ (\ ) |const| :ref:`🔗<class_Theme_method_get_type_list>`
|
||
|
||
Возвращает список всех уникальных названий типов тем. Используйте соответствующий метод ``get_*_type_list``, чтобы получить список уникальных типов тем для одного типа данных.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_type_variation_base:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **get_type_variation_base**\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_type_variation_base>`
|
||
|
||
Возвращает имя базового типа темы, если ``theme_type`` является допустимым типом вариации. В противном случае возвращает пустую строку.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_get_type_variation_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_type_variation_list**\ (\ base_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_get_type_variation_list>`
|
||
|
||
Возвращает список всех вариаций типов для заданного ``base_type``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_color>`
|
||
|
||
Возвращает ``true``, если свойство :ref:`Color<class_Color>`, определенное ``name`` и ``theme_type``, существует.
|
||
|
||
Возвращает ``false``, если оно не существует. Используйте :ref:`set_color()<class_Theme_method_set_color>`, чтобы определить его.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_constant>`
|
||
|
||
Возвращает ``true``, если константное свойство, определенное ``name`` и ``theme_type``, существует.
|
||
|
||
Возвращает ``false``, если оно не существует. Используйте :ref:`set_constant()<class_Theme_method_set_constant>`, чтобы определить его.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_default_base_scale:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_default_base_scale**\ (\ ) |const| :ref:`🔗<class_Theme_method_has_default_base_scale>`
|
||
|
||
Возвращает ``true``, если :ref:`default_base_scale<class_Theme_property_default_base_scale>` имеет допустимое значение.
|
||
|
||
Возвращает ``false``, если нет. Значение должно быть больше ``0.0``, чтобы считаться допустимым.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_default_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_default_font**\ (\ ) |const| :ref:`🔗<class_Theme_method_has_default_font>`
|
||
|
||
Возвращает ``true``, если :ref:`default_font<class_Theme_property_default_font>` имеет допустимое значение.
|
||
|
||
Возвращает ``false``, если нет.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_default_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_default_font_size**\ (\ ) |const| :ref:`🔗<class_Theme_method_has_default_font_size>`
|
||
|
||
Возвращает ``true``, если :ref:`default_font_size<class_Theme_property_default_font_size>` имеет допустимое значение.
|
||
|
||
Возвращает ``false``, если нет. Значение должно быть больше ``0``, чтобы считаться допустимым.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_font>`
|
||
|
||
Возвращает ``true``, если свойство :ref:`Font<class_Font>`, определенное ``name`` и ``theme_type``, существует, или если установлен шрифт темы по умолчанию (см. :ref:`has_default_font()<class_Theme_method_has_default_font>`).
|
||
|
||
Возвращает ``false``, если ни то, ни другое не существует. Используйте :ref:`set_font()<class_Theme_method_set_font>` для определения свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_font_size>`
|
||
|
||
Возвращает ``true``, если свойство размера шрифта, определенное ``name`` и ``theme_type``, существует, или если установлен размер шрифта темы по умолчанию (см. :ref:`has_default_font_size()<class_Theme_method_has_default_font_size>`).
|
||
|
||
Возвращает ``false``, если ни то, ни другое не существует. Используйте :ref:`set_font_size()<class_Theme_method_set_font_size>` для определения свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_icon>`
|
||
|
||
Возвращает ``true``, если свойство значка, определенное ``name`` и ``theme_type``, существует.
|
||
|
||
Возвращает ``false``, если оно не существует. Используйте :ref:`set_icon()<class_Theme_method_set_icon>`, чтобы определить его.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_stylebox>`
|
||
|
||
Возвращает ``true``, если свойство :ref:`StyleBox<class_StyleBox>`, определенное ``name`` и ``theme_type``, существует.
|
||
|
||
Возвращает ``false``, если оно не существует. Используйте :ref:`set_stylebox()<class_Theme_method_set_stylebox>`, чтобы определить его.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_has_theme_item:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_item**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_has_theme_item>`
|
||
|
||
Возвращает ``true``, если свойство темы ``data_type``, определенное ``name`` и ``theme_type``, существует.
|
||
|
||
Возвращает ``false``, если оно не существует. Используйте :ref:`set_theme_item()<class_Theme_method_set_theme_item>`, чтобы определить его.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более обобщенной логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_is_type_variation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_type_variation**\ (\ theme_type\: :ref:`StringName<class_StringName>`, base_type\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Theme_method_is_type_variation>`
|
||
|
||
Возвращает ``true``, если ``theme_type`` отмечен как вариация ``base_type``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_merge_with:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **merge_with**\ (\ other\: :ref:`Theme<class_Theme>`\ ) :ref:`🔗<class_Theme_method_merge_with>`
|
||
|
||
Добавляет отсутствующие и переопределяет существующие определения значениями из ресурса темы ``other``.
|
||
|
||
\ **Примечание:** Это изменяет текущую тему. Если вы хотите объединить две темы, не изменяя ни одну из них, создайте новую пустую тему и объедините в нее две другие одну за другой.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_remove_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_type**\ (\ theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_remove_type>`
|
||
|
||
Удаляет тип темы, изящно отбрасывая определенные элементы темы. Если тип является вариацией, эта информация также стирается. Если тип является базой для вариаций типа, эти вариации теряют свою базу.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_color**\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_color>`
|
||
|
||
Переименовывает свойство :ref:`Color<class_Color>`, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Не удается, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_color()<class_Theme_method_has_color>` для проверки существования и :ref:`clear_color()<class_Theme_method_clear_color>` для удаления существующего свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_constant**\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_constant>`
|
||
|
||
Переименовывает константное свойство, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Не удается, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_constant()<class_Theme_method_has_constant>` для проверки существования и :ref:`clear_constant()<class_Theme_method_clear_constant>` для удаления существующего свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_font**\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_font>`
|
||
|
||
Переименовывает свойство :ref:`Font<class_Font>`, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Не удается, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_font()<class_Theme_method_has_font>` для проверки существования и :ref:`clear_font()<class_Theme_method_clear_font>` для удаления существующего свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_font_size**\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_font_size>`
|
||
|
||
Переименовывает свойство размера шрифта, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Не удается, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_font_size()<class_Theme_method_has_font_size>` для проверки существования и :ref:`clear_font_size()<class_Theme_method_clear_font_size>` для удаления существующего свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_icon**\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_icon>`
|
||
|
||
Переименовывает свойство значка, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Не удается, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_icon()<class_Theme_method_has_icon>` для проверки существования и :ref:`clear_icon()<class_Theme_method_clear_icon>` для удаления существующего свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_stylebox**\ (\ old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_stylebox>`
|
||
|
||
Переименовывает свойство :ref:`StyleBox<class_StyleBox>`, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Не удается, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_stylebox()<class_Theme_method_has_stylebox>` для проверки существования и :ref:`clear_stylebox()<class_Theme_method_clear_stylebox>` для удаления существующего свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_theme_item:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_theme_item**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, old_name\: :ref:`StringName<class_StringName>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_theme_item>`
|
||
|
||
Переименовывает свойство темы ``data_type``, определенное ``old_name`` и ``theme_type``, в ``name``, если оно существует.
|
||
|
||
Неудача, если оно не существует или если похожее свойство с новым именем уже существует. Используйте :ref:`has_theme_item()<class_Theme_method_has_theme_item>` для проверки существования и :ref:`clear_theme_item()<class_Theme_method_clear_theme_item>` для удаления существующего свойства.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более общей логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_rename_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rename_type**\ (\ old_theme_type\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_rename_type>`
|
||
|
||
Переименовывает тип темы ``old_theme_type`` в ``theme_type``, если старый тип существует, а новый — нет.
|
||
|
||
\ **Примечание:** Переименование типа темы в пустое имя или вариации в тип, связанный со встроенным классом, удаляет связи между вариациями типов таким образом, что это нельзя отменить, просто отменив переименование.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Theme_method_set_color>`
|
||
|
||
Создает или изменяет значение свойства :ref:`Color<class_Color>`, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_color()<class_Theme_method_clear_color>` для удаления свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Theme_method_set_constant>`
|
||
|
||
Создает или изменяет значение константного свойства, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_constant()<class_Theme_method_clear_constant>` для удаления свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) :ref:`🔗<class_Theme_method_set_font>`
|
||
|
||
Создает или изменяет значение свойства :ref:`Font<class_Font>`, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_font()<class_Theme_method_clear_font>` для удаления свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, font_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Theme_method_set_font_size>`
|
||
|
||
Создает или изменяет значение свойства размера шрифта, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_font_size()<class_Theme_method_clear_font_size>` для удаления свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_Theme_method_set_icon>`
|
||
|
||
Создает или изменяет значение свойства значка, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_icon()<class_Theme_method_clear_icon>` для удаления свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, texture\: :ref:`StyleBox<class_StyleBox>`\ ) :ref:`🔗<class_Theme_method_set_stylebox>`
|
||
|
||
Создает или изменяет значение свойства :ref:`StyleBox<class_StyleBox>`, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_stylebox()<class_Theme_method_clear_stylebox>` для удаления свойства.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_theme_item:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_theme_item**\ (\ data_type\: :ref:`DataType<enum_Theme_DataType>`, name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_Theme_method_set_theme_item>`
|
||
|
||
Создает или изменяет значение свойства темы ``data_type``, определенного ``name`` и ``theme_type``. Используйте :ref:`clear_theme_item()<class_Theme_method_clear_theme_item>`, чтобы удалить свойство.
|
||
|
||
Завершается сбоем, если тип ``value`` не принимается ``data_type``.
|
||
|
||
\ **Примечание:** Этот метод аналогичен вызову соответствующего метода, специфичного для типа данных, но может использоваться для более обобщенной логики.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Theme_method_set_type_variation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_type_variation**\ (\ theme_type\: :ref:`StringName<class_StringName>`, base_type\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Theme_method_set_type_variation>`
|
||
|
||
Отмечает ``theme_type`` как вариант ``base_type``.
|
||
|
||
Это добавляет ``theme_type`` как предлагаемый вариант для :ref:`Control.theme_type_variation<class_Control_property_theme_type_variation>` в :ref:`Control<class_Control>`, который принадлежит классу ``base_type``.
|
||
|
||
Вариации также могут быть вложенными, т. е. ``base_type`` может быть другим вариантом. Если цепочка вариантов заканчивается ``base_type``, соответствующим классу :ref:`Control<class_Control>`, вся цепочка будет предложена в качестве вариантов.
|
||
|
||
\ **Примечание:** Предложения отображаются только в том случае, если этот ресурс темы установлен в качестве темы проекта по умолчанию. См. :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Этот метод не имеет побочных эффектов. Он не изменяет ни одну из переменных-членов экземпляра.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Этот метод принимает любое количество аргументов после описанных здесь.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Этот метод используется для создания типа.)`
|
||
.. |static| replace:: :abbr:`static (Этот метод не нуждается в вызове экземпляра, поэтому его можно вызвать напрямую, используя имя класса.)`
|
||
.. |operator| replace:: :abbr:`operator (Этот метод описывает допустимый оператор для использования с этим типом в качестве левого операнда.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Это значение является целым числом, составленным как битовая маска следующих флагов.)`
|
||
.. |void| replace:: :abbr:`void (Нет возвращаемого значения.)`
|