CosmicGiant
CosmicGiant

Reputation: 6439

How to create a tabbed panel in LibGDX?

In LibGDX, how can I create tabbed panel (screen areas) whose tabs switch visibility between multiple child panels?

Are there any ready-to-go frameworks?
or
How can I code a "TabbedPanel" class?

Upvotes: 1

Views: 3795

Answers (3)

user1482309
user1482309

Reputation: 309

You could easily do this with a Table and Buttons inside a ButtonGroup

The first Row would be Buttons inside a ButtonGroup, so that minimum one Button and maximum one Button need to be checked.

The second Row would be the content. Here you can use a Pane or Table. Inside the ClickListener of the Buttons you add and remove the content (as Actor) dynamicly.

Use the UI Skin to create tab Buttons, that look like tabs.

Upvotes: 2

Thiago Pantaleão
Thiago Pantaleão

Reputation: 91

I don't think libgdx has it and have never seen it, but i think a good way to go would be using a table inside a table.

the first cell of the first table would have a table made of buttons and the next row of the first table would have the the pane, making every button switch the pane that is in the second cell.

Just an idea though.

Upvotes: 1

bemeyer
bemeyer

Reputation: 6231

Take a look at the table and the scene2D stuff from libgdx

Table layout
scene2D

also take a look at the scene2d UI stuff
Scene2D.ui

Upvotes: 0

Related Questions