I want to change the color of my libGDX BitmapFont, but it can't change it. The font is generated with Hiero v5 (Lastest as I Know) but the color of the font doesn't change. Here is the example code, the important part here is how modify the alpha channel for an animation I want.
font = new BitmapFont(game.getAssets().getFont(0.9f).getData(), game.getAssets().getFont(0.9f).getRegion(), false);
textLayout = new GlyphLayout(font, "Tap to Start");
textPosition = new Vector2();
textPosition.x = Constants.HALF_WIDTH - (textLayout.width/2);
textPosition.y = 150;
//font.setColor(255f/255f, 183f/255f, 77f/255f, 0.3f); This doesn't work as well
font.getCache().setColor(255f/255f, 183f/255f, 77f/255f, 0.3f);
//Font Drawing in render Method
font.draw(batch, textLayout, textPosition.x, textPosition.y);
Here is a screen of the result of this code (color doesn't change).
Font resource image has white letters and transparent background.