[SOLVED] Tonegod vs NiftyGUI

I don’t consider neither better, since they are different approaches to create your UI

I will tell my opinion after playing with both.

Tonegod is to me a lot easier to read when you want to fully create your UI with Java code. You can do this with both but making a GUI on Java with Nifty can get a bit overwhelming when you start adding more stuff. Tonegod makes “more sense” since it integrates with your game code more seamlessly. However, Tonegod’s documentation is not complete IMO and there are many issues that thankfully are resolved here in the forums.

Nifty on the other hand can give you more design freedom of your UI since you can design many elements of your UI with xml and just have a control class with relatively less lines of complex code. This makes it easier since you can change styles and layouts without touching your Java code. It is a bit more stable and the documentation can help you design your first full game UI without much help from the forum. However, it has a steeper learning curve compared to Tonegod and for begginers it can take more to have a full UI running.

Yeah Nifty is easy to start with using the XML but it soon becomes clear that you need to learn tons of stuff. I’ve seen both producing nice GUIs, so whatever your choice is, I’m sure you achieve your goal.

We chose Nifty mainly because it is default for JME 3.0 & the upcoming 3.1. It is still developed etc.

Il support what blood was saying, i have been using Tonegod for a while after trying nifty and realise it was just not for me. I kinda hated the idear of using multiple layout for my application, so pure java coding for interface was just perfect for me.

Eveyrthing is simple whit tonegod… until you need to do somebody special, then you will have to go direcly into the code to find what you need and this can get tricky. And the documentation is good for simple stuff, but is pretty poor on some part, and at some point the GUI fell not finish. Yet usely the forum have all the info you need and you can build any part that missing if you want, and have the time and knowlage :stuck_out_tongue:

Ok, thanks for your help guys!

For me, it depends on what type of Gui you are planning.
If you need complex UI like an shop to buy and sell itens for your player, etc, Nifty is better.
For simple stuff like just a image showing how many lives your player has in the game, try to build something yourself or use tonegod.
Also, Nifty is not hard to learn how people like to say, it took me only a few days to understand and build everything in my game.
If you decide to Nifty, and have doubts just ask me I can help you ok ?

…or just use Lemur as it was designed to make writing your own UI easier. It just also happens to include some default implementations of common controls like Button, Label, etc. with some layout support.

But the whole original point of Lemur was to bring together some utilities (picking, event management, input mapping, etc.) together into a base framework for UI creation.

It lacks some features of the “bigger” UIs just because I haven’t gotten around to writing those components yet… but when/if you get to the point where you are rolling your own then you should really take a deeper look. Proper mouse interaction is hard enough to get right on ones’ own let alone the other stuff that would have to be hand-rolled. Lemur makes that all modular.

Also, unlike Nifty, it integrates directly with your scene graph as regular JME spatials… so you can create 3D or 2D GUIs just the same way.

1 Like

Another comment about Nifty is that its very slow.
Dont use it in your main game screen or it will “eat” your fps.
Unless its just to show popups like exit game stuff.

I believe that you’re with both of them able to create good GUIs. But as written above: tonegod and nifty follow two different approaches. My statement:

  1. If you’re coming from the desktop application world (Swing or AWT), you’d better use tonegod, because it is more like Swing. But be aware! Some things are totally differenz from Swing and can screw up your brain! It’s like swing, but it IS NOT Swing

  2. If you’re coming from the busioness application world and used a lot of frameworks like Seam, EJB and so on, Nifty might be the better approach. I just looked at Nifty for a very short while and put it aside, because the approach with xml designes remembers me a lot to business application design.

That’s interesting. I’ve been using it for a HUD in my main action screen including menus to interact with objects. Is it well established that this is a bad idea? That’s certainly not how the tutorial about HUDs reads.

Just thought I’d point out that Lemur is also very swing-like (perhaps moreso) as I come from 15 years of Swing-based development.

Mmm, yeah, do you have any solid evidence etc. about this? Does it help anything to use the batched Nifty?

Just thought I’d point out that Lemur is also very swing-like (perhaps moreso) as I come from 15 years of Swing-based development.

Yes, heard of it. But still not available as plugin for the jME3 SDK :frowning: Do you plan to integrate it soon? I really would like to give it a try, but I’m a little bit lazy and do not want getting sources, build jar and so on …

And the most important thing why I use tonegod instead: I did not found any good introduction to it on th jME website :frowning:

I have an thread here about nifty performance somewhere.
Nifty is just not performance tuned, but it has nice functions for complex user gui.
Its easy to notice the drop in the fps when the windows are drawing, or doing effects, the example vanilla exit poupup is an example, you can even see the window drawing in the screen, so slow it is.
Some components are so slow that its almost useless, like the scrollpanel, I have an thread here showing that for each like it tooks more then 1 sec to fill when it have large number of lines.
Just use it wisely, like, just for menus and poupus, you must probably will be ok.

Nifty batching capabilities really bumped up the performance.
Nifty isn’t slow per se, but the way we render it in JME can result in a lot of draw calls because it requires a lot of quad geometries to be rendered on screen. That’s one of the reasons why @void256 added the batching feature in Nifty in the first place.


Hmm, how to enable this batching ? I tried the constructor which takes the atlas dimensions and got:
java.lang.NoClassDefFoundError: org/jglfont/spi/BitmapFontRenderer
at com.jme3.niftygui.NiftyJmeDisplay.(NiftyJmeDisplay.java:129)

The code:

        // Init Nifty
        nifty = new NiftyJmeDisplay(assetManager,
                getGuiViewPort(), 2048, 2048);

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

Plugins are busted so there is no way to add new ones right now and the new interface is apparently perpetually “not ready yet”. Still, I post the jars to the same code repo in the ‘release’ directory and you can download them directly. I don’t remember when the last time I build them was, though.

I’d make it a plugin if I could.


There is an updated jar file anywhere or we have to build it? On google code repo it’s dated from 06/05/14.

Plugins work normally…? The GrassyBanana one has just been added.

I think that was the last version that supported 3.0… and it may even slightly not. At some point I got tired of trying to maintain backwards compatibility and at that point 3.1 was “any day now”… but alas.

1 Like

Hmmm… I thought we didn’t have a build server anymore. I kept hoping Jayfella’s system would be up and running and I could just click click click to add my jars to the plugins list.