# LibGDX MainMenu with ScrollPane - Select Level and press Play

In my level Menu, I am using tables that have images and text to identify each game level. Those tables are in a table that is inside a ScrollPane so the player can browse the levels available.

Here is how i've written the code:

//top of my show() method

stage = new Stage();

//example of the tables with image and text identifying each level

tableLevel1 = new Table();

//table with the levels available

Table levelList = new Table(skin);
levelList.row();
levelList.row();
// etc.

// ScrollPane

scrollPane = new ScrollPane(levelList, skin);

//

//


On the stage I have a button to go back to the Main Menu and a button to play the level selected.

I would like to request help to figure out how to set the right listeners so a level can be selected in the ScrollPane and then played cliking the Play Button.

Should I use FocusListener or ClickListener?

Here is an illustration of what I want do do:

Thanks in advance for any help that may come!!!

Rich Days

This is the logic:

• Create ImageButtons or TextButtons first
• Add these to a Table
• Create a ScrollPane with the Table
• Set ScrollPane position and size. You can disable scrolling in a direction using scrollPane.setScrollingDisabled()
• Add ScrollPane to the Stage

Try using ChangeListener, i've never used a ScrollPane but I did some UI's using ChangeListener!

• This answers needs some additional meat. More implementations details, pseudo-code, or something. Right now your advice is too vague to be useful. May 19 '15 at 23:16