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();
Gdx.input.setInputProcessor((com.badlogic.gdx.InputProcessor) stage);
atlas = new TextureAtlas("levelsmenu/levelmenu.pack");
skin = new Skin(Gdx.files.internal("levelsmenu/liststyle.json"), atlas);
//example of the tables with image and text identifying each level
tableLevel1 = new Table();
tableLevel1.add(new Image(skin, "rhlevelone"));
tableLevel1.add(new Label("THE HOOD", skin));
//table with the levels available
Table levelList = new Table(skin);
levelList.add(tableLevel1);
levelList.row();
levelList.add(tableLevel2);
levelList.row();
// etc.
// ScrollPane
scrollPane = new ScrollPane(levelList, skin);
//
table3.add(scrollPane).padLeft(220).expandY();
//
stage.addActor(table3);
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