The UI API is now in SVN (and the nightlies). Couple of caveats, warnings, etc.

  • While most of the API is stable, there might be minor changes (or rather additions, hence not API breaking) in the future
  • It’s likely that there are bugs.
  • It of course needs some performance. The UITest below renders at 20fps on the Hero, 26fps on the Samsung Leo (320×240 phone), and 60 on the Nexus One and my HTC Desire, 72fps on the Transformer.
  • I’m in the process of writting the documentation

Considering all this please start experimenting with it. For feature requests please add a message to this issue on the issue tracker. I do not promise to fullfill all requests, but i’ll make sure that we arrive at the largest common denominator.

You can find a basic skin in “test/gdx-tests-android/assets/data/uiskin.xml”. An accompanying test can be found here. Here’s the output of that test.

As i said above, i’m currently writting the documentation for this new API. Please be patient, i do my best to finish it off by Tuesday.

11 thoughts on “UI API in SVN

  1. Now I can write great level editor inside libgdx. This is awesome stuff. Keep up the good work guys ! You’re the best 🙂

  2. Android noob here. Can the UI API be used to create a full menu system with buttons, a title, etc.. Or does it only have built in widgets that can be used?

  3. you can do that. there are precanned widgets as you see in the demoapp. those should suffice for most use cases. you can also fully skin them as explained. if you need something special you can always easily write a widget on your own.

  4. That’s actually the functionality I wanted. Just to have some basic buttons with some images overlay

  5. Hi,

    I’m not following libgdx as closely as I would want to these days, so excuse the question, but:

    How does this stand with regard to TWL ? Is this to be considered as a replacement, or an alternative ? What are the big differences ?


  6. @Obli: that would be a possibility, however, if one actually creates a skin for Android’s densities the problem will vanish. Compare the size of the UI elements in the current UITest and the sizes of Android’s standard widgets. Day and night.

    @Moxin, look into the UITest here http://code.google.com/p/libgdx/source/browse/trunk/tests/gdx-tests/src/com/badlogic/gdx/tests/UITest.java

    @Badly Drawn Rod: MOAR ANGRY ROBOTS 😀 Should i give you commit rights so you can directly change it in the libgdx repo?

    @gnurf: it is not meant to be a replacement for TWL as TWL is the go to address if you need complex UIs. However, many games do not need a fullblown UI solution, so this should serve as a stepping stone. As soon as Nate is back we’ll update the TWL backend to the latest TWL version. We will not abandon TWL ever!

Leave a Reply

Your email address will not be published.