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

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(Rectangle rect)

Draw the background

drawText
void drawText(Rectangle rect, string text, 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.

getFont
inout(Font) getFont()

Get the current font

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

Measure space given text will use.

totalMargin
uint[4] totalMargin()

Get a sum of margin, border size and padding.

update
void update()

Update the style with given D code.

wrapText
TextLine[] wrapText(double width, string text, bool lineFeedsOnly)

Split the text into multiple lines in order to fit within given width.

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.

loadFont
Font loadFont(string file, int fontSize, dchar[] fontChars)
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