Using TWL with todays versions of LibGDX?

Is this possible?

I’ve tried adding the latest TWL gui lib to the build path in Libgdx but its not letting me import when I create ‘private TWL’ even though there is TWL.jar in the the build path like I say

Even if I did get it to work, does it still work under the hood with the rest of LibGDX?

Correct me if I’m wrong, but I see that TWL looks really cool with all its widgets compared to Scene2D

Thanks

As far as I know TWL is discontinued since a while. LibGDX has undergone some bigger changes, so I would expect it not to work any more.

In my opinion scene2d is way better than TWL. I had the pleasure of using TWL with slick2d. It produced nice guis, once I got it running but it was a major pain to get it runnning (not because it is a bad library, but because it it a very extensive library with a steep learning curve).

Btw, scene2d also comes with some widgets (scene2d.ui). Probably not as many as TWL has, but basically you have everything you need to start building an elaborate gui. If you want to make nice guis with scene2d, try to understand Tables. For most things I need in my UI’s, I often start with tables.

Have a read: https://github.com/EsotericSoftware/tablelayout , https://github.com/libgdx/libgdx/wiki/Scene2d.ui

Great thank you just what I needed

I had a GUI like the Democracy 3 in mind for future plans, some kind of other simulator, you should check out that game if you havent already - would this kind of thing be possible with SceneUI then? I’m guessing so…

Fun thing is, I bought democracy 3 just yesterday in a steam sale XD Have seen some let’s plays. I’m not sure if I like the game, but I find it very interesting (I love simulations :D), so I thought I might just give it a try.

From what I see the UI of democracy is very well done for such a complicated game (in screenshots it looks complicated but when you see it in the videos you see that the UI provides a lot of context and help for the user). I would suggest that you don’t even try to do something similar until you have grasped the basics of scene2d and scene2d.ui. Then try to identify what “components” the democracy ui (or the ui you want to make) is composed of and how you could do something like that. Make little proof of concepts for your controls and then try to get them together in the big picture.

To give you an example what I would start with, let’s take this screen: http://imgur.com/Ak34HRv

From what I see this screen consists of 3 important areas. I have marked them with different colors on this image:

There is the info bar in the top (pink), the table in the center (green) and the buttons/icons that take up the rest of the screen (blue).

The top bar and the progress bar in the center can be done very easily with tables. You see how I would create the table cells (you can do a colspan to achieve the big “popularity” cell in the green table).

In the top table you then have different kind of displays, which you can compose out of other tables or buttons (TextButton/ImageButton) with nice set backgrounds.

You can add those two tables to your stage and position them how you want to.

The icons in the blue box are basically round buttons that are freely placed in the free area. This might have be done manually or autamatically, but I would suggest that you start manually.

I would probably create a Group/WidgetGroup where I put them in instead of putting them directly into the stage.

Check out ninepatches, if you haven’t already. You can use them as background for tables and other actors.

Last piece of advice. Start working with a skin. It is really nice beeing able to define style properties in the skin file and change the overall look and feel in one place. Probably best advice to start with the skin is to use the files from the libgdx tests.

Downlod following files from this link https://github.com/libgdx/libgdx/tree/master/tests/gdx-tests-android/assets/data
uiskin.json, uiskin.png, uskin.atlas, default.fnt, default.png, default_00.png, font.fnt, font.png

I’m not sure if you need the default and font files. The important part is in the uiskin files.

Thanks a million

I love simulations to, Demo 3 has a steep learning curve, I’m always getting in debt with GDP so far but its dead fun and easy to mod. Its very inspirational. I was thinking of creating a research chemical simulator, mixing chems together and having effects of them, anti depressents, anti anxiety. I had a big list of chems from a website when I was about to do it with C# and .NET framework for GUI but the list was big and crashed and gave up but now thinking about it I should of started with a smaller array tbh but was young at the time so this is my idea really with Java. A bit of a junkie idea but I don’t think its been done, I don’t know nothing about chemistry but that makes it fun I guess. It doesn’t have to be 99% chem ‘spot on’ as its a ‘game’ and not a real simulator. The whole idea would be to use decent random Algorithms than pure randomness. I.E if you mixed 3 chems together, random kinda outcome, but it’d have to have the same results using them particular 3 if you was to play again etc etc, then you’d have an output where you’d have ‘people paid contracted’ lab rats (which yes, you do get in real life, how nuts eh?) with described effects, then you’d market and sell it through black market or commercial.

Its all something I’d plan out on paper as there would be a lot to implement, but after installing shite loads of game engines, trying to learn multiple languages as you do, these are one of the ideas I’ve had in my mind for some years a long with smaller games like pong etc that I could work on on the side whilst working on the smaller games for XP. :slight_smile: