setText

fun setText(text: CharSequence, x: Float, y: Float, scaleX: Float = 1.0f, scaleY: Float = 1.0f, rotation: Angle = Angle.ZERO, color: Color = Color.WHITE, targetWidth: Float = 0.0f, align: HAlign = HAlign.LEFT, wrap: Boolean = false, truncate: String? = null)

Clears any existing glyphs of previous text and adds the new glyphs of the specified string of text.

Parameters

text

the string of text to draw

x

the x position to draw the text

y

the y position to draw the text

scaleX

the scale of the x component of the glyphs

scaleY

the scale of the y component of the glyphs

rotation

the rotation of the text to draw

color

the color of the text to draw

targetWidth

the width of the area the text will be drawn, for wrapping or truncation

align

the horizontal alignment of the text, see HAlign

wrap

if true, the text will be wrapped within the targetWidth

truncate

the string to display when the text is too long to fit within targetWidth