Libgdx, Label doesn't show any text

696 views Asked by At

I hope this question is not too trivial, but i can not figure out why the label I have created won't show any text (the label is placed below the settings button):

edit: i am using version 1.9.3

Label currentSong = new Label("test", new Label.LabelStyle(Assets.instance.fonts.defaultSmall,
                Color.BLUE));
        table.add(currentSong);

        if (debugEnabled) layer.debug();
        return table;

enter image description here

1

There are 1 answers

1
ViníciusPJ On BEST ANSWER

I tested this code and it works. You might have problems with your font. Is the button texts a image or you are using this font?

One possible problem is that you dispose your font somewhere before using it. So it's all black and you cannot see it because you are using a black background.

Paste all your code here. At least the part you allocate/dispose the font and you create the table, the buttons and this screen...

Some code you should call: stage.addActor(table); in the show() method.

stage.act(delta);
stage.draw();

In the render() method.

I know you probably called everything correctly, otherwise the table wouldn't apear. So check the font dispose. If you still needs help, we need the source...