Archive for 10th March 2011

libgdx and TWL

libgdx comes with a build of TWL, the Themeable Widget Library. This library can be used to build user interfaces including components like buttons, scrolling text areas, lists, clickable image maps, and so on. It allows the programmer to theme elements in a manner similar to the CSS. Neat. libgdx’s TWL class uses the SpriteBatch class to render components to the screen.

In this example I’ll describe how to add buttons and text components to a layout, and how to detect clicks on the components. The result will be a simple click/tap counter. This write-up is based on the TWL tests found in the libgdx source tree.

Continue reading ‘libgdx and TWL’ »