Helo guys! I'm trying to set size of the text in TextButton using libgdx and scene2d.
Here's how I create and initialize textbutton object:
Skin skin = new Skin();
skin.add("white", new Texture(Gdx.files.internal("data/texture.jpg")));
skin.add("default", new BitmapFont());
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("white");
textButtonStyle.down = skin.newDrawable("white", Color.DARK_GRAY);
textButtonStyle.checked = skin.newDrawable("white", Color.BLUE);
textButtonStyle.over = skin.newDrawable("white", Color.LIGHT_GRAY);
textButtonStyle.font = skin.getFont("default");
skin.add("default", textButtonStyle);
TextButton newGame = new TextButton("Hello button",skin);
After that the button with text in it is created perfectly, but I don't understand how can I change it's text size.
I've already tried almost every method of Label object:
newGame.getLabel().setScale(10);
newGame.getLabel().setWidth(100);
And so on. So my question is: How can I change text size in TextButton?