GPWiki.org
GPWiki.org
It is currently Thu Jun 20, 2013 10:24 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Menu Hit Detection Help
PostPosted: Tue Sep 06, 2011 4:45 pm 
Shake'n'Baker
User avatar

Joined: Mon Jun 14, 2010 3:51 pm
Posts: 62
Help! I am stuck with menus! :doh

I can render option texts in a listed order but how to calculate on which option is that damn mouse?


Top
 Profile  
 
PostPosted: Tue Sep 06, 2011 6:07 pm 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11200
Location: Abingdon, MD
You need to provide more information.

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
PostPosted: Tue Sep 06, 2011 6:39 pm 
Novice
User avatar

Joined: Thu Sep 01, 2011 3:44 pm
Posts: 6
Two thing popped in my mind.

You fix two points A(x1,y1), B(x2,y2). A represents the top-left, while B represents the bottom-right coordinates of the option text. After that you check if the mouse is between those coordinates.

The other one is similar, you create some kind of panels as menu items and draw the menu text on them. After that you draw the menu items wherever you want and check if the mouse is over them.

I Hope it helps.

_________________
The ultimate source of FREE programming tutorials.


Top
 Profile  
 
PostPosted: Thu Sep 08, 2011 11:07 am 
Shake'n'Baker
User avatar

Joined: Mon Jun 14, 2010 3:51 pm
Posts: 62
I thought my topic post wasn't submitted.....and I think I didn't post in this category with that name....anywayz

zilik wrote:
Two thing popped in my mind.

You fix two points A(x1,y1), B(x2,y2). A represents the top-left, while B represents the bottom-right coordinates of the option text. After that you check if the mouse is between those coordinates.

The other one is similar, you create some kind of panels as menu items and draw the menu text on them. After that you draw the menu items wherever you want and check if the mouse is over them.

I Hope it helps.


Thanks, it does the trick of checking if the mouse of the option area.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group