Game GUI structure - Switch betwen screens

Hi everybody!

I have been reading and testing the appstates tutorials and de nifty gui manual and tutorial but i dont understand how to make the interface structure of my game.

Im triying to make some diferent screens in my game. An intro screen, a menu screen, a character selection screen and a gameplay screen.

I have read about the use of appstates and screencontrolers, but i dont understand how to switch from one screen to other.
I have make the 4 screens that i have mentioned in xml, and i can load the first, but i dont know how to ,for example, to call the character selection screen form the menu screen or either return to the menu screen from the gameplay screen.

Also i want to implement diferent key mappings in the diferent screens, and i dont know how to make it.

Thank you all for reading!

Have you tried Nifty.gotoScreen()?

In my game, I wrote a class GuiScreenController which extends AbstractAppState, encapsulates a Nifty screenId, and implements ScreenController. I create an instance for each screen (intro, menu, etc.). The app state’s initialize() method invokes getNifty().registerScreenController(this); and when enabled it invokes getNifty().gotoScreen(screenId);

1 Like

also, have a read of this http://hub.jmonkeyengine.org/2013/04/the-herodex-gui-working-in-jme3/

1 Like