Table of Contents

Class ThemeDB

A singleton that provides access to static information about Theme resources used by the engine and by your project.

Inheritance
ThemeDB

Remarks

This singleton provides access to static information about Theme resources used by the engine and by your projects. You can fetch the default engine theme, as well as your project configured theme.

ThemeDB also contains fallback values for theme properties.

Properties

fallback_base_scale

The fallback base scale factor of every Control node and Theme resource. Used when no other value is available to the control.

See also default_base_scale.

var fallback_base_scale : float = 1.0

Property Value

float

Remarks

  • void set_fallback_base_scale(float value)
  • float get_fallback_base_scale

fallback_font

The fallback font of every Control node and Theme resource. Used when no other value is available to the control.

See also default_font.

var fallback_font : Font

Property Value

Font

Remarks

  • void set_fallback_font(Font value)
  • Font get_fallback_font

fallback_font_size

The fallback font size of every Control node and Theme resource. Used when no other value is available to the control.

See also default_font_size.

var fallback_font_size : int = 16

Property Value

int

Remarks

  • void set_fallback_font_size(int value)
  • int get_fallback_font_size

fallback_icon

The fallback icon of every Control node and Theme resource. Used when no other value is available to the control.

var fallback_icon : Texture2D

Property Value

Texture2D

Remarks

fallback_stylebox

The fallback stylebox of every Control node and Theme resource. Used when no other value is available to the control.

var fallback_stylebox : StyleBox

Property Value

StyleBox

Remarks

Methods

get_default_theme

Returns a reference to the default engine Theme. This theme resource is responsible for the out-of-the-box look of Control nodes and cannot be overridden.

Theme get_default_theme

get_project_theme

Returns a reference to the custom project Theme. This theme resources allows to override the default engine theme for every control node in the project.

To set the project theme, see gui/theme/custom.

Theme get_project_theme

Events

fallback_changed

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.

signal fallback_changed