W3cubDocs

/Godot 3.0

Theme

Inherits: Resource < Reference < Object

Category: Core

Brief Description

Theme for controls.

Member Functions

void clear_color ( String name, String type )
void clear_constant ( String name, String type )
void clear_font ( String name, String type )
void clear_icon ( String name, String type )
void clear_stylebox ( String name, String type )
void copy_default_theme ( )
Color get_color ( String name, String type ) const
PoolStringArray get_color_list ( String type ) const
int get_constant ( String name, String type ) const
PoolStringArray get_constant_list ( String type ) const
Font get_font ( String name, String type ) const
PoolStringArray get_font_list ( String type ) const
Texture get_icon ( String name, String type ) const
PoolStringArray get_icon_list ( String type ) const
StyleBox get_stylebox ( String name, String type ) const
PoolStringArray get_stylebox_list ( String type ) const
PoolStringArray get_stylebox_types ( ) const
PoolStringArray get_type_list ( String type ) const
bool has_color ( String name, String type ) const
bool has_constant ( String name, String type ) const
bool has_font ( String name, String type ) const
bool has_icon ( String name, String type ) const
bool has_stylebox ( String name, String type ) const
void set_color ( String name, String type, Color color )
void set_constant ( String name, String type, int constant )
void set_font ( String name, String type, Font font )
void set_icon ( String name, String type, Texture texture )
void set_stylebox ( String name, String type, StyleBox texture )

Member Variables

Font default_font - The theme’s default font.

Description

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

Theme resources can be alternatively loaded by writing them in a .theme file, see docs for more info.

Member Function Description

void clear_color ( String name, String type )

Clears theme Color at name if Theme has type.

void clear_constant ( String name, String type )

Clears theme constant at name if Theme has type.

void clear_font ( String name, String type )

Clears Font at name if Theme has type.

void clear_icon ( String name, String type )

Clears icon at name if Theme has type.

void clear_stylebox ( String name, String type )

Clears StyleBox at name if Theme has type.

void copy_default_theme ( )

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

Color get_color ( String name, String type ) const

Returns the Color at name if Theme has type.

PoolStringArray get_color_list ( String type ) const

Returns all of the Colors as a PoolStringArray filled with each Color’s name, for use in get_color, if Theme has type.

int get_constant ( String name, String type ) const

Returns the constant at name if Theme has type.

PoolStringArray get_constant_list ( String type ) const

Returns all of the constants as a PoolStringArray filled with each constant’s name, for use in get_constant, if Theme has type.

Font get_font ( String name, String type ) const

Returns the Font at name if Theme has type.

PoolStringArray get_font_list ( String type ) const

Returns all of the Fonts as a PoolStringArray filled with each Font’s name, for use in get_font, if Theme has type.

Texture get_icon ( String name, String type ) const

Returns the icon Texture at name if Theme has type.

PoolStringArray get_icon_list ( String type ) const

Returns all of the icons as a PoolStringArray filled with each Texture’s name, for use in get_icon, if Theme has type.

StyleBox get_stylebox ( String name, String type ) const

Returns the icon StyleBox at name if Theme has type.

PoolStringArray get_stylebox_list ( String type ) const

Returns all of the StyleBoxs as a PoolStringArray filled with each StyleBox’s name, for use in get_stylebox, if Theme has type.

PoolStringArray get_stylebox_types ( ) const

Returns all of the StyleBox types as a PoolStringArray filled with each StyleBox’s type, for use in get_stylebox and/or get_stylebox_list, if Theme has type.

PoolStringArray get_type_list ( String type ) const

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

bool has_color ( String name, String type ) const

Returns true if Color with name is in type.

Returns false if Theme does not have type.

bool has_constant ( String name, String type ) const

Returns true if constant with name is in type.

Returns false if Theme does not have type.

bool has_font ( String name, String type ) const

Returns true if Font with name is in type.

Returns false if Theme does not have type.

bool has_icon ( String name, String type ) const

Returns true if icon Texture with name is in type.

Returns false if Theme does not have type.

bool has_stylebox ( String name, String type ) const

Returns true if StyleBox with name is in type.

Returns false if Theme does not have type.

void set_color ( String name, String type, Color color )

Sets Theme’s Color to color at name in type.

Does nothing if Theme does not have type.

void set_constant ( String name, String type, int constant )

Sets Theme’s constant to constant at name in type.

Does nothing if Theme does not have type.

void set_font ( String name, String type, Font font )

Sets Theme’s Font to font at name in type.

Does nothing if Theme does not have type.

void set_icon ( String name, String type, Texture texture )

Sets Theme’s icon Texture to texture at name in type.

Does nothing if Theme does not have type.

void set_stylebox ( String name, String type, StyleBox texture )

Sets Theme’s StyleBox to stylebox at name in type.

Does nothing if Theme does not have type.

© 2014–2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.0/classes/class_theme.html