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

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

Introduction

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

Prototype

public BitmapFont getFont() 

Source Link

Usage

From source file:com.ridiculousRPG.util.BitmapFontCachePool.java

License:Apache License

public void free(BitmapFontCache cache) {
    pool.get(cache.getFont()).free(cache);
}

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;
}

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

License:Open Source License

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

From source file:mobi.shad.s3lib.gfx.g2d.BitmapFontAnim.java

License:Apache License

/**
 * //from  w w  w  . j  a v  a 2 s .  c  o m
 * @param cache
 */
public BitmapFontAnim(BitmapFontCache cache) {
    this.cache = cache;
    font = cache.getFont();
    x = cache.getX();
    y = cache.getY();
    vertices = cache.getVertices();
    copyVertices = new float[cache.getVertices().length];
    System.arraycopy(cache.getVertices(), 0, copyVertices, 0, cache.getVertices().length);
    textLengh = copyVertices.length / 20;
}