Original Post
🔒 Locked
User Interface
Advertisement
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.
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.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement