Style

Contains the style for a node.

Constructors

this
this()
Undocumented in source.
this
this(Style[] styles)

Create a style by copying params of others.

Members

Aliases

loadFont
alias loadFont = loadTypeface
Undocumented in source.

Enums

Side
enum Side
Undocumented in source.

Functions

contentBox
Vector2 contentBox(Vector2 size)

Remove padding from the vector representing size of a box.

contentBox
Rectangle contentBox(Rectangle rect)

Remove padding from the given rect.

drawBackground
void drawBackground(FluidBackend backend, Rectangle rect)

Draw the background

drawText
deprecated void drawText(Image image, Rectangle rect, string text, bool wrap)
deprecated void drawText(Image image, Rectangle rect, string text, Color color, bool wrap)

Draw text using the same params as measureText.

fullMargin
uint[4] fullMargin()

Get a side array holding both the regular margin and the border.

measureText
deprecated Vector2 measureText(Vector2 availableSpace, string text, bool wrap)
deprecated Rectangle measureText(Rectangle availableSpace, string text, bool wrap)

Measure space given text will use.

setDPI
void setDPI(Vector2 dpi)

Set current DPI.

totalMargin
uint[4] totalMargin()

Get a sum of margin, border size and padding.

update
void update()

Update the style with given D code.

Static functions

cropBox
Vector2 cropBox(Vector2 size, uint[4] sides)
Rectangle cropBox(Rectangle rect, uint[4] sides)

Crop the given box by reducing its size on all sides.

init
Style init()

Get the default, empty style.

loadTypeface
Typeface loadTypeface(string file, int fontSize)
Undocumented in source. Be warned that the author may not have intended to support it.
loadTypeface
Typeface loadTypeface(int fontSize)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_currentTheme
Theme _currentTheme;
Undocumented in source.
_styleStack
Style[] _styleStack;
Undocumented in source.

Structs

__anonymous
struct __anonymous
Undocumented in source.
__anonymous
struct __anonymous
Undocumented in source.
__anonymous
struct __anonymous
Undocumented in source.
__anonymous
struct __anonymous
Undocumented in source.

Meta