Hi guys! I have been learning Nifty GUI so far, and it’s really giving me more problems than I expected.
Firstly, I draw a simple menu using the jME editor (because if I try to type in the xml, the IDE simply edits the file without even asking). If I try to view it in the Visual tab, it looks normal. However, when I try to load it in the game, I get these errors (not exceptions):
I also validated the xml and it doesn’t throw errors.
I also need to ask: is Nifty dead? Because I’m simply getting too much trouble to use it! The wiki they have on Github is poor, and for me, I always get problems to build a simple GUI.
Nifty is still actively developed and works fine. They are currently working towards a complete rewrite I believe. The nifty editor in the sdk may not work properly… I’ve never used it and define everything in xml or java by hand. You need to post the xml output you are trying to load. The xml is probably valid, but you are probably missing the includes for the default control definitions.
@glh3586 I would also define everything by hand, but the IDE simply edits everything I wirte without warning. It’s really annoying. Are you also having this problem? I’m using the new 3.1 SDK.
I also tried to create a new .xml file and paste the code of the gui. Still doesn’t work.
And BTW, any chance I can re-center the words from the buttons? Because the control is placing the bottom of the word as center.
If that is the only file you are loading then you aren’t actually loading the default nifty controls. You need the following under the nifty tag. You can do it in that file or put it in a different xml file that you load first.
I would let it depend on how good you keep an overview on them, maybe have long XMLs in a seperate file. I don’t know if it has any impact on the performance though.
I started with one xml file and I’ve slowly moved to separating them out. It hasn’t impacted load time and cognitively I’ve found it easier. Especially after a year when you don’t remember what you wrote in the first place.