GpuFont

class GpuFont(context: Context, defaultFont: TtfFont, atlasWidth: Int = 256, atlasHeight: Int = 512, gridSize: Int = 10, maxVertices: Int = 10000)

Author

Colton Daily

Constructors

Link copied to clipboard
fun GpuFont(context: Context, defaultFont: TtfFont, atlasWidth: Int = 256, atlasHeight: Int = 512, gridSize: Int = 10, maxVertices: Int = 10000)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addText(text: String, x: Float, y: Float, pxSize: Int, maxWidth: Float = 0.0f, align: HAlign = HAlign.LEFT, wrap: Boolean = false, rotation: Angle = Angle.ZERO, color: Color = Color.BLACK, font: TtfFont = defaultFont)

Draws the specified string of text at the specified location and rotation.

Link copied to clipboard
fun clear()

Clear any cached vertices and glyph instances.

Link copied to clipboard
fun draw(batch: Batch)

Flushes the text mesh to be rendered.

Link copied to clipboard
fun useShaderWith(batch: Batch)

Sets the specified batch to use this GPU fonts shader in order to render.

Properties

Link copied to clipboard
var debug: Boolean = false