APOCALYX is a...

free Game Engine based on OpenGL (MAIL) (SITE) (FORUM) (BLOG)

Saturday, August 16, 2008

The GLGooey GUI (II)

This post regards again the GLGooey GUI included in APOCALYX. I already described months ago all the GUIs supported by the engine (read the post) and in particular the GLGooey GUI (read the post), but now I'm developing the GUI necessary to manage the fleets of MekaWars Offline so I discovered further GLGooey's hidden capabilities.

In practice, I needed to show several properties of fighters, bombers and ships, along with some explanatory image, but in the standard components I couldn't find any way to display an image on a button or as a static decoration.
In reality, GLGooey supports user defined skins through XML and it's easy to specify an image as the background of the title bar, for example, but I needed to show lists of images and to control that lists through Lua scripts.

To solve the problem I finally used the GuiCustomWindows, a particular kind of window that a programmer can completely define, from the paint function to the mouse callbacks, using Lua scripts. The programmer can draw arbitrary patterns in the window/component calling in the paint method a big collection of drawing functions, in which are included functions to load and draw PNG images.
As you can see in the screenshot, if the images are well done, the GUI looks much better and becomes easily readable.
Compared to other GUIs, GLGooey seems less featured, but in reality all the necessary tools are there to be assembled in the way your prefer with just a little effort.

No comments: