class_themedb.rst 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ThemeDB.xml.
  6. .. _class_ThemeDB:
  7. ThemeDB
  8. =======
  9. **Inherits:** :ref:`Object<class_Object>`
  10. A singleton that provides access to static information about :ref:`Theme<class_Theme>` resources used by the engine and by your project.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This singleton provides access to static information about :ref:`Theme<class_Theme>` resources used by the engine and by your projects. You can fetch the default engine theme, as well as your project configured theme.
  15. \ **ThemeDB** also contains fallback values for theme properties.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------+------------------------------------------------------------------------+---------+
  22. | :ref:`float<class_float>` | :ref:`fallback_base_scale<class_ThemeDB_property_fallback_base_scale>` | ``1.0`` |
  23. +-----------------------------------+------------------------------------------------------------------------+---------+
  24. | :ref:`Font<class_Font>` | :ref:`fallback_font<class_ThemeDB_property_fallback_font>` | |
  25. +-----------------------------------+------------------------------------------------------------------------+---------+
  26. | :ref:`int<class_int>` | :ref:`fallback_font_size<class_ThemeDB_property_fallback_font_size>` | ``16`` |
  27. +-----------------------------------+------------------------------------------------------------------------+---------+
  28. | :ref:`Texture2D<class_Texture2D>` | :ref:`fallback_icon<class_ThemeDB_property_fallback_icon>` | |
  29. +-----------------------------------+------------------------------------------------------------------------+---------+
  30. | :ref:`StyleBox<class_StyleBox>` | :ref:`fallback_stylebox<class_ThemeDB_property_fallback_stylebox>` | |
  31. +-----------------------------------+------------------------------------------------------------------------+---------+
  32. .. rst-class:: classref-reftable-group
  33. Methods
  34. -------
  35. .. table::
  36. :widths: auto
  37. +---------------------------+------------------------------------------------------------------------+
  38. | :ref:`Theme<class_Theme>` | :ref:`get_default_theme<class_ThemeDB_method_get_default_theme>`\ (\ ) |
  39. +---------------------------+------------------------------------------------------------------------+
  40. | :ref:`Theme<class_Theme>` | :ref:`get_project_theme<class_ThemeDB_method_get_project_theme>`\ (\ ) |
  41. +---------------------------+------------------------------------------------------------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Signals
  46. -------
  47. .. _class_ThemeDB_signal_fallback_changed:
  48. .. rst-class:: classref-signal
  49. **fallback_changed**\ (\ ) :ref:`🔗<class_ThemeDB_signal_fallback_changed>`
  50. Emitted when one of the fallback values had been changed. Use it to refresh the look of controls that may rely on the fallback theme items.
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_ThemeDB_property_fallback_base_scale:
  57. .. rst-class:: classref-property
  58. :ref:`float<class_float>` **fallback_base_scale** = ``1.0`` :ref:`🔗<class_ThemeDB_property_fallback_base_scale>`
  59. .. rst-class:: classref-property-setget
  60. - |void| **set_fallback_base_scale**\ (\ value\: :ref:`float<class_float>`\ )
  61. - :ref:`float<class_float>` **get_fallback_base_scale**\ (\ )
  62. The fallback base scale factor of every :ref:`Control<class_Control>` node and :ref:`Theme<class_Theme>` resource. Used when no other value is available to the control.
  63. See also :ref:`Theme.default_base_scale<class_Theme_property_default_base_scale>`.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_ThemeDB_property_fallback_font:
  67. .. rst-class:: classref-property
  68. :ref:`Font<class_Font>` **fallback_font** :ref:`🔗<class_ThemeDB_property_fallback_font>`
  69. .. rst-class:: classref-property-setget
  70. - |void| **set_fallback_font**\ (\ value\: :ref:`Font<class_Font>`\ )
  71. - :ref:`Font<class_Font>` **get_fallback_font**\ (\ )
  72. The fallback font of every :ref:`Control<class_Control>` node and :ref:`Theme<class_Theme>` resource. Used when no other value is available to the control.
  73. See also :ref:`Theme.default_font<class_Theme_property_default_font>`.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_ThemeDB_property_fallback_font_size:
  77. .. rst-class:: classref-property
  78. :ref:`int<class_int>` **fallback_font_size** = ``16`` :ref:`🔗<class_ThemeDB_property_fallback_font_size>`
  79. .. rst-class:: classref-property-setget
  80. - |void| **set_fallback_font_size**\ (\ value\: :ref:`int<class_int>`\ )
  81. - :ref:`int<class_int>` **get_fallback_font_size**\ (\ )
  82. The fallback font size of every :ref:`Control<class_Control>` node and :ref:`Theme<class_Theme>` resource. Used when no other value is available to the control.
  83. See also :ref:`Theme.default_font_size<class_Theme_property_default_font_size>`.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_ThemeDB_property_fallback_icon:
  87. .. rst-class:: classref-property
  88. :ref:`Texture2D<class_Texture2D>` **fallback_icon** :ref:`🔗<class_ThemeDB_property_fallback_icon>`
  89. .. rst-class:: classref-property-setget
  90. - |void| **set_fallback_icon**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  91. - :ref:`Texture2D<class_Texture2D>` **get_fallback_icon**\ (\ )
  92. The fallback icon of every :ref:`Control<class_Control>` node and :ref:`Theme<class_Theme>` resource. Used when no other value is available to the control.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_ThemeDB_property_fallback_stylebox:
  96. .. rst-class:: classref-property
  97. :ref:`StyleBox<class_StyleBox>` **fallback_stylebox** :ref:`🔗<class_ThemeDB_property_fallback_stylebox>`
  98. .. rst-class:: classref-property-setget
  99. - |void| **set_fallback_stylebox**\ (\ value\: :ref:`StyleBox<class_StyleBox>`\ )
  100. - :ref:`StyleBox<class_StyleBox>` **get_fallback_stylebox**\ (\ )
  101. The fallback stylebox of every :ref:`Control<class_Control>` node and :ref:`Theme<class_Theme>` resource. Used when no other value is available to the control.
  102. .. rst-class:: classref-section-separator
  103. ----
  104. .. rst-class:: classref-descriptions-group
  105. Method Descriptions
  106. -------------------
  107. .. _class_ThemeDB_method_get_default_theme:
  108. .. rst-class:: classref-method
  109. :ref:`Theme<class_Theme>` **get_default_theme**\ (\ ) :ref:`🔗<class_ThemeDB_method_get_default_theme>`
  110. Returns a reference to the default engine :ref:`Theme<class_Theme>`. This theme resource is responsible for the out-of-the-box look of :ref:`Control<class_Control>` nodes and cannot be overridden.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_ThemeDB_method_get_project_theme:
  114. .. rst-class:: classref-method
  115. :ref:`Theme<class_Theme>` **get_project_theme**\ (\ ) :ref:`🔗<class_ThemeDB_method_get_project_theme>`
  116. Returns a reference to the custom project :ref:`Theme<class_Theme>`. This theme resources allows to override the default engine theme for every control node in the project.
  117. To set the project theme, see :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`.
  118. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  119. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  120. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  121. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  122. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  123. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  124. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  125. .. |void| replace:: :abbr:`void (No return value.)`