GluiRichLabel

A rich label can display text on the screen and apply custom styling to parts of the text.

Warning: This component is currently difficult to use and easy to break. It is also lacking in features such as wrapping. To obtain styles in order to pass to it, it's recommended to create a custom node, define them with DefineStyles and then use the resulting styles. A way to get achieve this is to subclass this node.

Styles:

  • style = Default style for this node.

Constructors

this
this(BasicNodeParam!index sup, T content)

Initialize the label with given text.

Members

Functions

clear
void clear()

Erase all label contents.

drawImpl
void drawImpl(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Style style)

Change the style for next part of the text.

opOpAssign
void opOpAssign(T text)

Append new text.

pickStyle
const(Style) pickStyle()
Undocumented in source. Be warned that the author may not have intended to support it.
push
void push(Style style, string text)
void push(string text)

Push text to the label.

resizeImpl
void resizeImpl(Vector2 available)
Undocumented in source. Be warned that the author may not have intended to support it.
text
string text()

Get the current text of the label, as plain text.

Mixins

__anonymous
mixin DefineStyles
Undocumented in source.
__anonymous
mixin ImplHoveredRect
Undocumented in source.

Variables

textParts
Part[] textParts;

Parts defining label text.

Mixed In Members

From mixin DefineStyles

reloadStylesImpl
void reloadStylesImpl()
Undocumented in source. Be warned that the author may not have intended to support it.
loadDefaultStyles
void loadDefaultStyles()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From GluiNode

__anonymous
mixin DefineStyles!("style", q{ Style.init })

This node defines a single style, style, which also works as a default style for all other nodes. However, rather than for that, the purpose of this style is to define the convention of style being the node's default, idle style.

tree
LayoutTree* tree;

Tree data for the node. Note: requires at least one draw before this will work.

layout
Layout layout;

Layout for this node.

toRemove
bool toRemove;

If true, this node will be removed from the tree on the next draw.

ignoreMouse
bool ignoreMouse;

If true, mouse focus will be disabled for this node, so mouse signals will "go through" to its parents, as if the node wasn't there. The mouse will still detect hover like normal.

mousePass
deprecated inout(bool) mousePass()
Undocumented in source. Be warned that the author may not have intended to support it.
minSize
auto minSize;

Minimum size of the node.

theme
const(Theme) theme [@property getter]

Get the current theme.

theme
Theme theme [@property setter]

Set the theme.

isHidden
bool isHidden [@property getter]

Check if the node is hidden.

isHidden
bool isHidden [@property setter]

Set the visibility

hidden
deprecated bool hidden [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
hidden
deprecated bool hidden [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
show
This show()

Show the node.

hide
This hide()

Hide the node.

toggleShow
void toggleShow()

Toggle the node's visibility.

remove
void remove()

Remove this node from the tree before the next draw.

isHovered
bool isHovered [@property getter]

Check if this node is hovered.

hovered
deprecated bool hovered()
Undocumented in source. Be warned that the author may not have intended to support it.
isDisabled
inout(bool) isDisabled()

Check if this node is disabled.

disabled
deprecated inout(bool) disabled()

Check if this node is disabled.

isDisabledInherited
bool isDisabledInherited()

Checks if the node is disabled, either by self, or by any of its ancestors. Only works while the node is being drawn.

updateSize
void updateSize()

Recalculate the window size before next draw.

draw
void draw()

Draw this node as a root node.

draw
void draw(Rectangle space)

Draw this node at specified location.

resize
void resize(LayoutTree* tree, Theme theme, Vector2 space)

Recalculate the minimum node size and update the minSize property.

resizeImpl
void resizeImpl(Vector2 space)

Ditto

drawImpl
void drawImpl(Rectangle paddingBox, Rectangle contentBox)

Draw this node.

hoveredImpl
bool hoveredImpl(Rectangle rect, Vector2 mousePosition)

Check if the node is hovered.

ImplHoveredRect
mixintemplate ImplHoveredRect()
Undocumented in source.
pickStyle
const(Style) pickStyle()

Get the current style.

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

Meta