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
-
void
draw(
SkinStyle
style,
SkinFlags
flags,
recti&
box,
Color&
color
) const
-
void
draw(
SkinStyle
style,
uint
flags,
recti&
box
) const
-
void
draw(
SkinStyle
style,
uint
flags,
recti&
box,
Color&
color
) const
-
void
draw(
FontType
font,
vec2i&
pos,
string&
text
) const
-
void
draw(
FontType
font,
vec2i&
pos,
string&
text,
Color&
color
) const
-
vec2i
draw(
FontType
font,
vec2i&
pos,
int
c,
int
lastC,
Color&
color
) const
-
const Font@
getFont(
FontType
font
) const
-
Color
getColor(
SkinColor
color
) const
-
vec2i
getSize(
SkinStyle
style,
SkinFlags
flags
) const
-
bool
isIrregular(
SkinStyle
style
) const
-
bool
isPixelActive(
SkinStyle
style,
SkinFlags
flags,
recti&
box,
vec2i&
px
) const
-
bool
isPixelActive(
SkinStyle
style,
uint
flags,
recti&
box,
vec2i&
px
) const
-
uint
getStyleElementCount(
SkinStyle
style
) const
-
uint
getStyleElementFlags(
SkinStyle
style,
uint
index
) const
void
draw(
SkinStyle
style,
uint
flags,
recti&
box
) const
Draw a skin style on a screen area.
-
SkinStyle
style — Style to draw.
-
uint
flags — Mask of skin flags for draw state.
-
recti&
box — Coordinates on screen to draw at.
void
draw(
SkinStyle
style,
uint
flags,
recti&
box,
Color&
color
) const
Draw a skin style on a screen area.
-
SkinStyle
style — Style to draw.
-
uint
flags — Mask of skin flags for draw state.
-
recti&
box — Coordinates on screen to draw at.
-
Color&
color — Color to colorize the style as.
vec2i
draw(
FontType
font,
vec2i&
pos,
int
c,
int
lastC,
Color&
color
) const
Draw a character on screen using kerning with the previous character.
-
FontType
font — Font class to draw with.
-
vec2i&
pos — Position to draw the character at.
-
int
c — Character to draw.
-
int
lastC — Character previously drawn before it. (Character will be kerned with respect to it)
-
Color&
color — Color to draw the character in.
Returns
vec2i
: Size of the area the character was drawn in.
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.)
-
SkinStyle
style — Skin style definition to lookup.
-
SkinFlags
flags — Skin flags for the style to lookup.
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.
-
SkinStyle
style — Skin style to check for.
-
SkinFlags
flags — Skin flags for the style to check for.
-
recti&
box — Box that the style would be drawn in.
-
vec2i&
px — Pixel relative to the start of the box to check.
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.
-
SkinStyle
style — Skin style to check for.
-
uint
flags — Skin flags for the style to check for.
-
recti&
box — Box that the style would be drawn in.
-
vec2i&
px — Pixel relative to the start of the box to check.
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
-
SkinStyle
style — directs the appearance of the style under particular flags.
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.
-
SkinStyle
style — Skin style to retrieve from.
-
uint
index — Index of the style element to retrieve from.
Returns
uint
: Mask of skin style flags that the element indicates.