123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Theme.xml.
- .. _class_Theme:
- Theme
- =====
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- Theme for controls.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any :ref:`Control<class_Control>`; the Control and its children will automatically use it.
- Theme resources can alternatively be loaded by writing them in a ``.theme`` file, see the documentation for more information.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`../tutorials/ui/gui_skinning`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------+--------------------------------------------------------+
- | :ref:`Font<class_Font>` | :ref:`default_font<class_Theme_property_default_font>` |
- +-------------------------+--------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_type<class_Theme_method_add_type>` **(** :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear<class_Theme_method_clear>` **(** **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_color<class_Theme_method_clear_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_constant<class_Theme_method_clear_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_font<class_Theme_method_clear_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_icon<class_Theme_method_clear_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_type_variation<class_Theme_method_clear_type_variation>` **(** :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`copy_default_theme<class_Theme_method_copy_default_theme>` **(** **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`copy_theme<class_Theme_method_copy_theme>` **(** :ref:`Theme<class_Theme>` other **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_color<class_Theme_method_get_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_color_list<class_Theme_method_get_color_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_color_types<class_Theme_method_get_color_types>` **(** **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_constant<class_Theme_method_get_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_constant_list<class_Theme_method_get_constant_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_constant_types<class_Theme_method_get_constant_types>` **(** **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Font<class_Font>` | :ref:`get_font<class_Theme_method_get_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_font_list<class_Theme_method_get_font_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_font_types<class_Theme_method_get_font_types>` **(** **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`get_icon<class_Theme_method_get_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_icon_list<class_Theme_method_get_icon_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_icon_types<class_Theme_method_get_icon_types>` **(** **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`get_stylebox<class_Theme_method_get_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>` **(** **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_theme_item<class_Theme_method_get_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :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:`PoolStringArray<class_PoolStringArray>` | :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_type_list<class_Theme_method_get_type_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_type_variation_base<class_Theme_method_get_type_variation_base>` **(** :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_type_variation_list<class_Theme_method_get_type_variation_list>` **(** :ref:`String<class_String>` base_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_method_has_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_method_has_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_default_font<class_Theme_method_has_default_font>` **(** **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_font<class_Theme_method_has_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_method_has_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_method_has_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` 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:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_type_variation<class_Theme_method_is_type_variation>` **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` 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:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rename_color<class_Theme_method_rename_color>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rename_constant<class_Theme_method_rename_constant>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rename_font<class_Theme_method_rename_font>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rename_icon<class_Theme_method_rename_icon>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rename_stylebox<class_Theme_method_rename_stylebox>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rename_theme_item<class_Theme_method_rename_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_color<class_Theme_method_set_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Color<class_Color>` color **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_constant<class_Theme_method_set_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`int<class_int>` constant **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_font<class_Theme_method_set_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Font<class_Font>` font **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_icon<class_Theme_method_set_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Texture<class_Texture>` texture **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_stylebox<class_Theme_method_set_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` 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:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Variant<class_Variant>` value **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_type_variation<class_Theme_method_set_type_variation>` **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` base_type **)** |
- +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_Theme_DataType:
- .. rst-class:: classref-enumeration
- enum **DataType**:
- .. _class_Theme_constant_DATA_TYPE_COLOR:
- .. rst-class:: classref-enumeration-constant
- :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_COLOR** = ``0``
- Theme's :ref:`Color<class_Color>` item type.
- .. _class_Theme_constant_DATA_TYPE_CONSTANT:
- .. rst-class:: classref-enumeration-constant
- :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_CONSTANT** = ``1``
- Theme's constant item type.
- .. _class_Theme_constant_DATA_TYPE_FONT:
- .. rst-class:: classref-enumeration-constant
- :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_FONT** = ``2``
- Theme's :ref:`Font<class_Font>` item type.
- .. _class_Theme_constant_DATA_TYPE_ICON:
- .. rst-class:: classref-enumeration-constant
- :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_ICON** = ``3``
- Theme's icon :ref:`Texture<class_Texture>` item type.
- .. _class_Theme_constant_DATA_TYPE_STYLEBOX:
- .. rst-class:: classref-enumeration-constant
- :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_STYLEBOX** = ``4``
- Theme's :ref:`StyleBox<class_StyleBox>` item type.
- .. _class_Theme_constant_DATA_TYPE_MAX:
- .. rst-class:: classref-enumeration-constant
- :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_MAX** = ``5``
- Maximum value for the DataType enum.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_Theme_property_default_font:
- .. rst-class:: classref-property
- :ref:`Font<class_Font>` **default_font**
- .. rst-class:: classref-property-setget
- - void **set_default_font** **(** :ref:`Font<class_Font>` value **)**
- - :ref:`Font<class_Font>` **get_default_font** **(** **)**
- The default font of this **Theme** resource. Used as a fallback value for font items defined in this theme, but having invalid values. If this value is also invalid, the global default value is used.
- Use :ref:`has_default_font<class_Theme_method_has_default_font>` to check if this value is valid.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_Theme_method_add_type:
- .. rst-class:: classref-method
- void **add_type** **(** :ref:`String<class_String>` 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear:
- .. rst-class:: classref-method
- void **clear** **(** **)**
- Clears all values on the theme.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_color:
- .. rst-class:: classref-method
- void **clear_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Clears the :ref:`Color<class_Color>` at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_constant:
- .. rst-class:: classref-method
- void **clear_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Clears the constant at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_font:
- .. rst-class:: classref-method
- void **clear_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Clears the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_icon:
- .. rst-class:: classref-method
- void **clear_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Clears the icon at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_stylebox:
- .. rst-class:: classref-method
- void **clear_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Clears :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_theme_item:
- .. rst-class:: classref-method
- void **clear_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Clears the theme item of ``data_type`` at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_clear_type_variation:
- .. rst-class:: classref-method
- void **clear_type_variation** **(** :ref:`String<class_String>` theme_type **)**
- Unmarks ``theme_type`` as being a variation of another theme type. See :ref:`set_type_variation<class_Theme_method_set_type_variation>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_copy_default_theme:
- .. rst-class:: classref-method
- void **copy_default_theme** **(** **)**
- Sets the theme's values to a copy of the default theme values.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_copy_theme:
- .. rst-class:: classref-method
- void **copy_theme** **(** :ref:`Theme<class_Theme>` other **)**
- Sets the theme's values to a copy of a given theme.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_color:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns the :ref:`Color<class_Color>` at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_color_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_color_list** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns all the :ref:`Color<class_Color>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Color<class_Color>`'s name, for use in :ref:`get_color<class_Theme_method_get_color>`, if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_color_types:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_color_types** **(** **)** |const|
- Returns all the :ref:`Color<class_Color>` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_color<class_Theme_method_get_color>` and/or :ref:`get_color_list<class_Theme_method_get_color_list>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_constant:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns the constant at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_constant_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_constant_list** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns all the constants as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each constant's name, for use in :ref:`get_constant<class_Theme_method_get_constant>`, if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_constant_types:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_constant_types** **(** **)** |const|
- Returns all the constant types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_constant<class_Theme_method_get_constant>` and/or :ref:`get_constant_list<class_Theme_method_get_constant_list>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_font:
- .. rst-class:: classref-method
- :ref:`Font<class_Font>` **get_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``. If such item does not exist and :ref:`default_font<class_Theme_property_default_font>` is set on the theme, the default font will be returned.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_font_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_font_list** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns all the :ref:`Font<class_Font>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Font<class_Font>`'s name, for use in :ref:`get_font<class_Theme_method_get_font>`, if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_font_types:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_font_types** **(** **)** |const|
- Returns all the :ref:`Font<class_Font>` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_font<class_Theme_method_get_font>` and/or :ref:`get_font_list<class_Theme_method_get_font_list>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_icon:
- .. rst-class:: classref-method
- :ref:`Texture<class_Texture>` **get_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns the icon :ref:`Texture<class_Texture>` at ``name`` if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_icon_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_icon_list** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns all the icons as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Texture<class_Texture>`'s name, for use in :ref:`get_icon<class_Theme_method_get_icon>`, if the theme has ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_icon_types:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_icon_types** **(** **)** |const|
- Returns all the icon types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_icon<class_Theme_method_get_icon>` and/or :ref:`get_icon_list<class_Theme_method_get_icon_list>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_stylebox:
- .. rst-class:: classref-method
- :ref:`StyleBox<class_StyleBox>` **get_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns the :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``theme_type``.
- Valid ``name``\ s may be found using :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`. Valid ``theme_type``\ s may be found using :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_stylebox_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_stylebox_list** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns all the :ref:`StyleBox<class_StyleBox>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`StyleBox<class_StyleBox>`'s name, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>`, if the theme has ``theme_type``.
- Valid ``theme_type``\ s may be found using :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_stylebox_types:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_stylebox_types** **(** **)** |const|
- Returns all the :ref:`StyleBox<class_StyleBox>` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>` and/or :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_theme_item:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **get_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns the theme item of ``data_type`` at ``name`` if the theme has ``theme_type``.
- Valid ``name``\ s may be found using :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` or a data type specific method. Valid ``theme_type``\ s may be found using :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` or a data type specific method.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_theme_item_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_theme_item_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const|
- Returns all the theme items of ``data_type`` as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each theme items's name, for use in :ref:`get_theme_item<class_Theme_method_get_theme_item>` or a data type specific method, if the theme has ``theme_type``.
- Valid ``theme_type``\ s may be found using :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` or a data type specific method.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_theme_item_types:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_theme_item_types** **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const|
- Returns all the theme items of ``data_type`` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_theme_item<class_Theme_method_get_theme_item>`, :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` or data type specific methods.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_type_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_type_list** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns all the theme types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in other ``get_*`` functions of this theme.
- \ **Note:** ``theme_type`` has no effect and will be removed in future version.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_type_variation_base:
- .. rst-class:: classref-method
- :ref:`String<class_String>` **get_type_variation_base** **(** :ref:`String<class_String>` theme_type **)** |const|
- Returns the name of the base theme type if ``theme_type`` is a valid variation type. Returns an empty string otherwise.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_get_type_variation_list:
- .. rst-class:: classref-method
- :ref:`PoolStringArray<class_PoolStringArray>` **get_type_variation_list** **(** :ref:`String<class_String>` base_type **)** |const|
- Returns a list of all type variations for the given ``base_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_color:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns ``true`` if :ref:`Color<class_Color>` with ``name`` is in ``theme_type``.
- Returns ``false`` if the theme does not have ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_constant:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns ``true`` if constant with ``name`` is in ``theme_type``.
- Returns ``false`` if the theme does not have ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_default_font:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_default_font** **(** **)** |const|
- Returns ``true`` if this theme has a valid :ref:`default_font<class_Theme_property_default_font>` value.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_font:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns ``true`` if :ref:`Font<class_Font>` with ``name`` is in ``theme_type``.
- Returns ``false`` if the theme does not have ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_icon:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns ``true`` if icon :ref:`Texture<class_Texture>` with ``name`` is in ``theme_type``.
- Returns ``false`` if the theme does not have ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_stylebox:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns ``true`` if :ref:`StyleBox<class_StyleBox>` with ``name`` is in ``theme_type``.
- Returns ``false`` if the theme does not have ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_has_theme_item:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
- Returns ``true`` if a theme item of ``data_type`` with ``name`` is in ``theme_type``.
- Returns ``false`` if the theme does not have ``theme_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_is_type_variation:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_type_variation** **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` base_type **)** |const|
- Returns ``true`` if ``theme_type`` is marked as a variation of ``base_type``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_merge_with:
- .. rst-class:: classref-method
- void **merge_with** **(** :ref:`Theme<class_Theme>` other **)**
- Adds missing and overrides existing definitions with values from the ``other`` **Theme**.
- \ **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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_remove_type:
- .. rst-class:: classref-method
- void **remove_type** **(** :ref:`String<class_String>` 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_rename_color:
- .. rst-class:: classref-method
- void **rename_color** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Renames the :ref:`Color<class_Color>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_rename_constant:
- .. rst-class:: classref-method
- void **rename_constant** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Renames the constant at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_rename_font:
- .. rst-class:: classref-method
- void **rename_font** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Renames the :ref:`Font<class_Font>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_rename_icon:
- .. rst-class:: classref-method
- void **rename_icon** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Renames the icon at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_rename_stylebox:
- .. rst-class:: classref-method
- void **rename_stylebox** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Renames :ref:`StyleBox<class_StyleBox>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_rename_theme_item:
- .. rst-class:: classref-method
- void **rename_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
- Renames the theme item of ``data_type`` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_color:
- .. rst-class:: classref-method
- void **set_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Color<class_Color>` color **)**
- Sets the theme's :ref:`Color<class_Color>` to ``color`` at ``name`` in ``theme_type``.
- Creates ``theme_type`` if the theme does not have it.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_constant:
- .. rst-class:: classref-method
- void **set_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`int<class_int>` constant **)**
- Sets the theme's constant to ``constant`` at ``name`` in ``theme_type``.
- Creates ``theme_type`` if the theme does not have it.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_font:
- .. rst-class:: classref-method
- void **set_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Font<class_Font>` font **)**
- Sets the theme's :ref:`Font<class_Font>` to ``font`` at ``name`` in ``theme_type``.
- Creates ``theme_type`` if the theme does not have it.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_icon:
- .. rst-class:: classref-method
- void **set_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Texture<class_Texture>` texture **)**
- Sets the theme's icon :ref:`Texture<class_Texture>` to ``texture`` at ``name`` in ``theme_type``.
- Creates ``theme_type`` if the theme does not have it.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_stylebox:
- .. rst-class:: classref-method
- void **set_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)**
- Sets theme's :ref:`StyleBox<class_StyleBox>` to ``stylebox`` at ``name`` in ``theme_type``.
- Creates ``theme_type`` if the theme does not have it.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_theme_item:
- .. rst-class:: classref-method
- void **set_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Variant<class_Variant>` value **)**
- Sets the theme item of ``data_type`` to ``value`` at ``name`` in ``theme_type``.
- Does nothing if the ``value`` type does not match ``data_type``.
- Creates ``theme_type`` if the theme does not have it.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Theme_method_set_type_variation:
- .. rst-class:: classref-method
- void **set_type_variation** **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` 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.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|