Advertisement Jump to content
Sign in to follow this  

Menu/GUI with themes

This topic is 4971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I thought of creating a nice themesystem for my GUI. (Like the one found in winamp 2.x and other programs).. Is it complex to use XML files for this, and how should I think?

Share this post

Link to post
Share on other sites
(more a general programming question than a graphic theory one but..)

XML gives a pretty good description of what the gui should look like. Glade (the GTK+ GUI builder) uses it to describe very complex interfaces.

The second question, "How should I think" is a bit strange. I assume that you need to know how you would do to make it work.

1) one XML is here to describe the GUI of our program. It tells where the different controls are and what their type are. When reading this file, you can instantiate the right objects to build your window.
2) you have to apply your theme on this representation before drawing it. Here, the drawing policy might be another object which can be whatever it want.


Share this post

Link to post
Share on other sites
Okay, I already have a gui with buttons, lists and so on. What I want is to split up my controls and make the look of the editable in an xml file. Not where to put them..

Share this post

Link to post
Share on other sites
Sorry, I misunderstood you [ashamed].

So your question is: how to store theme informations in a XML file. It depends. If you are defining a theme which is based on textures, then I guess that uv coords + some other pixel-based values (such as alpha test or alpha value) should be OK:

<control typename="button">
<texturefile src="texturepath.jpg"/>
<topleft u="..." v="..."/>
<topright u="..." v="..."/>

And so on.

Anyway, it will depend on your organisation and on your drawing policy. Without these informations, I beleive I can't say much. The thing I know is that if you managed to write acomplete GUI manager, you really won't have any problem to change the drawing policy to match your needs.

I hope I got it right this time ;)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!