Skip to main content
GameDev.net gamedev.net
🔒 Locked

Menu System Tutorials

Started by Bu6mAn Sep 27, 2002 at 9:54 PM 2 replies 250+ views
Original Post
Bu6mAn
Bu6mAn
Hi there. Does anybody knows of some tutorials explaining the basics arround menu systems for a game using DX?. I mean, let''s supposte you have the first screen of the game, and 4 rectangles blitted with the different options: "Start Game", "Options", "Credits", "Quit". And you wan''t to change each rectangle for an animated one when the user scrolls the mouse over them. How do u accomplish that? Do u keep the coordinates of the rectangle shapes into a structure so when u get the X,Y coordinate of the mouse using DirectInput, you can check whether the mouse is over an option or not, an then animate the corresponding rectangle?. Or are there more simple techniques, routines or something that DX offers?. We''ll sorry for the simple and newbie question, but i couldn''t find an apropiate tutorial for this, and the search is off. Sincersly, Alan //
Shannon Barber
Shannon Barber
I thought there was an article on the site - but yes that's how you do it. Collision detection (which includes picking) is the core of every game, starting with the menus.

One bitmap/surface/partial-surface for highlight, another for un-highlighted.

[edited by - Magmai Kai Holmlor on September 28, 2002 1:13:21 AM]
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Omaha
Omaha
Although I don''t have any code available, I went through a similar process to produce the GUI of my project, which you can see an overview of at http://www.personal.psu.edu/djp211/rnm_web

I''m using OpenGL instead of DirectX Graphics, though, but that doesn''t change any of the theory behind a user interface.

The way I attacked it was through class derivation; there is a CGUIWindow class and a CGUIControl class. From CGUIControl I derived a bunch of different devices that would be useful: labels, buttons, scrollbars, listboxes, input boxes... Each class has a set of common virtual functions--draw, update, receive a click, etc--and a bunch of custom member functions that serve the individual purposes.
Bu6mAn
Bu6mAn
Well first of all thanks for the replies, really appreciate it. I'm very fond of programming in Delphi using MVC (Model View Controller Model), so OOP is very clear to me, but as u can imagine, all the GUI was handled by Delphi Components: text boxes, buttons, etc, which had their own events for mouseover, clicks, etc.

Now, as i'm moving onto C++ / DirectX windows programming (manually handling events and all that), i got stuck with this simple things such as how to check for a mouse over onto an menu option that's actually only an image.

Thanks a lot, both of u.

PS: If anybody can handle some sample source, it would be great. Thanks, again.

[edited by - Bu6mAn on September 28, 2002 5:51:49 AM]

Topic Locked

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

Sign in to reply to this topic.