• Advertisement
Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    423255

On GUIs..

Sign in to follow this  

82 views

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.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement