Another gui lib

Hi,



i would like to ask, if it would be difficult to integrate the TWL GUI library in jme. It's fast, widget based and nice looking.



http://twl.l33tlabs.org/

I don't think the jME team want to integrate more than one GUI system directly into jME3, as I gather that jME2 had problems with lots of different GUI libraries. However, it would be very useful if it were easy to add your own GUIs into jME3; I'm not sure how easy it is to do atm…

I don't know the jME structure (have not used it) but there are 2 ways you can render TWL:

  1. use TWL’s LWJGLRenderer - this is a pure GL11 based Renderer which uses immediate mode and display lists. Look at LWJGLRenderer.startRenderering() for the GL state it uses. You need to disable things like multi texturing, VBOs, shaders etc before rendering the UI.
  2. write your own Renderer to render via jME’s APIs



    for input handling you have again 2 options:
  3. polled input handling (eg LWJGL’s Keyboard and Mouse classes). This is done by providing a Input class (or using the existing LWJGLInput). And then calling gui.update() like in the TWL examples.
  4. not using gui.update() and instead calling it’s method directly and substituting handleInput() with your own code probably from a input event/callback in jME. This approach is used for the TWL+Slick integration: Using TWL with Slick or Integrating TWL into StateBasedGame



    With the TWL update today the core TWL lib no longer depends on LWJGL. That means when using option 2 above you can also use JOGL as GL backend.

Matthias – I saw the theme editor webstart on your site… is that a full blown layout editor, or just a skinning tool ??

It's a theme editor (eg a "skinning tool" as you called it). It edits the theme XML files and provides you live preview of your changes. It can also load your classes as long as they have a default constructor. You can best test this tool by downloading the TWL examples source code and opening the example themes and JAR file.

This is impressive - i would happily use elements of this Gui lib and elements of nifty gui for my jme3 based project.



Im keen to see how you get on integrating it…!

I like TWL quite a bit and am using it for a JME2 project of mine. It's great.  The editor is really adds a lot of value.  A really slick font editor was just added which makes it super easy to create decent looking text out of any TTF font. 



After I had integrated TWL I had a look at Nifty GUI and it looks top-notch as well.  It sounds much more of the UI layout is defined in XML with Nifty GUI but I haven't dug into it enough to know how much this is true.    Regardless, I really like just being able to tweak the java that comes with TWL to make my own widgets and the TWL XML provides a good balance between XML and code for me.



I just wanted to put in a good word for TWL as MatthiasM has put quite a bit of work into it and I have really enjoyed using it.


If you've already integrated it in jme, perhaps you can give a hint how to make it, and perhaps the jme developer think about the integration cause for me nifty don't fit all requirements i need for a nice widget based gui lib to develop my project in a short time. I'm currently working on another jme-based gui-lib(another guy has presented as prototype) in swing style.



Having a good, easy and powerful gui-lib is essentially for all jme projects i think.

Hello!

I ported swingGui from jme2 to jme3!



I tested it on Linux Ubuntu and MS Windows XP, and it works. (only lwjgl)

Only Ortho-Mode (2d) is supported at this time.

You can get it here: http://soundmodul.heim.at/starcom/swingGui/swingGui.html



Bye

Good work! Saved me some work. Tested this on ubuntu 64bit w/ LWJGL OpenGL 2, 3, and 3.1 with the following mod to ImageGraphics on line 75:



replace

else if (settings.getRenderer() == AppSettings.LWJGL_OPENGL3)

with

else if (settings.getRenderer().contains(AppSettings.LWJGL_OPENGL3))



If anyone else wants to test this out apply the following patch and unzip the zip into your jME3 checkout dir. (patch -p0 < buildFiles.diff)

http://www.gravityresearch.us/swinggui.jme3.zip

Would it be fine if we add this to jME3 repository? (If it works well for us)

Momoko_Fan said:
Would it be fine if we add this to jME3 repository? (If it works well for us)

How about we add it to the jMP contribution repository for now?

It looked light a straight-up port of JMEDesktop from my review of it.

However, it would be really nice if somebody could port TWL to work with jME3. I must admit that for me, too, Nifty-GUI does not fit my all my needs. Furthermore, working with Swing might be a very easy and simple thing to do. Still, everybody knows Swing is not really… high-performance…

Just an information:

I updated swingGui, so now we have not to worry about different resolutions.

You can get it here: http://soundmodul.heim.at/starcom/swingGui/swingGui.html

1 Like

Hey , nice to see other guys to handle the gui stuff in jme.



Currently i’m developing a (full jme based) gui lib, which has nice performance(still at 680 fps with scrollpane,textfields,buttons e.t.c ). As soon as the basic components are implemented i will share it in one of the gui topics.