BitmapFontCache

A FontCache that provides additional render and text methods for a BitmapFont.

Author

Colton Daily

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
fun addText(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)

Adds new glyphs of the specified string of text on top of any existing glyphs.

fun addText(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)

Adds new glyphs of the specified string of text on top of any existing glyphs.

Link copied to clipboard
fun clear()

Clears any existing glyphs from the cache.

Link copied to clipboard
fun draw(batch: Batch)

Draws the text using the specified batch.

fun draw(batch: Batch, textures: List<Texture>)

Draws the text using the specified batch and list of textures. The textures list size must be >= pages

Link copied to clipboard
fun setPosition(px: Float, py: Float)

Sets the position of the text.

Link copied to clipboard
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.

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.

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.

Link copied to clipboard
fun tint(tint: Color)

Tints the existing text in the cache.

Link copied to clipboard
fun translate(tx: Float, ty: Float)

Moves the position of the text by the specified amount.

Properties

Link copied to clipboard
Link copied to clipboard
val pages: Int = 1