Label not properly centered in TextButton
- by Kees de Bruin
I'm using LibGDX v1.1.0 and I see that the label of a TextButton is not properly centered. I have the following code:
m_resumeButton = new TextButton("resume", skin);
m_resumeButton.addListener(new ChangeListener() {
public void changed(ChangeEvent event, Actor actor) {
m_state = GameState.RUNNING;
getGame().getWorld().pauseWorld(false);
}
});
The default TextButtonStyle is defined as:
"com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle": {
"default": {
"up": "menu-button",
"down": "menu-button-down",
"checked": "menu-button-down",
"disabled": "menu-button-disabled",
"font": "font24",
"fontColor": "white"
}
}
The menu button images are simple 240x48 bitmaps saved as 9-patch images. An image can be found here to illustrate the problem:
https://www.dropbox.com/s/cwuhu5xb9ro5w6m/screenshot001.jpg
Am I doing something wrong? Or is there a problem with the button images I'm using?