Reputation: 137
As title says, I have a VerticalGroup that I store bunch of Labels in. Now, it does align ALL of them to the left, kind of. The problem is that labels that are shorter than the largest label will be centered around the middle of the largest label, like so:
Here is the relevant code:
private ScrollPane chatScrollPane;
private VerticalGroup chatGroup;
...
chatGroup = new VerticalGroup();
chatScrollPane = new ScrollPane(chatGroup, game.getSkin());
stage.addActor(chatScrollPane);
... in another method that adds messages ...
String message = "a message";
Label messageLabel = new Label(message, game.getSkin());
messageLabel.setAlignment(Align.left);
chatGroup.left();
chatGroup.addActor(messageLabel);
Now, what I'm asking is how can I have EVERY message, regardless of length, be on the left (like the Welcome message in screenshot)?
Thanks in advance.
Upvotes: 2
Views: 58
Reputation: 137
I actually found the solution after quite a bit of fiddling. Turns out I need to do chatGroup.columnAlign(Align.left);
to fix the problem. Thanks anyway!
Upvotes: 1