Reputation: 7247
The image below explains what I want to do.
The top diagram represents how I have the arrangement now.
The bottom diagram represents how I want the arrangement. Here is a diagram:
I wish for a label actor to be on top of an image actor.
Can this be done?
Upvotes: 3
Views: 1058
Reputation: 7247
Thanks to @noone for guiding me to the stack. Please note my code is apart of a scroll pane. Also note the last item to be added to the stack will be on top. So that's why I add image and then the label.
Image image = new Image(texture);
Label buildingName = new Label(entry.getValue.name, skin, "building");
buildingName.setAlignment(Align.top);
Stack stack = new Stack();
stack.add(image);
stack.add(buildingName);
stack.addListener(buildItemUIListener); //used for click listener
stack.setName(entry.getKey()); //Used for the click listener
table.add(stack);
Upvotes: 7