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

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

Introduction

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

Prototype

public void tint(Color tint) 

Source Link

Document

Tints all text currently in the cache.

Usage

From source file:de.longri.cachebox3.gui.widgets.ScrollLabel.java

License:Open Source License

@Override
public void draw(Batch batch, float parentAlpha) {
    BitmapFontCache cache = super.getBitmapFontCache();

    validate();/*from w w w .  j a  v a 2 s  .c  o m*/
    Color color = tempColor.set(getColor());
    color.a *= parentAlpha;
    if (style.background != null) {
        batch.setColor(color.r, color.g, color.b, color.a);
        style.background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }
    if (style.fontColor != null)
        color.mul(style.fontColor);
    cache.tint(color);
    cache.setPosition(getX() + scrollPosition, getY());

    getStage().calculateScissors(localRec, scissorRec);
    ScissorStack.pushScissors(scissorRec);
    cache.draw(batch);
    batch.flush();
    try {
        ScissorStack.popScissors();
    } catch (Exception e) {
    }
}