I have recently began developing a LibGDX application and am currently developing the GUI. However, I have encountered a problem relating to Labels within Scene2D. The Image below should speak a thousand words:
As you can see, the word 'Score' is displayed, but it has a per-character black background that is not consistent with the one behind it.
The label itself is contained within the light grey table, which is within another table holding the upper elements. This table is housed within a master table.
Initially, I believed the background to be related to the GLClearColor, however from testing, I have found that it is not - a red GLClearColor still produces a black background. Also, I have checked that the colours of the tables contain an alpha value of 1, I have tried changing the font, changing the font colour as well as the scaling. I have now ran out of ideas.
Here are the code extracts relating to the label:
private Label score;
score = new Label("Score:", skin);
score.setFontScale(3);
Then the label is added to the 'scoreTable':
scoreTable.add(score).expand().fill();
scoreTable.pack();
The skin is defined as below in 'uiskin.json':
// @formatter:off
{
com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: homestile.fnt } },
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
default: { down: default-round-down, up: default-round, font: default-font},
},
com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
default: {
titleFont: default-font
}
},
"com.badlogic.gdx.graphics.Color": {
"white": { "r": 1, "g": 1, "b": 1, "a": 1},
"black": { "r": 0, "g": 0, "b": 0, "a": 1},
},
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
default: { font: default-font, fontColor: white }
}
}
Can anyone shine some light on this problem?
Edit : Here are the font files:
http://i.stack.imgur.com/xDmL1.png (Note that this is a white font, so viewing it when there is a white background makes it look invisible. Trust me, it is there)
https://drive.google.com/file/d/0B9Xrus17wYbNUXlOVHFKX2YybjQ/view?usp=sharing