Nifty GUI alternative (or at least some documentation...)

Hi,



i really enjoy coding with jme3, but when it comes to writing a working user interface with nifty gui it became really annoying. There is just no documentation. At all. The wiki with about 5 tutorial pages that don’t even cover 10% of the basic functionality and which have been last changed a year ago are no real help.

I didn’t make any progress in days now, even after reading the xml schema (which was a real depressing insight in how useless undocumented apis can be…)



How did you learn using niftygui? And if you didn’t, what alternatives are you using?

The niftygui wiki contains more information, reference and tutorials than the jMonkeyEngine wiki:

That’s the wiki i’ve been talking about. Just have a look at the reference page

http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Reference



If i compare the entrys to the xsd, there isn’t even a page for every element that can occur. And the existing pages are full of todos and only list a little excerpt of the possible attributes and child elements.

I’m just trying to get to know how to style your panels. There is no reference for this element at all and the xsd says it has about 20 possible attributes.



It’s really hard to learn writing stuff with nifty, if there is no real reference and just some really basic tutorials…

But theres a lot of example files in svn… Afaik @void256 is working hard improving the documentation and you are not the first to complain about this, however almost none of the people who complained ever improved the documentation after they had learned how nifty works :frowning:

1 Like

Yes, I know what you mean. Basically everyone celebrates niftys functionality but blames its bad documentation but no one is willing to improve that situation (including me :stuck_out_tongue: ). I believe madjack was about to do something but somehow it all went dead. You are welcome to add documentation and void would be glad to support you :wink:

normen said:
however almost none of the people who complained ever improved the documentation after they had learned how nifty works :(

*cough* I did some documentation. I even expanded Nifty's own docs/tutorials/effects. :P

Dodikles said:
I believe madjack was about to do something but somehow it all went dead.

It's not dead, but unfortunately my first priority is my game. After going through the day, doing my own stuff, It's tough to do documentation. But that custom control tutorial is still around. It'll be done when I have some time. Right now I've got too many things with higher priorities sadly. :(
madjack said:
*cough* I did some documentation. I even expanded Nifty's own docs/tutorials/effects. :P

Well I said "almost none" :) That "almost" is almost completely you ;)
normen said:
Well I said "almost none" :) That "almost" is almost completely you ;)

Ah, well, erm. Ok. :P

In my own case, I got something working but had no confidence that I did it the right or the best way. I understood it only enough to make the screen look like I wanted but that’s far short of understanding it enough to add documentation. And the whole “getting back to work” thing doesn’t help.

Well, that’s what i’m currently doing. I’m documenting every piece of the xml schema I am able to decipher. But don’t expect too much, most of it is still a riddle to me…



what do the x and y attributes do? (xpath: nifty/style/attributes@x)

the best thing - and what always works for me - is to get on a forum and bitch about how terrible things are. I couldn’t believe it at first but really, that really works! some people are just lazy bastards and need my talent to bitch so that they wake up and finally can get their shit together. I never get involved in open source projects in any other way. I just use them and bitch about how terrible they are. And of course I’ve never ever donated any of my money to support a open source project. pff, it’s free to use why donate? that would be just stupid… har har



The interactive Nifty 1.2 tutorial is a great way to learn some of the concepts. Don’t be afraid that it is “1.2” tho. Most of it is still relevant for 1.3 and it really explains the basic ideas.



There are lots of examples projects availabe. The <a href=http://nifty-gui.sourceforge.net/webstart/nifty-examples-1.2.jnlp’>1.2 example is online available to watch and the source is as well.



There is not yet a complete document/wiki available to learn Nifty. I’m working on it but it’s not the top priority right now, because there is too much other Nifty related things going on. Sorry about that.



But there is always the source so you can always take a look at how things are done in detail.



google sometimes helps as well.

2 Likes

When you have a panel that uses absolute you use X="#" and Y="#" to place the child element. This is the offset from the parent’s 0, 0 (in pixels).



So, it would look like this:

[xml]

<screen …>

<panel childLayout=“absolute” …>

<panel X=“5” Y=“5”>

… etc …

[/xml]



That would offset the second panel by 5 pixels on X and Y from the position of the first panel.

ah ok, only works in combination with absolute… noted.

klamann said:
ah ok, only works in combination with absolute... noted.

I know it's for absolute and that it works with it (Duh!) but I honestly never tried it otherwise, so it might also work. No idea what the result would be though. It could just be ignored or be offset or crash. *shrug*

layouts are explained in that online 1.2 tutorial webstart in detail … sometimes I think no one ever watched it :stuck_out_tongue:



just checked and made a screenshot for proof that it is indeed explained :wink:



http://i.imgur.com/XN0N2.png



… and look! it even has fancy graphics that explain it! >__<

madjack said:
I know it's for absolute and that it works with it (Duh!) but I honestly never tried it otherwise, so it might also work. No idea what the result would be though. It could just be ignored or be offset or crash. *shrug*

no, it just gets ignored ^^

void256 said:
layouts are explained in that online 1.2 tutorial webstart in detail ... sometimes I think no one ever watched it :P

I really like the interactive tutorial, didn't know that it existed :)
Is the sourcecode available too? I haven't seen any open source software using nifty gui by now. Just closed source games.

sorry if i've insulted you in some way, that wasn't my intention.

snap, i never knew that 1.2 interactive tutorial existed, thanks!

and after bitching they apologize, it’s always the same…



the source is availabe of course! :smiley: it’s part of the nifty-examples project. you can find the link in my answer above. it’s in the de.lessvoid.nifty.examples.tutorial package/folder, I think.

1 Like

maybe you’ve missed the nifty gui blog then as well? everything I’ve posted here and a bit more is on the blog. and there is a twitter for “nifty-gui” as well → @niftygui

void256 said:
and after bitching they apologize, it's always the same...

Would you prefer they didn't? :P