Monday, May 29, 2006

That'll be quick

Excellent! I've nearly completed the GUI management code. It takes a bunch of xml files from a "skin" folder and uses that data to construct every screen in the game. As a result, it's exceedingly easy to develop the interface and it should hopefully provide the capability for any community (man, I should be so lucky) to create new looks for the game.

On the downside, it's currently very easy to "break" it. A misplaced tag here or an attribute there in an xml file and an entire screen could disappear. While this isn't a problem for me when developing it, I can't have that in any final release and expect new skins to appear. It's got to be pretty fool proof. Perhaps the most important thing is keeping a well defined structure to the screens - always having certain elements in certain places is a start.

A title bar, for example, appears in virtually every screen so I have that down as a single panel (a screen being made up of panels). If I move that panel, it'll move the title bar on every single screen, but obviously moving it can result in parts of other screens being obscured unless they know to take advantage of that.

I'll see about adding some extra types of gadget so I can define areas of the screen. Though I don't want to spend too much time on this right now, as it's not an essential. It's easy to come back to it as well, as it's pretty much independent of the game itself. Provided the GUI manager tells the game what buttons are being clicked, and the game can tell the GUI what to do, what happens under the hood doesn't matter.

No comments: