ThemeDB
A singleton that provides access to static information about Theme resources used by the engine and by your project.
A singleton that provides access to static information about Theme resources used by the engine and by your project.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties7
FallbackBaseScaleProperty
public static float FallbackBaseScale { get; set; }The fallback base scale factor of every Control node and Theme resource. Used when no other value is available to the control.
See also Theme.DefaultBaseScale.
FallbackFontProperty
public static Font FallbackFont { get; set; }The fallback font of every Control node and Theme resource. Used when no other value is available to the control.
See also Theme.DefaultFont.
FallbackFontSizeProperty
public static int FallbackFontSize { get; set; }The fallback font size of every Control node and Theme resource. Used when no other value is available to the control.
See also Theme.DefaultFontSize.
FallbackIconProperty
public static Texture2D FallbackIcon { get; set; }The fallback icon of every Control node and Theme resource. Used when no other value is available to the control.
FallbackSoundProperty
public static AudioStream FallbackSound { get; set; }The fallback sound of every Control node and Theme resource. Used when no other value is available to the control.
FallbackStyleboxProperty
public static StyleBox FallbackStylebox { get; set; }The fallback stylebox of every Control node and Theme resource. Used when no other value is available to the control.
SingletonProperty
public static ThemeDBInstance Singleton { get; }Methods14
GetDefaultThemeTheme
public static Theme GetDefaultTheme();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.
ThemeGetFallbackBaseScalefloat
public static float GetFallbackBaseScale();floatGetFallbackFontFont
public static Font GetFallbackFont();FontGetFallbackFontSizeint
public static int GetFallbackFontSize();intGetFallbackIconTexture2D
public static Texture2D GetFallbackIcon();Texture2DGetFallbackSoundAudioStream
public static AudioStream GetFallbackSound();AudioStreamGetFallbackStyleboxStyleBox
public static StyleBox GetFallbackStylebox();StyleBoxGetProjectThemeTheme
public static Theme GetProjectTheme();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 ProjectSettings.gui/theme/custom.
ThemeSetFallbackBaseScalevoid
public static void SetFallbackBaseScale(float baseScale);| Name | Type | Default |
|---|---|---|
baseScale | float | — |
SetFallbackFontvoid
public static void SetFallbackFont(Font font);| Name | Type | Default |
|---|---|---|
font | Font | — |
SetFallbackFontSizevoid
public static void SetFallbackFontSize(int fontSize);| Name | Type | Default |
|---|---|---|
fontSize | int | — |
SetFallbackIconvoid
public static void SetFallbackIcon(Texture2D icon);| Name | Type | Default |
|---|---|---|
icon | Texture2D | — |
SetFallbackSoundvoid
public static void SetFallbackSound(AudioStream audio);| Name | Type | Default |
|---|---|---|
audio | AudioStream | — |
SetFallbackStyleboxvoid
public static void SetFallbackStylebox(StyleBox stylebox);| Name | Type | Default |
|---|---|---|
stylebox | StyleBox | — |
Signals and events1
FallbackChangedEvent
public static event Action FallbackChanged;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.