Skin

Represents a collection of styles that can be swapped out as a skin. Styles are individual elements that can be drawn in arbitrarily-sized screen areas (button backgrounds, hud bars, etc). Each style can be drawn with flags that alter its drawn style (hovered, active, etc).

Methods

void draw( SkinStyle style, SkinFlags flags, recti& box ) const

Draw a skin style on a screen area.

void draw( SkinStyle style, SkinFlags flags, recti& box, Color& color ) const

Draw a skin style on a screen area.

void draw( SkinStyle style, uint flags, recti& box ) const

Draw a skin style on a screen area.

void draw( SkinStyle style, uint flags, recti& box, Color& color ) const

Draw a skin style on a screen area.

void draw( FontType font, vec2i& pos, string& text ) const

Draw text on screen with a specific font.

void draw( FontType font, vec2i& pos, string& text, Color& color ) const

Draw text on screen with a specific font.

vec2i draw( FontType font, vec2i& pos, int c, int lastC, Color& color ) const

Draw a character on screen using kerning with the previous character. Returns vec2i : Size of the area the character was drawn in.

const Font@ getFont( FontType font ) const

Retrieve the font associated with a font class by this skin. Returns const Font@ : Associated font.

Color getColor( SkinColor color ) const

Retrieve the color associated with a color class by this skin. Returns Color : Associated color.

vec2i getSize( SkinStyle style, SkinFlags flags ) const

Retrieve the definition size of a skin style.(Note: Non-uniform skin styles can be drawn at any size, not just the definition size.) Returns vec2i : Definition size of the style.

bool isIrregular( SkinStyle style ) const

Whether a skin style was defined as irregular. Irregular styles require pixel-checking for focus and can not rely on bounding boxes. Returns bool : Whether the style was defined as irregular.

bool isPixelActive( SkinStyle style, SkinFlags flags, recti& box, vec2i& px ) const

Check whether a particular pixel would be active in an irregular style as it would be drawn. Returns bool : Whether the specified pixel would be active.

bool isPixelActive( SkinStyle style, uint flags, recti& box, vec2i& px ) const

Check whether a particular pixel would be active in an irregular style as it would be drawn. Returns bool : Whether the specified pixel would be active.

uint getStyleElementCount( SkinStyle style ) const

Get the amount of style elements are in a particular skin style. A style element Returns uint : Skin style to check for.

uint getStyleElementFlags( SkinStyle style, uint index ) const

Retrieve the flag mask a particular style element indicates the appearance for. Returns uint : Mask of skin style flags that the element indicates.