On GUIs..

posted in Not dead...
Published March 24, 2007
Advertisement
So, having spend the last 12h or so playing UT2K4 I've made very little progress on my GUI ideas, infact the most amount of work got done in my head as I went to get junk foods the other night.

The basic idea I'm knocking around is that a gui is defined by two elements;
- an XML file which describes the layout of panels (with all your normal widgets in)
- a script file (Lua in my case) which handles how callbacks are dealt with etc

A bit of C++ magic will bind the two together and handle drawing/message routing/etc and we'll live happy ever after... or something like that.

The XML layout seems sane; GUIs by their very nature are hieractical and a nested structure seems perfect to describe it.

The scripting backend allows fast tweaking and control of the GUIs responce and dynamic types. The objects which exist script side have to expose certain properties/functions in order to work with the GUI C++ code, however their names and types don't matter. This means the types aren't frozen in the C++ code, instead it deals with an interface and we can make up elements as we feel the need.

So, the XML file could define a widget 'myCoolWidget' and when it's loaded the C++ loader just looks up that name in the relivent script file in order to bind it to it's actions.

Seems like a decent reusable system to me; I've a game to write this weekend however depending on how quick that gets done I might take a crack at this next week sometime before finishing off my final year project's code.
Previous Entry TLM : ATI Driver Progress
Next Entry On Java...
0 likes 1 comments

Comments

MARS_999
Hey Phantom, have you checked out gui-chan? I am using it now and it's great.
March 29, 2007 10:38 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Advertisement