setText

fun setText(font: Font, text: CharSequence, color: Color = Color.WHITE, width: Float = 0.0f, scaleX: Float = 1.0f, scaleY: Float = 1.0f, align: HAlign = HAlign.LEFT, wrap: Boolean = false, truncate: String? = null)

Calculates the glyphs position and size.

Parameters

font

the font to use in the setting the text

text

the character sequence of text

color

the default color to use for the text

width

the width to use for alignment, line wrapping, and truncation. May be zero if those features are not used.

scaleX

the x-scale of the text

scaleY

the y-scale of the text

wrap

whether to wrap the text or not. Requires width to be set.

truncate

if not null and the width of the glyphs exceed width, the glyphs are truncated with the glyphs of the specified truncate string. Truncate should not be used with text that contains multiple lines. Wrap is ignored if truncate is not null.