Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

On GUIs..

Sign in to follow this  


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

Hey Phantom, have you checked out gui-chan? I am using it now and it's great.

Share this comment

Link to comment

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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!