mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
855 lines
71 KiB
ReStructuredText
855 lines
71 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the Theme.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_Theme:
|
|
|
|
Theme
|
|
=====
|
|
|
|
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Theme resource for styling/skinning :ref:`Control<class_Control>`\ s and :ref:`Window<class_Window>`\ s.
|
|
|
|
Description
|
|
-----------
|
|
|
|
A theme resource is used for styling/skinning :ref:`Control<class_Control>` and :ref:`Window<class_Window>` nodes. While individual controls can be styled using their local theme overrides (see :ref:`Control.add_theme_color_override<class_Control_method_add_theme_color_override>`), theme resources allow you to store and apply the same settings between all controls sharing the same type (e.g. style all :ref:`Button<class_Button>`\ s the same). One theme resource can be used for the entire project, but you can also set a separate theme resource to a branch of control nodes. A theme resources assigned to a control node applies to the control itself, as well as all of its direct and indirect children (as long as a chain of controls is uninterrupted).
|
|
|
|
Use :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>` to set up a project-scope theme that will be available to every control in your project.
|
|
|
|
Use :ref:`Control.theme<class_Control_property_theme>` of any control node to set up a theme that will be available to that control and all of its direct and indirect children.
|
|
|
|
Tutorials
|
|
---------
|
|
|
|
- :doc:`GUI skinning <../tutorials/ui/gui_skinning>`
|
|
|
|
- :doc:`Using the theme editor <../tutorials/ui/gui_using_theme_editor>`
|
|
|
|
Properties
|
|
----------
|
|
|
|
+---------------------------+--------------------------------------------------------------------+---------+
|
|
| :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`` |
|
|
+---------------------------+--------------------------------------------------------------------+---------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_type<class_Theme_method_add_type>` **(** :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear<class_Theme_method_clear>` **(** **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_color<class_Theme_method_clear_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_constant<class_Theme_method_clear_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_font<class_Theme_method_clear_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_font_size<class_Theme_method_clear_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_icon<class_Theme_method_clear_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_type_variation<class_Theme_method_clear_type_variation>` **(** :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_color<class_Theme_method_get_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_color_list<class_Theme_method_get_color_list>` **(** :ref:`String<class_String>` theme_type **)** |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>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_constant_list<class_Theme_method_get_constant_list>` **(** :ref:`String<class_String>` theme_type **)** |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>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_list<class_Theme_method_get_font_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_font_size<class_Theme_method_get_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_size_list<class_Theme_method_get_font_size_list>` **(** :ref:`String<class_String>` theme_type **)** |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>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_icon_list<class_Theme_method_get_icon_list>` **(** :ref:`String<class_String>` theme_type **)** |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>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>` **(** :ref:`String<class_String>` theme_type **)** |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>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_theme_item_type_list<class_Theme_method_get_theme_item_type_list>` **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |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>` **(** :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_type_variation_list<class_Theme_method_get_type_variation_list>` **(** :ref:`StringName<class_StringName>` base_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_method_has_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_method_has_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |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>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_font_size<class_Theme_method_has_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_method_has_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_method_has_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_theme_item<class_Theme_method_has_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_type_variation<class_Theme_method_is_type_variation>` **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)** |const| |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`merge_with<class_Theme_method_merge_with>` **(** :ref:`Theme<class_Theme>` other **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_type<class_Theme_method_remove_type>` **(** :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_color<class_Theme_method_rename_color>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_constant<class_Theme_method_rename_constant>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_font<class_Theme_method_rename_font>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_font_size<class_Theme_method_rename_font_size>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_icon<class_Theme_method_rename_icon>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_stylebox<class_Theme_method_rename_stylebox>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rename_theme_item<class_Theme_method_rename_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_color<class_Theme_method_set_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Color<class_Color>` color **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_constant<class_Theme_method_set_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` constant **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_font<class_Theme_method_set_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Font<class_Font>` font **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_font_size<class_Theme_method_set_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` font_size **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_icon<class_Theme_method_set_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Texture2D<class_Texture2D>` texture **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_stylebox<class_Theme_method_set_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_theme_item<class_Theme_method_set_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Variant<class_Variant>` value **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_type_variation<class_Theme_method_set_type_variation>` **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)** |
|
|
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_Theme_DataType:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_COLOR:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_CONSTANT:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_FONT:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_FONT_SIZE:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_ICON:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_STYLEBOX:
|
|
|
|
.. _class_Theme_constant_DATA_TYPE_MAX:
|
|
|
|
enum **DataType**:
|
|
|
|
- **DATA_TYPE_COLOR** = **0** --- Theme's :ref:`Color<class_Color>` item type.
|
|
|
|
- **DATA_TYPE_CONSTANT** = **1** --- Theme's constant item type.
|
|
|
|
- **DATA_TYPE_FONT** = **2** --- Theme's :ref:`Font<class_Font>` item type.
|
|
|
|
- **DATA_TYPE_FONT_SIZE** = **3** --- Theme's font size item type.
|
|
|
|
- **DATA_TYPE_ICON** = **4** --- Theme's icon :ref:`Texture2D<class_Texture2D>` item type.
|
|
|
|
- **DATA_TYPE_STYLEBOX** = **5** --- Theme's :ref:`StyleBox<class_StyleBox>` item type.
|
|
|
|
- **DATA_TYPE_MAX** = **6** --- Maximum value for the DataType enum.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_Theme_property_default_base_scale:
|
|
|
|
- :ref:`float<class_float>` **default_base_scale**
|
|
|
|
+-----------+-------------------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+-------------------------------+
|
|
| *Setter* | set_default_base_scale(value) |
|
|
+-----------+-------------------------------+
|
|
| *Getter* | get_default_base_scale() |
|
|
+-----------+-------------------------------+
|
|
|
|
The default base scale factor of this theme resource. Used by some controls to scale their visual properties based on the global scale factor. If this value is set to ``0.0``, the global scale factor is used.
|
|
|
|
Use :ref:`has_default_base_scale<class_Theme_method_has_default_base_scale>` to check if this value is valid.
|
|
|
|
----
|
|
|
|
.. _class_Theme_property_default_font:
|
|
|
|
- :ref:`Font<class_Font>` **default_font**
|
|
|
|
+----------+-------------------------+
|
|
| *Setter* | set_default_font(value) |
|
|
+----------+-------------------------+
|
|
| *Getter* | get_default_font() |
|
|
+----------+-------------------------+
|
|
|
|
The default font of this theme resource. Used as the default value when trying to fetch a font resource that doesn't exist in this theme or is in invalid state. If the default font is also missing or invalid, the engine fallback value is used.
|
|
|
|
Use :ref:`has_default_font<class_Theme_method_has_default_font>` to check if this value is valid.
|
|
|
|
----
|
|
|
|
.. _class_Theme_property_default_font_size:
|
|
|
|
- :ref:`int<class_int>` **default_font_size**
|
|
|
|
+-----------+------------------------------+
|
|
| *Default* | ``-1`` |
|
|
+-----------+------------------------------+
|
|
| *Setter* | set_default_font_size(value) |
|
|
+-----------+------------------------------+
|
|
| *Getter* | get_default_font_size() |
|
|
+-----------+------------------------------+
|
|
|
|
The default font size of this theme resource. Used as the default value when trying to fetch a font size value that doesn't exist in this theme or is in invalid state. If the default font size is also missing or invalid, the engine fallback value is used.
|
|
|
|
Values below ``0`` are invalid and can be used to unset the property. Use :ref:`has_default_font_size<class_Theme_method_has_default_font_size>` to check if this value is valid.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_Theme_method_add_type:
|
|
|
|
- void **add_type** **(** :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Adds an empty theme type for every valid data type.
|
|
|
|
\ **Note:** Empty types are not saved with the theme. This method only exists to perform in-memory changes to the resource. Use available ``set_*`` methods to add theme items.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear:
|
|
|
|
- void **clear** **(** **)**
|
|
|
|
Removes all the theme properties defined on the theme resource.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_color:
|
|
|
|
- void **clear_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the :ref:`Color<class_Color>` property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_color<class_Theme_method_has_color>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_constant:
|
|
|
|
- void **clear_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the constant property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_constant<class_Theme_method_has_constant>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_font:
|
|
|
|
- void **clear_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the :ref:`Font<class_Font>` property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_font<class_Theme_method_has_font>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_font_size:
|
|
|
|
- void **clear_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the font size property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_font_size<class_Theme_method_has_font_size>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_icon:
|
|
|
|
- void **clear_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the icon property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_icon<class_Theme_method_has_icon>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_stylebox:
|
|
|
|
- void **clear_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the :ref:`StyleBox<class_StyleBox>` property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_stylebox<class_Theme_method_has_stylebox>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_theme_item:
|
|
|
|
- void **clear_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the theme property of ``data_type`` defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Fails if it doesn't exist. Use :ref:`has_theme_item<class_Theme_method_has_theme_item>` to check for existence.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_clear_type_variation:
|
|
|
|
- void **clear_type_variation** **(** :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Unmarks ``theme_type`` as being a variation of another theme type. See :ref:`set_type_variation<class_Theme_method_set_type_variation>`.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the :ref:`Color<class_Color>` property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns the default color value if the property doesn't exist. Use :ref:`has_color<class_Theme_method_has_color>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_color_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_color_list** **(** :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for :ref:`Color<class_Color>` properties defined with ``theme_type``. Use :ref:`get_color_type_list<class_Theme_method_get_color_type_list>` to get a list of possible theme type names.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_color_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_color_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names for :ref:`Color<class_Color>` properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_constant:
|
|
|
|
- :ref:`int<class_int>` **get_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the constant property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns ``0`` if the property doesn't exist. Use :ref:`has_constant<class_Theme_method_has_constant>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_constant_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_constant_list** **(** :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for constant properties defined with ``theme_type``. Use :ref:`get_constant_type_list<class_Theme_method_get_constant_type_list>` to get a list of possible theme type names.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_constant_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_constant_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names for constant properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_font:
|
|
|
|
- :ref:`Font<class_Font>` **get_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the :ref:`Font<class_Font>` property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns the default theme font if the property doesn't exist and the default theme font is set up (see :ref:`default_font<class_Theme_property_default_font>`). Use :ref:`has_font<class_Theme_method_has_font>` to check for existence of the property and :ref:`has_default_font<class_Theme_method_has_default_font>` to check for existence of the default theme font.
|
|
|
|
Returns the engine fallback font value, if neither exist.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_font_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_font_list** **(** :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for :ref:`Font<class_Font>` properties defined with ``theme_type``. Use :ref:`get_font_type_list<class_Theme_method_get_font_type_list>` to get a list of possible theme type names.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_font_size:
|
|
|
|
- :ref:`int<class_int>` **get_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the font size property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns the default theme font size if the property doesn't exist and the default theme font size is set up (see :ref:`default_font_size<class_Theme_property_default_font_size>`). Use :ref:`has_font_size<class_Theme_method_has_font_size>` to check for existence of the property and :ref:`has_default_font_size<class_Theme_method_has_default_font_size>` to check for existence of the default theme font.
|
|
|
|
Returns the engine fallback font size value, if neither exist.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_font_size_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_font_size_list** **(** :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for font size properties defined with ``theme_type``. Use :ref:`get_font_size_type_list<class_Theme_method_get_font_size_type_list>` to get a list of possible theme type names.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_font_size_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_font_size_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names for font size properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_font_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_font_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names for :ref:`Font<class_Font>` properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_icon:
|
|
|
|
- :ref:`Texture2D<class_Texture2D>` **get_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the icon property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns the engine fallback icon value if the property doesn't exist. Use :ref:`has_icon<class_Theme_method_has_icon>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_icon_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_icon_list** **(** :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for icon properties defined with ``theme_type``. Use :ref:`get_icon_type_list<class_Theme_method_get_icon_type_list>` to get a list of possible theme type names.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_icon_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_icon_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names for icon properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_stylebox:
|
|
|
|
- :ref:`StyleBox<class_StyleBox>` **get_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the :ref:`StyleBox<class_StyleBox>` property defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns the engine fallback stylebox value if the property doesn't exist. Use :ref:`has_stylebox<class_Theme_method_has_stylebox>` to check for existence.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_stylebox_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_stylebox_list** **(** :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for :ref:`StyleBox<class_StyleBox>` properties defined with ``theme_type``. Use :ref:`get_stylebox_type_list<class_Theme_method_get_stylebox_type_list>` to get a list of possible theme type names.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_stylebox_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_stylebox_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names for :ref:`StyleBox<class_StyleBox>` properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_theme_item:
|
|
|
|
- :ref:`Variant<class_Variant>` **get_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the theme property of ``data_type`` defined by ``name`` and ``theme_type``, if it exists.
|
|
|
|
Returns the engine fallback icon value if the property doesn't exist. Use :ref:`has_theme_item<class_Theme_method_has_theme_item>` to check for existence.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_theme_item_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_theme_item_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const|
|
|
|
|
Returns a list of names for properties of ``data_type`` defined with ``theme_type``. Use :ref:`get_theme_item_type_list<class_Theme_method_get_theme_item_type_list>` to get a list of possible theme type names.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_theme_item_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_theme_item_type_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const|
|
|
|
|
Returns a list of all unique theme type names for ``data_type`` properties. Use :ref:`get_type_list<class_Theme_method_get_type_list>` to get a list of all unique theme types.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_type_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_type_list** **(** **)** |const|
|
|
|
|
Returns a list of all unique theme type names. Use the appropriate ``get_*_type_list`` method to get a list of unique theme types for a single data type.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_type_variation_base:
|
|
|
|
- :ref:`StringName<class_StringName>` **get_type_variation_base** **(** :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns the name of the base theme type if ``theme_type`` is a valid variation type. Returns an empty string otherwise.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_get_type_variation_list:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_type_variation_list** **(** :ref:`StringName<class_StringName>` base_type **)** |const|
|
|
|
|
Returns a list of all type variations for the given ``base_type``.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_color:
|
|
|
|
- :ref:`bool<class_bool>` **has_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the :ref:`Color<class_Color>` property defined by ``name`` and ``theme_type`` exists.
|
|
|
|
Returns ``false`` if it doesn't exist. Use :ref:`set_color<class_Theme_method_set_color>` to define it.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_constant:
|
|
|
|
- :ref:`bool<class_bool>` **has_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the constant property defined by ``name`` and ``theme_type`` exists.
|
|
|
|
Returns ``false`` if it doesn't exist. Use :ref:`set_constant<class_Theme_method_set_constant>` to define it.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_default_base_scale:
|
|
|
|
- :ref:`bool<class_bool>` **has_default_base_scale** **(** **)** |const|
|
|
|
|
Returns ``true`` if :ref:`default_base_scale<class_Theme_property_default_base_scale>` has a valid value.
|
|
|
|
Returns ``false`` if it doesn't. The value must be greater than ``0.0`` to be considered valid.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_default_font:
|
|
|
|
- :ref:`bool<class_bool>` **has_default_font** **(** **)** |const|
|
|
|
|
Returns ``true`` if :ref:`default_font<class_Theme_property_default_font>` has a valid value.
|
|
|
|
Returns ``false`` if it doesn't.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_default_font_size:
|
|
|
|
- :ref:`bool<class_bool>` **has_default_font_size** **(** **)** |const|
|
|
|
|
Returns ``true`` if :ref:`default_font_size<class_Theme_property_default_font_size>` has a valid value.
|
|
|
|
Returns ``false`` if it doesn't. The value must be greater than ``0`` to be considered valid.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_font:
|
|
|
|
- :ref:`bool<class_bool>` **has_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the :ref:`Font<class_Font>` property defined by ``name`` and ``theme_type`` exists, or if the default theme font is set up (see :ref:`has_default_font<class_Theme_method_has_default_font>`).
|
|
|
|
Returns ``false`` if neither exist. Use :ref:`set_font<class_Theme_method_set_font>` to define the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_font_size:
|
|
|
|
- :ref:`bool<class_bool>` **has_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the font size property defined by ``name`` and ``theme_type`` exists, or if the default theme font size is set up (see :ref:`has_default_font_size<class_Theme_method_has_default_font_size>`).
|
|
|
|
Returns ``false`` if neither exist. Use :ref:`set_font_size<class_Theme_method_set_font_size>` to define the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_icon:
|
|
|
|
- :ref:`bool<class_bool>` **has_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the icon property defined by ``name`` and ``theme_type`` exists.
|
|
|
|
Returns ``false`` if it doesn't exist. Use :ref:`set_icon<class_Theme_method_set_icon>` to define it.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_stylebox:
|
|
|
|
- :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the :ref:`StyleBox<class_StyleBox>` property defined by ``name`` and ``theme_type`` exists.
|
|
|
|
Returns ``false`` if it doesn't exist. Use :ref:`set_stylebox<class_Theme_method_set_stylebox>` to define it.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_has_theme_item:
|
|
|
|
- :ref:`bool<class_bool>` **has_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
|
|
|
|
Returns ``true`` if the theme property of ``data_type`` defined by ``name`` and ``theme_type`` exists.
|
|
|
|
Returns ``false`` if it doesn't exist. Use :ref:`set_theme_item<class_Theme_method_set_theme_item>` to define it.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_is_type_variation:
|
|
|
|
- :ref:`bool<class_bool>` **is_type_variation** **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)** |const|
|
|
|
|
Returns ``true`` if ``theme_type`` is marked as a variation of ``base_type``.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_merge_with:
|
|
|
|
- void **merge_with** **(** :ref:`Theme<class_Theme>` other **)**
|
|
|
|
Adds missing and overrides existing definitions with values from the ``other`` theme resource.
|
|
|
|
\ **Note:** This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_remove_type:
|
|
|
|
- void **remove_type** **(** :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Removes the theme type, gracefully discarding defined theme items. If the type is a variation, this information is also erased. If the type is a base for type variations, those variations lose their base.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_color:
|
|
|
|
- void **rename_color** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the :ref:`Color<class_Color>` property defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_color<class_Theme_method_has_color>` to check for existence, and :ref:`clear_color<class_Theme_method_clear_color>` to remove the existing property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_constant:
|
|
|
|
- void **rename_constant** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the constant property defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_constant<class_Theme_method_has_constant>` to check for existence, and :ref:`clear_constant<class_Theme_method_clear_constant>` to remove the existing property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_font:
|
|
|
|
- void **rename_font** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the :ref:`Font<class_Font>` property defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_font<class_Theme_method_has_font>` to check for existence, and :ref:`clear_font<class_Theme_method_clear_font>` to remove the existing property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_font_size:
|
|
|
|
- void **rename_font_size** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the font size property defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_font_size<class_Theme_method_has_font_size>` to check for existence, and :ref:`clear_font_size<class_Theme_method_clear_font_size>` to remove the existing property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_icon:
|
|
|
|
- void **rename_icon** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the icon property defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_icon<class_Theme_method_has_icon>` to check for existence, and :ref:`clear_icon<class_Theme_method_clear_icon>` to remove the existing property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_stylebox:
|
|
|
|
- void **rename_stylebox** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the :ref:`StyleBox<class_StyleBox>` property defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_stylebox<class_Theme_method_has_stylebox>` to check for existence, and :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` to remove the existing property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_rename_theme_item:
|
|
|
|
- void **rename_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
|
|
|
|
Renames the theme property of ``data_type`` defined by ``old_name`` and ``theme_type`` to ``name``, if it exists.
|
|
|
|
Fails if it doesn't exist, or if a similar property with the new name already exists. Use :ref:`has_theme_item<class_Theme_method_has_theme_item>` to check for existence, and :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` to remove the existing property.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_color:
|
|
|
|
- void **set_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Color<class_Color>` color **)**
|
|
|
|
Creates or changes the value of the :ref:`Color<class_Color>` property defined by ``name`` and ``theme_type``. Use :ref:`clear_color<class_Theme_method_clear_color>` to remove the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_constant:
|
|
|
|
- void **set_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` constant **)**
|
|
|
|
Creates or changes the value of the constant property defined by ``name`` and ``theme_type``. Use :ref:`clear_constant<class_Theme_method_clear_constant>` to remove the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_font:
|
|
|
|
- void **set_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Font<class_Font>` font **)**
|
|
|
|
Creates or changes the value of the :ref:`Font<class_Font>` property defined by ``name`` and ``theme_type``. Use :ref:`clear_font<class_Theme_method_clear_font>` to remove the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_font_size:
|
|
|
|
- void **set_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` font_size **)**
|
|
|
|
Creates or changes the value of the font size property defined by ``name`` and ``theme_type``. Use :ref:`clear_font_size<class_Theme_method_clear_font_size>` to remove the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_icon:
|
|
|
|
- void **set_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Texture2D<class_Texture2D>` texture **)**
|
|
|
|
Creates or changes the value of the icon property defined by ``name`` and ``theme_type``. Use :ref:`clear_icon<class_Theme_method_clear_icon>` to remove the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_stylebox:
|
|
|
|
- void **set_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)**
|
|
|
|
Creates or changes the value of the :ref:`StyleBox<class_StyleBox>` property defined by ``name`` and ``theme_type``. Use :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` to remove the property.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_theme_item:
|
|
|
|
- void **set_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Variant<class_Variant>` value **)**
|
|
|
|
Creates or changes the value of the theme property of ``data_type`` defined by ``name`` and ``theme_type``. Use :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` to remove the property.
|
|
|
|
Fails if the ``value`` type is not accepted by ``data_type``.
|
|
|
|
\ **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
|
|
|
|
----
|
|
|
|
.. _class_Theme_method_set_type_variation:
|
|
|
|
- void **set_type_variation** **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)**
|
|
|
|
Marks ``theme_type`` as a variation of ``base_type``.
|
|
|
|
This adds ``theme_type`` as a suggested option for :ref:`Control.theme_type_variation<class_Control_property_theme_type_variation>` on a :ref:`Control<class_Control>` that is of the ``base_type`` class.
|
|
|
|
Variations can also be nested, i.e. ``base_type`` can be another variation. If a chain of variations ends with a ``base_type`` matching the class of the :ref:`Control<class_Control>`, the whole chain is going to be suggested as options.
|
|
|
|
\ **Note:** Suggestions only show up if this theme resource is set as the project default theme. See :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |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.)`
|