Would anyone be interested in an alternative GUI?

I’ve been shuffling around the idea of taking the jpony GUI and making it a stand alone library for JME. I know we already have Nifty and Lemur. Jpony GUI is a bare bones minimalist GUI that supports only a few basic controls such as label , textbox , image , button. I also have a premade common control library with a dailogue box , slider etc. which are all made from the core components.

There are two major differences with this GUI.

The biggest difference with Jpony GUI is you set the scale then the elements are adjusted dynamically to your resolution. For example default is 1000 x 1000. Which means the GUI is 1000 units in width and 1000 units in height. Setting an object at 500x , 500y would center it no matter what your resolution. It sounds confusing at first but in the long run only calling one line of code to adjust your elements to screen portion is such a time saver.

The second is all of your controls are hand drawn. I have a few default images I use in the GUI editor but every thing else is hand drawn. Your button up and down images are set by you. I frankly never cared for the graphics2d generated controls I find them plane and boring.

I created a GUI editor that is for the most part self explanatory. So their is no need manually code the controls.

On the topic of code here is a sample of how you would code a button. First add your listener/interface then call.

@Override
    public void mouseDown(Control control) {
        if (control.getName().equals("start")){
            gameManager.clear(); 
            load = true;
        } else if (control.getName().equals("exit")){
            gameManager.clear();
            gameManager.app.stop();
        }
    }

Every control has default support for mouse up , mouse down , mouse exit , mouse enter , click(left click by default), control drag(dragging the control with mouse) , control resize and mouse move.

Audio support is also included so you can make sounds such as clicks and pings as you interact with controls.

If there is any interest I’ll convert the library over and put the finishing touches on the GUI editor. I’ve been using this as a personal tool for a while but if there is enough interest I’ll be glad to make it a part of the community.

Here is a little test I was doing a while back. This doesn’t show what it is really capable of more that it is functional.

3 Likes

Like:
guiNode.setLocalScale()?

Or something more advanced?

In my Lemur based, apps, I get essentially similar behavior just by having a root node that I adjust scale on. (It also lets me bypass that when I critically need to for some reason.)

Why not? I mean, if someone doesn’t need to have a complex GUI and is good to go with a simple one with basic elements, I see no reason why not to use your GUI. Then of course it would be necessary to write a documentation and explain how to use it.
By the way, well done :grinning:
Greetings, Domenic

1 Like

And this is why we need better documentation and samples rather than a new GUI toolkit. Sorry, but somebody has to say that (and that somebody can’t be pspeed as he might sound biased).

Having a simple, easy to use library can sound nice and n00b friendly but eventually you’ll need more, and the “simple” approach might not scale well.

On the other hand, we have “complex” library that lacks some features and/or come with some peculiarities that you might or might not enjoy (nifty).

My advice: work on established gui like lemur rather than reinvent the wheel…

1 Like

I was never too found of nifty and I couldn’t get Lemur to work. Hence I put together my own simplified GUI. Who made Lemur’s and are they still around ?

Lemur’s author is @pspeed

I expected it to be someone named lemur :stuck_out_tongue:

Lemur is a type of primate… and so loosely follows the “naming things after monkeys” theme.

Why didn’t Lemur work for you? It’s like the simplest library to get up and running so hopefully it was just something simple missed.

I can’t even remember at this point. It’s a little late now. My GUI suites my needs. I think it was something to do with the error handling library.

Ok…

Because that pretty much precisely describes Lemur in its current state. Even your next sentence.

Lemur was written to be a bunch of useful stuff (like picking, input mapping, etc.) so that people could make their own GUIs easily in a JME-friendly way. It also includes its own UI elements that use those things… but the original intent was to be the basis for all of the custom UIs that were sprouting up.

For example, there are a bunch of things to consider when even doing something as simple as supporting mouse picking. I think Lemur’s solution to this is pretty elegant since it works with any JME scene 2D or 3D and any JME spatial. And InputMapper is good enough that I have at least one core dev keep asking me to move it to JME core.

You may find that as you add the required features to your minimal UI that it starts to grow unwieldy from all of the custom stuff you have to layer in. At that point, please consider revisiting which jar you might have been missing when you tried Lemur before.

…because Lemur has no “error handling library”. It has exactly three dependencies:
org.jmonkeyengine:jme3-core:3.1 or above
com.google.guava:guava:19.0
org.slf4j:slf4j-api:1.7.13

I know you’ve moved on but as the author I still wish I knew more about what the actual issue was so that I could fix the documentation at least.