I am using nifty XML for my start screen in my game. And I’ve been heavily using the wiki to learn how to use Nifty, but when I run the code, the starting screen shows however the buttons don’t work. I am aware there are similar topics to this on the forums but none of them worked for me.
It’s been awhile since I worked with Nifty at this level, but I think startGame() needs to be a method of your screen controller, not your application.
Do I need to simple post the simpleInitApp code? Or do I need to post most of what I have?
Also Im doing Nifty because its mostly the last thing left for me to try for a working gui, I don’t know anything else. But if you know something easier, let me know.
It’s up to you. How much help do you want? You need to supply an amount of information proportional to the help you need.
Somewhere in your code, you need to declare a screen-controller class. From the XML fragment you shared, it looks like it should be named mygame.Main. Does your mygame.Main class implement de.lessvoid.nifty.screen.ScreenController? (I can’t tell from the cropped images you provided.)
A possible problem is that your startGame() method doesn’t take any arguments. To be invoked from the XML and receive a passed value, I think the method needs a single String argument.
If you haven’t already, you should read the Nifty Manual. It’s slightly out of date, but it explains what a screen controller is (page 26 et seq) and how to pass a String to a callback method (page 72).
Yea, Ive done all of that, but still nothing. I dunno, but should I just try Lemur? I dont have experience with it though so Ill let you say if its good or not.