Theme

Inherits: Resource < Reference < Object

Theme for controls.

Description

A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any Control; the Control and its children will automatically use it.

Theme resources can alternatively be loaded by writing them in a .theme file, see the documentation for more information.

Properties

Font

default_font

Methods

void

clear ( )

void

clear_color ( StringName name, StringName type )

void

clear_constant ( StringName name, StringName type )

void

clear_font ( StringName name, StringName type )

void

clear_icon ( StringName name, StringName type )

void

clear_stylebox ( StringName name, StringName type )

void

copy_default_theme ( )

void

copy_theme ( Theme other )

Color

get_color ( StringName name, StringName type ) const

PackedStringArray

get_color_list ( String type ) const

int

get_constant ( StringName name, StringName type ) const

PackedStringArray

get_constant_list ( String type ) const

Font

get_font ( StringName name, StringName type ) const

PackedStringArray

get_font_list ( String type ) const

Texture2D

get_icon ( StringName name, StringName type ) const

PackedStringArray

get_icon_list ( String type ) const

StyleBox

get_stylebox ( StringName name, StringName type ) const

PackedStringArray

get_stylebox_list ( String type ) const

PackedStringArray

get_stylebox_types ( ) const

PackedStringArray

get_type_list ( String type ) const

bool

has_color ( StringName name, StringName type ) const

bool

has_constant ( StringName name, StringName type ) const

bool

has_font ( StringName name, StringName type ) const

bool

has_icon ( StringName name, StringName type ) const

bool

has_stylebox ( StringName name, StringName type ) const

void

set_color ( StringName name, StringName type, Color color )

void

set_constant ( StringName name, StringName type, int constant )

void

set_font ( StringName name, StringName type, Font font )

void

set_icon ( StringName name, StringName type, Texture2D texture )

void

set_stylebox ( StringName name, StringName type, StyleBox texture )

Property Descriptions

Setter

set_default_font(value)

Getter

get_default_font()

The theme's default font.

Method Descriptions

  • void clear ( )

Clears all values on the theme.


Clears the Color at name if the theme has type.


Clears the constant at name if the theme has type.


Clears the Font at name if the theme has type.


Clears the icon at name if the theme has type.


Clears StyleBox at name if the theme has type.


  • void copy_default_theme ( )

Sets the theme's values to a copy of the default theme values.


  • void copy_theme ( Theme other )

Sets the theme's values to a copy of a given theme.


Returns the Color at name if the theme has type.


Returns all the Colors as a PackedStringArray filled with each Color's name, for use in get_color, if the theme has type.


Returns the constant at name if the theme has type.


Returns all the constants as a PackedStringArray filled with each constant's name, for use in get_constant, if the theme has type.


Returns the Font at name if the theme has type.


Returns all the Fonts as a PackedStringArray filled with each Font's name, for use in get_font, if the theme has type.


Returns the icon Texture2D at name if the theme has type.


Returns all the icons as a PackedStringArray filled with each Texture2D's name, for use in get_icon, if the theme has type.


Returns the icon StyleBox at name if the theme has type.


Returns all the StyleBoxs as a PackedStringArray filled with each StyleBox's name, for use in get_stylebox, if the theme has type.


Returns all the StyleBox types as a PackedStringArray filled with each StyleBox's type, for use in get_stylebox and/or get_stylebox_list, if the theme has type.


Returns all the types in type as a PackedStringArray for use in any of the get_* functions, if the theme has type.


Returns true if Color with name is in type.

Returns false if the theme does not have type.


Returns true if constant with name is in type.

Returns false if the theme does not have type.


Returns true if Font with name is in type.

Returns false if the theme does not have type.


Returns true if icon Texture2D with name is in type.

Returns false if the theme does not have type.


Returns true if StyleBox with name is in type.

Returns false if the theme does not have type.


Sets the theme's Color to color at name in type.

Does nothing if the theme does not have type.


Sets the theme's constant to constant at name in type.

Does nothing if the theme does not have type.


Sets the theme's Font to font at name in type.

Does nothing if the theme does not have type.


Sets the theme's icon Texture2D to texture at name in type.

Does nothing if the theme does not have type.


Sets theme's StyleBox to stylebox at name in type.

Does nothing if the theme does not have type.