2011/3/13, 6:38 pm
libgdx has support for files created by the Tiled Map Editor, allowing you to easily create 2D orthogonal map scenes for your games. Once it’s up and running it is really neat. Getting it all to work requires careful setup, however. Updated 2011-03-20 after finding a critical problem found while following these steps again.
Continue reading ‘libgdx, Tiled Map Editor, TexturePacker, and you’ »
2011/3/11, 6:42 am
This won’t be a full on tutorial — it’s late, and I just now figured out how to do this — but I’m hoping that this will be helpful to others who go looking for a way to center their TWL layout within the screen, allowing you to do whatever it is you want around (behind) TWL.
As documented in TWL.java, libgdx is creating a root Widget that is set to take up the whole screen. So, if you want to center a TWL layout you’ll need to do it with TWL methods.
Continue reading ‘libgdx and TWL: Centering your layout’ »
2011/3/10, 5:40 am
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’ »
2011/3/7, 12:18 am
Note 2011-03-09: I’m in the process of revamping this with some new understanding of how to rotate in 3D. I’ll also write up something separate about using the “new” InputProcessor class.
I spent some time this morning looking up how to process user inputs while using libgdx. There are some old tutorials out there that appear no longer relevant (InputListener is gone, for example). I couldn’t find something demonstrating the new input scheme (just a note that the tutorial is out of date). So, here’s something really, really basic that will hopefully get folks started.
Continue reading ‘libgdx, cubes, handling inputs in ApplicationListener.render’ »
2011/3/4, 3:29 pm
So, as I said earlier, I couldn’t help myself. I had to keep working on dAST. I’ve added a whole new control scheme, updated the main menu and game over screens, and added online tracking of scores. I’ve rejiggered the way the graphics are drawn on the screen and tuned the tick methods, both based on a lot of traceview analysis (profiling). I made a new game layout for large devices, but I’ve only been able to test it on the emulator.
The new control scheme is the most exciting update. Instead of having two “virtual joysticks”, the player can draw a path that the ship is to follow, and then fire from the ship while it is traveling. The further the ship travels along the path the larger the score multiplier goes. I received some early feedback (don’t yet have permission to reveal the name) suggesting this sort of control scheme and I’ve finally gotten around to implementing it. I think I like it quite a bit. It should work well on large format devices, but it works OK on phones, too. It has a couple of rough edges, but I think it’s at least ready for a wider “test” to find out what people think of it. As always, I’m collecting feedback (although sometimes it takes me a while to get to it, as was the case here, d’oh…)