setText

fun setText(font: Font, 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

font

the font that contains the glyphs to use

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


fun setText(layout: GlyphLayout, x: Float, y: Float, scaleX: Float = 1.0f, scaleY: Float = 1.0f, rotation: Angle = Angle.ZERO, color: Color = Color.WHITE)

Clears any existing glyphs of previous text and uses layout to compile the glyphs to cache.

Parameters

layout

the glyph layout to cache

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