Nifty GUI Screen Interaction [SOLVED]

I read through the Nifty Bible and started playing around with it… but i am having problems with the screen controller… Using the HelloJME example when i run the code and click on the button, i see the text in the quit function. but the start screen doesn’t go away… what am i doing wrong?



[java]

@Override

public void initialize(AppStateManager stateManager, Application myApp) {

super.initialize(stateManager, myApp);

this.myApp=(SpaceClient) myApp;



//launch the welcome page…

niftyDisplay = new NiftyJmeDisplay(myApp.getAssetManager(),

myApp.getInputManager(),

myApp.getAudioRenderer(),

myApp.getGuiViewPort());

nifty = niftyDisplay.getNifty();

nifty.fromXml(“gui/welcomePage.xml”, “start”);



// attach the nifty display to the gui view port as a processor

myApp.getGuiViewPort().addProcessor(niftyDisplay);



myApp.getInputManager().setCursorVisible(true);

}



@Override

public void update(float tpf) {



}



/**

  • nifty panel click causes this event

    */

    public void quit()

    {

    System.out.print(“We clicked the quit button!!”);

    nifty.gotoScreen(“end”);

    }[/java]



    PROBLEM SOLVED… i didn’t bind my class “nifty” variable in the overidden bind operation… weird error… This nifty stuff is not looking very intuitive… hopefully it smooths out once you get over the learning curve?

Yes, I agree it is a steep learning curve for some areas, but it can be quite powerful, modular and extensive when you create your own controls. I think it usually gives good error messages and warnings too, so mistakes are often easy to fix.