123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- .. 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/<name>/doc_classes.
- .. _class_Theme:
- Theme
- =====
- **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
- **Category:** Core
- Brief Description
- -----------------
- Theme for controls.
- Member Functions
- ----------------
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_color<class_Theme_clear_color>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_constant<class_Theme_clear_constant>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_font<class_Theme_clear_font>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_icon<class_Theme_clear_icon>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_stylebox<class_Theme_clear_stylebox>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`copy_default_theme<class_Theme_copy_default_theme>` **(** **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_color>` | :ref:`get_color<class_Theme_get_color>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_color_list<class_Theme_get_color_list>` **(** :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_constant<class_Theme_get_constant>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_constant_list<class_Theme_get_constant_list>` **(** :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Font<class_font>` | :ref:`get_font<class_Theme_get_font>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_font_list<class_Theme_get_font_list>` **(** :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture<class_texture>` | :ref:`get_icon<class_Theme_get_icon>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_icon_list<class_Theme_get_icon_list>` **(** :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StyleBox<class_stylebox>` | :ref:`get_stylebox<class_Theme_get_stylebox>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_stylebox_list<class_Theme_get_stylebox_list>` **(** :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_stylebox_types<class_Theme_get_stylebox_types>` **(** **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_type_list<class_Theme_get_type_list>` **(** :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_has_color>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_has_constant>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_font<class_Theme_has_font>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_has_icon>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_has_stylebox>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_color<class_Theme_set_color>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`Color<class_color>` color **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_constant<class_Theme_set_constant>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`int<class_int>` constant **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_font<class_Theme_set_font>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`Font<class_font>` font **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_icon<class_Theme_set_icon>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`Texture<class_texture>` texture **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_stylebox<class_Theme_set_stylebox>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`StyleBox<class_stylebox>` texture **)** |
- +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Member Variables
- ----------------
- .. _class_Theme_default_font:
- - :ref:`Font<class_font>` **default_font** - The theme's default font.
- 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<class_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.
- Member Function Description
- ---------------------------
- .. _class_Theme_clear_color:
- - void **clear_color** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)**
- Clears theme :ref:`Color<class_color>` at ``name`` if Theme has ``type``.
- .. _class_Theme_clear_constant:
- - void **clear_constant** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)**
- Clears theme constant at ``name`` if Theme has ``type``.
- .. _class_Theme_clear_font:
- - void **clear_font** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)**
- Clears :ref:`Font<class_font>` at ``name`` if Theme has ``type``.
- .. _class_Theme_clear_icon:
- - void **clear_icon** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)**
- Clears icon at ``name`` if Theme has ``type``.
- .. _class_Theme_clear_stylebox:
- - void **clear_stylebox** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)**
- Clears :ref:`StyleBox<class_stylebox>` at ``name`` if Theme has ``type``.
- .. _class_Theme_copy_default_theme:
- - void **copy_default_theme** **(** **)**
- Sets theme values to a copy of the default theme values.
- .. _class_Theme_get_color:
- - :ref:`Color<class_color>` **get_color** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns the :ref:`Color<class_color>` at ``name`` if Theme has ``type``.
- .. _class_Theme_get_color_list:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_color_list** **(** :ref:`String<class_string>` type **)** const
- Returns all of 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_get_color>`, if Theme has ``type``.
- .. _class_Theme_get_constant:
- - :ref:`int<class_int>` **get_constant** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns the constant at ``name`` if Theme has ``type``.
- .. _class_Theme_get_constant_list:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_constant_list** **(** :ref:`String<class_string>` type **)** const
- Returns all of the constants as a :ref:`PoolStringArray<class_poolstringarray>` filled with each constant's name, for use in :ref:`get_constant<class_Theme_get_constant>`, if Theme has ``type``.
- .. _class_Theme_get_font:
- - :ref:`Font<class_font>` **get_font** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns the :ref:`Font<class_font>` at ``name`` if Theme has ``type``.
- .. _class_Theme_get_font_list:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_font_list** **(** :ref:`String<class_string>` type **)** const
- Returns all of 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_get_font>`, if Theme has ``type``.
- .. _class_Theme_get_icon:
- - :ref:`Texture<class_texture>` **get_icon** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns the icon :ref:`Texture<class_texture>` at ``name`` if Theme has ``type``.
- .. _class_Theme_get_icon_list:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_icon_list** **(** :ref:`String<class_string>` type **)** const
- Returns all of 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_get_icon>`, if Theme has ``type``.
- .. _class_Theme_get_stylebox:
- - :ref:`StyleBox<class_stylebox>` **get_stylebox** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns the icon :ref:`StyleBox<class_stylebox>` at ``name`` if Theme has ``type``.
- .. _class_Theme_get_stylebox_list:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_stylebox_list** **(** :ref:`String<class_string>` type **)** const
- Returns all of 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_get_stylebox>`, if Theme has ``type``.
- .. _class_Theme_get_stylebox_types:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_stylebox_types** **(** **)** const
- Returns all of the :ref:`StyleBox<class_stylebox>` types as a :ref:`PoolStringArray<class_poolstringarray>` filled with each :ref:`StyleBox<class_stylebox>`'s type, for use in :ref:`get_stylebox<class_Theme_get_stylebox>` and/or :ref:`get_stylebox_list<class_Theme_get_stylebox_list>`, if Theme has ``type``.
- .. _class_Theme_get_type_list:
- - :ref:`PoolStringArray<class_poolstringarray>` **get_type_list** **(** :ref:`String<class_string>` type **)** const
- Returns all of the types in ``type`` as a :ref:`PoolStringArray<class_poolstringarray>` for use in any of the get\_\* functions, if Theme has ``type``.
- .. _class_Theme_has_color:
- - :ref:`bool<class_bool>` **has_color** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns ``true`` if :ref:`Color<class_color>` with ``name`` is in ``type``.
- Returns ``false`` if Theme does not have ``type``.
- .. _class_Theme_has_constant:
- - :ref:`bool<class_bool>` **has_constant** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns ``true`` if constant with ``name`` is in ``type``.
- Returns ``false`` if Theme does not have ``type``.
- .. _class_Theme_has_font:
- - :ref:`bool<class_bool>` **has_font** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns ``true`` if :ref:`Font<class_font>` with ``name`` is in ``type``.
- Returns ``false`` if Theme does not have ``type``.
- .. _class_Theme_has_icon:
- - :ref:`bool<class_bool>` **has_icon** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns ``true`` if icon :ref:`Texture<class_texture>` with ``name`` is in ``type``.
- Returns ``false`` if Theme does not have ``type``.
- .. _class_Theme_has_stylebox:
- - :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type **)** const
- Returns ``true`` if :ref:`StyleBox<class_stylebox>` with ``name`` is in ``type``.
- Returns ``false`` if Theme does not have ``type``.
- .. _class_Theme_set_color:
- - void **set_color** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`Color<class_color>` color **)**
- Sets Theme's :ref:`Color<class_color>` to ``color`` at ``name`` in ``type``.
- Does nothing if Theme does not have ``type``.
- .. _class_Theme_set_constant:
- - void **set_constant** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`int<class_int>` constant **)**
- Sets Theme's constant to ``constant`` at ``name`` in ``type``.
- Does nothing if Theme does not have ``type``.
- .. _class_Theme_set_font:
- - void **set_font** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`Font<class_font>` font **)**
- Sets Theme's :ref:`Font<class_font>` to ``font`` at ``name`` in ``type``.
- Does nothing if Theme does not have ``type``.
- .. _class_Theme_set_icon:
- - void **set_icon** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`Texture<class_texture>` texture **)**
- Sets Theme's icon :ref:`Texture<class_texture>` to ``texture`` at ``name`` in ``type``.
- Does nothing if Theme does not have ``type``.
- .. _class_Theme_set_stylebox:
- - void **set_stylebox** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type, :ref:`StyleBox<class_stylebox>` texture **)**
- Sets Theme's :ref:`StyleBox<class_stylebox>` to ``stylebox`` at ``name`` in ``type``.
- Does nothing if Theme does not have ``type``.
|