Theme

Inherits: Resource < RefCounted < Object

A resource used for styling/skinning Controls and Windows.

Description

A resource used for styling/skinning Control and Window nodes. While individual controls can be styled using their local theme overrides (see Control.add_theme_color_override), theme resources allow you to store and apply the same settings across all controls sharing the same type (e.g. style all Buttons the same). One theme resource can be used for the entire project, but you can also set a separate theme resource to a branch of control nodes. A theme resource assigned to a control applies to the control itself, as well as all of its direct and indirect children (as long as a chain of controls is uninterrupted).

Use ProjectSettings.gui/theme/custom to set up a project-scope theme that will be available to every control in your project.

Use Control.theme of any control node to set up a theme that will be available to that control and all of its direct and indirect children.

Tutorials

Properties

float

default_base_scale

0.0

Font

default_font

int

default_font_size

-1

Methods

void

add_type ( StringName theme_type )

void

clear ( )

void

clear_color ( StringName name, StringName theme_type )

void

clear_constant ( StringName name, StringName theme_type )

void

clear_font ( StringName name, StringName theme_type )

void

clear_font_size ( StringName name, StringName theme_type )

void

clear_icon ( StringName name, StringName theme_type )

void

clear_stylebox ( StringName name, StringName theme_type )

void

clear_theme_item ( DataType data_type, StringName name, StringName theme_type )

void

clear_type_variation ( StringName theme_type )

Color

get_color ( StringName name, StringName theme_type ) const

PackedStringArray

get_color_list ( String theme_type ) const

PackedStringArray

get_color_type_list ( ) const

int

get_constant ( StringName name, StringName theme_type ) const

PackedStringArray

get_constant_list ( String theme_type ) const

PackedStringArray

get_constant_type_list ( ) const

Font

get_font ( StringName name, StringName theme_type ) const

PackedStringArray

get_font_list ( String theme_type ) const

int

get_font_size ( StringName name, StringName theme_type ) const

PackedStringArray

get_font_size_list ( String theme_type ) const

PackedStringArray

get_font_size_type_list ( ) const

PackedStringArray

get_font_type_list ( ) const

Texture2D

get_icon ( StringName name,