Skip to main content
gamedev.net
🔒 Locked

User Interface

Started by vbisme 0 replies 300+ views
Original Post
vbisme
vbisme
Could anyone give me any insight on developing a user interface? How you would go about design it so that it is general? Would you have UI objects that keep track of Menu objects which keep track of controls such as button? Should controls be made from a general interface?
Spacecat
Spacecat
I recommend you have a look at this article.
http://www.gamedev.net/reference/programming/features/gui/

And after having built one, I recommend the following: Have all your ''GUI'' objects contain a small state machine to figure out when they''ve been clicked, dragged, double-clicked etc... And thanks to virutal inheritance, make it so any ''mouse event'' like this rolls a function of the GUI that needs only be defined.

In the first GUI I made, I''d have several functions called ''MouseDown'', ''MouseClick'' and so on. In hindsight, I''d suggest making one ''MouseEvent'' function that receives two or three DWORDS with the first indicating the event type. Generally, those generic messages are a great way to communicate between objects.
=^.^= Leaders and teachers should remember: It is best to offer others what they Need, not what they Want.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.