Text Block
A text ui element to display text block on the glasses screen.
The TextBlock is an enhancement of Text, and supports additional features like multiline and padding
Notes:
Performance-wise, the text within the text block is processed when needed. it is recommender to setup the TextBlock properties once, before querying it information, line getLinesCount, getWidth, getMeasuredContentWidth etc.
It is recommended to set the width of the TextBlock. If the width is not set, a default width will be used to the wrapping
The Height of the TextBlock is calculated dynamically according to its content
You may override the text split pattern. See setSplitRegex
Extended line modification can be done via registerLineModifierHandler
See also
Constructors
Functions
The function returns the lines count of the text block.
Returns the maximum allowed lines set by setMaxLines or -1 if not set
Return the measured height of the text (getText in pixels
Return the measured width of the text (getText in pixels
The draw method is called to actually draw the ui element visual representation to the CanvasBuffer
Set the text block lines color chooser.
Enable\Disable ellipsis. Works together with setMaxLines
Set the maximum allowed lines. Long text that exceeds maxLines will be trimmed
Set the font information
Set the spacing between lines. Default 0.
Overrider the default text splitting regex.
Sets the ui element size