Theme for controls.
    public class Theme : Resource

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.

Inheritance Chain

Constructors

    public Theme()

Properties

    public Font DefaultFont { get; set; }

The theme’s default font.

Methods

    public void Clear()

    public void ClearColor(string name, string type)

Clears the Color at name if the Theme has type.

    public void ClearConstant(string name, string type)

Clears the constant at name if the Theme has type.

    public void ClearFont(string name, string type)

Clears the Font at name if the Theme has type.

    public void ClearIcon(string name, string type)

Clears the icon at name if the Theme has type.

    public void ClearStylebox(string name, string type)

Clears StyleBox at name if the Theme has type.

    public void CopyDefaultTheme()

Sets the Theme’s values to a copy of the default theme values.

    public void CopyTheme(Theme other)

    public Color GetColor(string name, string type)

Returns the Color at name if the Theme has type.

    public string[] GetColorList(string type)

Returns all the Colors as a PoolStringArray filled with each Color’s name, for use in GetColor(string, string), if the Theme has type.

    public int GetConstant(string name, string type)

Returns the constant at name if the Theme has type.

    public string[] GetConstantList(string type)

Returns all the constants as a PoolStringArray filled with each constant’s name, for use in GetConstant(string, string), if the Theme has type.

    [Obsolete("GetDefaultFont is deprecated. Use the DefaultFont property instead.")]
    public Font GetDefaultFont()

Getter for DefaultFont

    public Font GetFont(string name, string type)

Returns the Font at name if the Theme has type.

    public string[] GetFontList(string type)

Returns all the Fonts as a PoolStringArray filled with each Font’s name, for use in GetFont(string, string), if the Theme has type.

    public Texture GetIcon(string name, string type)

Returns the icon Texture at name if the Theme has type.

    public string[] GetIconList(string type)

Returns all the icons as a PoolStringArray filled with each Texture’s name, for use in GetIcon(string, string), if the Theme has type.

    public StyleBox GetStylebox(string name, string type)

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

    public string[] GetStyleboxList(string type)

Returns all the StyleBoxs as a PoolStringArray filled with each StyleBox’s name, for use in GetStylebox(string, string), if the Theme has type.

    public string[] GetStyleboxTypes()

Returns all the StyleBox types as a PoolStringArray filled with each StyleBox’s type, for use in GetStylebox(string, string) and/or GetStyleboxList(string), if the Theme has type.

    public string[] GetTypeList(string type)

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

    public bool HasColor(string name, string type)

Returns true if Color with name is in type.

Returns false if the Theme does not have type.

    public bool HasConstant(string name, string type)

Returns true if constant with name is in type.

Returns false if the Theme does not have type.

    public bool HasFont(string name, string type)

Returns true if Font with name is in type.

Returns false if the Theme does not have type.

    public bool HasIcon(string name, string type)

Returns true if icon Texture with name is in type.

Returns false if the Theme does not have type.

    public bool HasStylebox(string name, string type)

Returns true if StyleBox with name is in type.

Returns false if the Theme does not have type.

    public void SetColor(string name, string type, Color color)

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

Does nothing if the Theme does not have type.

    public void SetConstant(string name, string type, int constant)

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

Does nothing if the Theme does not have type.

    [Obsolete("SetDefaultFont is deprecated. Use the DefaultFont property instead.")]
    public void SetDefaultFont(Font font)

Setter for DefaultFont

    public void SetFont(string name, string type, Font font)

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

Does nothing if the Theme does not have type.

    public void SetIcon(string name, string type, Texture texture)

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

Does nothing if the Theme does not have type.

    public void SetStylebox(string name, string type, StyleBox texture)

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

Does nothing if the Theme does not have type.

Tags: