Example usage for com.badlogic.gdx.graphics.g2d BitmapFont usesIntegerPositions

List of usage examples for com.badlogic.gdx.graphics.g2d BitmapFont usesIntegerPositions

Introduction

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

Prototype

public boolean usesIntegerPositions() 

Source Link

Document

Checks whether this font uses integer positions for drawing.

Usage

From source file:com.calanti.androidnativekeyboardinputtest.libgdxModified_1_9_3.CalTextField.java

License:Apache License

protected float getTextY(BitmapFont font, Drawable background) {
    float height = getHeight();
    float textY = textHeight / 2 + font.getDescent();
    if (background != null) {
        float bottom = background.getBottomHeight();
        textY = textY + (height - background.getTopHeight() - bottom) / 2 + bottom;
    } else {/* ww  w .  j a v  a2s  .c  om*/
        textY = textY + height / 2;
    }
    if (font.usesIntegerPositions())
        textY = (int) textY;
    return textY;
}