I'm trying to make a window, then use the pack method to get the right size, but the window maximizes instead. Here's my code:
private Table buildOptionsWindowLayer() {
winOptions = new Window("Options", skinLibgdx);
// (...) building some widgets
Gdx.app.log(TAG, "pref width is " + winOptions.getPrefWidth());
// displays: "pref width is 247.0"
winOptions.pack();
// move the window
winOptions.setPosition(Constants.VIEWPORT_GUI_HEIGHT - winOptions.getWidth() - 50, 50);
return winOptions;
}
The window ends up with a width of 800.0f. Why?
What it is supposed to render:
What it does render: