Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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 )