StyledText

Draws text: handles updates, formatting and styling.

Constructors

this
this(Node node, Rope text)
Undocumented in source.
this
this(Node node, Rope text, StyleRange styleMap)
Undocumented in source.
this
this(Node node, const(char)[] text)
Undocumented in source.
this
this(Node node, const(char)[] text, StyleRange styleMap)
Undocumented in source.
this
this(StyledText text)

Copy the text, clear ownership and texture.

Alias This

value

Members

Aliases

minSize
alias minSize = size
Undocumented in source.
minSize
alias minSize = size
Undocumented in source.

Functions

backend
inout(FluidBackend) backend()
Undocumented in source. Be warned that the author may not have intended to support it.
clearTextures
void clearTextures()

Reset the texture, destroying it and replacing it with a blank.

draw
void draw(Style[] styles, Vector2 position)
deprecated void draw(Style style, Rectangle rectangle)

Draw the text.

draw
void draw(Style style, Vector2 position)

Draw the text.

generate
void generate(Vector2 position)
void generate(R chunks)

Generate the textures, if not already generated.

opAssign
Rope opAssign(Rope text)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
const(char)[] opAssign(const(char)[] text)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(const(char)[] text)
Undocumented in source. Be warned that the author may not have intended to support it.
resize
void resize()

Set new bounding box for the text.

resize
void resize(Vector2 space, bool wrap)

Set new bounding box for the text; wrap the text if it doesn't fit in boundaries.

size
Vector2 size()

Get the size of the text.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

hasFastEdits
bool hasFastEdits;

If true, enables optimizations for frequently edited text.

indentWidth
float indentWidth;

Indent width, in pixels.

node
Node node;

Node owning this text struct.

styleMap
StyleRange styleMap;

Range assigning slices of text to styles by index. A single text can have up to 256 different styles.

texture
CompositeTexture texture;

Texture generated by the struct.

value
Rope value;

Underlying text.

Meta