ScreenLabel
Description
- Derived from
-
Versioned abstract
IScreenLabelContent - Extended by
-
Example_ScreenLabel sealed
Gizmo abstract
Abstract base class for IScreenLabel implementations.
Public / Constructors
ForIcon
2 overloads
Creates a screen label that renders an image icon.
- See also
Creates a screen label that renders an image icon.
- See also
ForString
Creates a screen label that renders a (possibly) multi-lined text using the given styles.
+----------------------------------+ bounds | | | +--------------------------+ | text box | |Left justification | | | | | | | | Center justification | | | | | | | | Right justification | | | +--------------------------+ | | | +----------------------------------+
The bounds
are provided as an argument to the IScreenLabel.RenderScreenLabel method. Based on the given bounds
, the label layout is computed as follows:
-
The measured
text box
is aligned with the computedbounds
using the current ScreenLabelTextStyle.TextAnchor. -
The justification (left, center, right) of each text line is determined by the horizontal ScreenLabelTextStyle.TextAnchor flag.
The measured text box
and the computed bounds
may have different sizes. To ensure that both boxes have the same size, the size returned by IScreenLabel.PrepareScreenLabel must be passed to as the bounds
parameter to the ScreenLabelPlacement.Add method.
ForText
Creates a screen label that renders a (possibly) multi-lined text using the given styles.
+----------------------------------+ bounds | | | +--------------------------+ | text box | |Left justification | | | | | | | | Center justification | | | | | | | | Right justification | | | +--------------------------+ | | | +----------------------------------+
The bounds
are provided as an argument to the IScreenLabel.RenderScreenLabel method. Based on the given bounds
, the label layout is computed as follows:
-
The measured
text box
is aligned with the computedbounds
using the current ScreenLabelTextStyle.TextAnchor. -
The justification (left, center, right) of each text line is determined by the horizontal ScreenLabelTextStyle.TextAnchor flag.
The measured text box
and the computed bounds
may have different sizes. To ensure that both boxes have the same size, the size returned by IScreenLabel.PrepareScreenLabel must be passed to as the bounds
parameter to the ScreenLabelPlacement.Add method.