:github_url: hide .. Generated automatically by doc/tools/makerst.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//doc_classes. .. _class_Theme: Theme ===== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Theme for controls. Properties ---------- +-------------------------+--------------------------------------------------------+ | :ref:`Font` | :ref:`default_font` | +-------------------------+--------------------------------------------------------+ Methods ------- +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_color` **(** :ref:`String` name, :ref:`String` type **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_constant` **(** :ref:`String` name, :ref:`String` type **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_font` **(** :ref:`String` name, :ref:`String` type **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_icon` **(** :ref:`String` name, :ref:`String` type **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_stylebox` **(** :ref:`String` name, :ref:`String` type **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`copy_default_theme` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`copy_theme` **(** :ref:`Theme` other **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_color_list` **(** :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_constant_list` **(** :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_font_list` **(** :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_icon_list` **(** :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_stylebox_list` **(** :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_stylebox_types` **(** **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_type_list` **(** :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` type **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color` **(** :ref:`String` name, :ref:`String` type, :ref:`Color` color **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_constant` **(** :ref:`String` name, :ref:`String` type, :ref:`int` constant **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_font` **(** :ref:`String` name, :ref:`String` type, :ref:`Font` font **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon` **(** :ref:`String` name, :ref:`String` type, :ref:`Texture` texture **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stylebox` **(** :ref:`String` name, :ref:`String` type, :ref:`StyleBox` texture **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Theme for skinning controls. Controls can be skinned individually, but for complex applications it's more efficient to just create a global theme that defines everything. This theme can be applied to any :ref:`Control`, and it and its children will automatically use it. Theme resources can be alternatively loaded by writing them in a .theme file, see docs for more info. Tutorials --------- - :doc:`../tutorials/gui/gui_skinning` Property Descriptions --------------------- .. _class_Theme_property_default_font: - :ref:`Font` **default_font** +----------+-------------------------+ | *Setter* | set_default_font(value) | +----------+-------------------------+ | *Getter* | get_default_font() | +----------+-------------------------+ The theme's default font. Method Descriptions ------------------- .. _class_Theme_method_clear: - void **clear** **(** **)** ---- .. _class_Theme_method_clear_color: - void **clear_color** **(** :ref:`String` name, :ref:`String` type **)** Clears theme :ref:`Color` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_clear_constant: - void **clear_constant** **(** :ref:`String` name, :ref:`String` type **)** Clears theme constant at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_clear_font: - void **clear_font** **(** :ref:`String` name, :ref:`String` type **)** Clears :ref:`Font` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_clear_icon: - void **clear_icon** **(** :ref:`String` name, :ref:`String` type **)** Clears icon at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_clear_stylebox: - void **clear_stylebox** **(** :ref:`String` name, :ref:`String` type **)** Clears :ref:`StyleBox` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_copy_default_theme: - void **copy_default_theme** **(** **)** Sets theme values to a copy of the default theme values. ---- .. _class_Theme_method_copy_theme: - void **copy_theme** **(** :ref:`Theme` other **)** ---- .. _class_Theme_method_get_color: - :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` type **)** const Returns the :ref:`Color` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_get_color_list: - :ref:`PoolStringArray` **get_color_list** **(** :ref:`String` type **)** const Returns all of the :ref:`Color`\ s as a :ref:`PoolStringArray` filled with each :ref:`Color`'s name, for use in :ref:`get_color`, if Theme has ``type``. ---- .. _class_Theme_method_get_constant: - :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` type **)** const Returns the constant at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_get_constant_list: - :ref:`PoolStringArray` **get_constant_list** **(** :ref:`String` type **)** const Returns all of the constants as a :ref:`PoolStringArray` filled with each constant's name, for use in :ref:`get_constant`, if Theme has ``type``. ---- .. _class_Theme_method_get_font: - :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` type **)** const Returns the :ref:`Font` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_get_font_list: - :ref:`PoolStringArray` **get_font_list** **(** :ref:`String` type **)** const Returns all of the :ref:`Font`\ s as a :ref:`PoolStringArray` filled with each :ref:`Font`'s name, for use in :ref:`get_font`, if Theme has ``type``. ---- .. _class_Theme_method_get_icon: - :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` type **)** const Returns the icon :ref:`Texture` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_get_icon_list: - :ref:`PoolStringArray` **get_icon_list** **(** :ref:`String` type **)** const Returns all of the icons as a :ref:`PoolStringArray` filled with each :ref:`Texture`'s name, for use in :ref:`get_icon`, if Theme has ``type``. ---- .. _class_Theme_method_get_stylebox: - :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` type **)** const Returns the icon :ref:`StyleBox` at ``name`` if Theme has ``type``. ---- .. _class_Theme_method_get_stylebox_list: - :ref:`PoolStringArray` **get_stylebox_list** **(** :ref:`String` type **)** const Returns all of the :ref:`StyleBox`\ s as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s name, for use in :ref:`get_stylebox`, if Theme has ``type``. ---- .. _class_Theme_method_get_stylebox_types: - :ref:`PoolStringArray` **get_stylebox_types** **(** **)** const Returns all of the :ref:`StyleBox` types as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s type, for use in :ref:`get_stylebox` and/or :ref:`get_stylebox_list`, if Theme has ``type``. ---- .. _class_Theme_method_get_type_list: - :ref:`PoolStringArray` **get_type_list** **(** :ref:`String` type **)** const Returns all of the types in ``type`` as a :ref:`PoolStringArray` for use in any of the get\_\* functions, if Theme has ``type``. ---- .. _class_Theme_method_has_color: - :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` type **)** const Returns ``true`` if :ref:`Color` with ``name`` is in ``type``. Returns ``false`` if Theme does not have ``type``. ---- .. _class_Theme_method_has_constant: - :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` type **)** const Returns ``true`` if constant with ``name`` is in ``type``. Returns ``false`` if Theme does not have ``type``. ---- .. _class_Theme_method_has_font: - :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` type **)** const Returns ``true`` if :ref:`Font` with ``name`` is in ``type``. Returns ``false`` if Theme does not have ``type``. ---- .. _class_Theme_method_has_icon: - :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` type **)** const Returns ``true`` if icon :ref:`Texture` with ``name`` is in ``type``. Returns ``false`` if Theme does not have ``type``. ---- .. _class_Theme_method_has_stylebox: - :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` type **)** const Returns ``true`` if :ref:`StyleBox` with ``name`` is in ``type``. Returns ``false`` if Theme does not have ``type``. ---- .. _class_Theme_method_set_color: - void **set_color** **(** :ref:`String` name, :ref:`String` type, :ref:`Color` color **)** Sets Theme's :ref:`Color` to ``color`` at ``name`` in ``type``. Does nothing if Theme does not have ``type``. ---- .. _class_Theme_method_set_constant: - void **set_constant** **(** :ref:`String` name, :ref:`String` type, :ref:`int` constant **)** Sets Theme's constant to ``constant`` at ``name`` in ``type``. Does nothing if Theme does not have ``type``. ---- .. _class_Theme_method_set_font: - void **set_font** **(** :ref:`String` name, :ref:`String` type, :ref:`Font` font **)** Sets Theme's :ref:`Font` to ``font`` at ``name`` in ``type``. Does nothing if Theme does not have ``type``. ---- .. _class_Theme_method_set_icon: - void **set_icon** **(** :ref:`String` name, :ref:`String` type, :ref:`Texture` texture **)** Sets Theme's icon :ref:`Texture` to ``texture`` at ``name`` in ``type``. Does nothing if Theme does not have ``type``. ---- .. _class_Theme_method_set_stylebox: - void **set_stylebox** **(** :ref:`String` name, :ref:`String` type, :ref:`StyleBox` texture **)** Sets Theme's :ref:`StyleBox` to ``stylebox`` at ``name`` in ``type``. Does nothing if Theme does not have ``type``.