I am trying to use a table to create menus with buttons and shortcuts lined up. I use the latest libgdx nightly builds that have changed the table APIs (among other things).
Here is the code in my screen constructor:
this.mStage = new Stage(); this.mTable = new Table(); this.mTable.setFillParent(true); this.mTable.debugTable(); this.mStage.addActor(this.mTable);
My resize function is as follows:
this.mStage.setViewport(width, height, true); this.mTable.setFillParent(true); this.mTable.invalidate();
The My render function has the following:
System.out.println("Table size is " + this.mTable.getWidth() + " by " + this.mTable.getHeight()); this.mStage.draw(); Table.drawDebug();
Although my console shows the correct size:
Table size is 480.0 by 640.0
The size of the table is compressed around its children and does not apply to the correct size of 480x640.
Any ideas?
source share