I'm having a problem with this set of tables I'm using as a right click menu in my game. I have virtually everything finished with this part of the gui and I'm stuck on it now so a fresh set of eyes would be appreciated.You can see in the screenshot and in the game if you download it how I would like the right click menu to layout the terrain tile menu to the right of the main right click menu by adding it to a cell in the right click 'master' table. The blue outline of the right click 'master' table shows where I would like the terrain menu.Jar: http://www.mediafire.com/download/9wrrws8y6grrq6y/testGame.jar Source: http://www.mediafire.com/download/hi93aqocpnd8lff/testGame.7zEntities can be selected via keys 1-3 and placed

Any help on how to re-align the cell to the right would be appreciated, thanks

create one "main-table",create one "button-table",create one "tile-table",-> add the button-table to the main-table-> add the tile-table to the maintable when you need it.it's often easier to use more tables.

I am using multiple tables. I have:>one root/master menu table>the main right click menu table .add'ed to the master>a button in the main right click menu should toggle master.add(terrainTable) and master.removeActor(terrainTable)

all of the above works, except for the fact it adds the terrain menu cell to a new row underneath the main right click menu where I want it to be added to the right of the main right click menu:

but still no joy. I was toying around with that .row() and moving it around to see if I could effect anything but even with it removed entirely and only using .addActor() the cell was on a new row.I added everything to stage because thats how the tutorial I was following did it, though I have had to correct a few things already after looking at the official libGDX wiki. Should I only worry about adding the tables(other than the master table) to the main right click menu?I'll remove that code adding everything to stage.

It's hard to tell from your first post what you want. I guess you have a list of menu items and you want a submenu to appear to the right of a menu item when it is clicked? If so then layout your menu items using a table. Create another table for the submenu. When the menu item is clicked, add the submenu table to the stage. Because it is added last, it will be on top of everything else. Next, position the submenu table to the right of the menu item. The submenu table's parent is the stage root, so you need to use localToStageCoordinates on the menu item to get the stage location of the menu item, then add the menu item width to position the submenu table to the right of it.

To hide the submenu, remove it from the stage. To have it hide when anything that is not the submenu is clicked, add an InputListener to the stage when you show the submenu that hides the submenu and removes the listener on any touchDown. Next, add an InputListener to the submenu that calls event.stop() in touchDown. This prevents events that occur on the submenu from bubbling up to the stage and closing the submenu.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org