List of usage examples for com.badlogic.gdx.graphics.g2d BitmapFontCache setText
public TextBounds setText(CharSequence str, float x, float y)
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; }