Example usage for com.badlogic.gdx.graphics.g2d BitmapFontCache setText

List of usage examples for com.badlogic.gdx.graphics.g2d BitmapFontCache setText

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d BitmapFontCache setText.

Prototype

public TextBounds setText(CharSequence str, float x, float y) 

Source Link

Document

Clears any cached glyphs and adds glyphs for the specified text.

Usage

From source file:de.longri.cachebox3.utils.MesureFontUtil.java

License:Open Source License

public static GlyphLayout Measure(BitmapFont font, String txt) {
    if (txt == null || txt.equals(""))
        txt = "text";
    BitmapFontCache measureNormalCache = new BitmapFontCache(font);
    GlyphLayout bounds = measureNormalCache.setText(txt, 0, 0);
    bounds.height = bounds.height - measureNormalCache.getFont().getDescent();
    return bounds;
}