Definitely not. Table
is just a tool and you should use it when it fits your desired result. If your widgets are supposed to be laid out in a tabular way, then use Table
. Otherwise, it's perfectly okay to position your widgets manually if that's what you need.
Two alternatives to Table
HorizontalGroup: Just one example of a component made specifically for helping with with your layout. It seems to be what you are looking for.
Two Stage instances: have one Stage
for the game area and one for the interface. Each Stage
will have its own camera, which means you can move the game camera around the world while the interface camera stays still. To control how large each Stage
is and where it is positioned, read about Viewports on the LibGDX wiki.
When positioning manually
One piece advice, though, if you decide to position your widgets manually: don't use absolute pixel coordinates. If you your screen is 400px wide and you want a widget's X coordinate to be 200px, set it to 0.5f * screenWidth
, instead. This will allow your widgets to be position correctly, even if the screen size changes and it takes no extra effort on your part.
Edit: The HorizontalGroup
should have two children: a InterfaceWidget
and a GameWidget
. The InterfaceWidget
will have as children all the things you want to appear in the left of the screen, such as score. The GameWidget
will be the parent of the PlayerActor
and any other actors you have in your game.
HorizontalGroup
InterfaceWidget
ScoreWidget
SomeOtherWidget
GameWidget
PlayerActor
SomeOtherActor
HorizontalGroup
or twoStage
instances. But since your world doesn't move, theHorizontalGroup
is a better solution because it's simpler. :) – Paul Manta Jul 19 '14 at 9:00