It is currently Thu Dec 05, 2013 2:40 pm

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Menu Hit Detection HelpPosted: Tue Sep 06, 2011 4:45 pm
 Shake'n'Baker

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

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

Top

 Post subject: Re: Menu Hit Detection HelpPosted: Tue Sep 06, 2011 6:07 pm
 King Code Monkey

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11204
Location: Abingdon, MD

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

Microsoft XNA MVP

Top

 Post subject: Re: Menu Hit Detection HelpPosted: Tue Sep 06, 2011 6:39 pm
 Novice

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

 Post subject: Re: Menu Hit Detection HelpPosted: Thu Sep 08, 2011 11:07 am
 Shake'n'Baker

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 2 guests

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

Search for:
 Jump to:  Select a forum ------------------ Forums    Forum Rules and Posting Guidelines Wiki Discussion    Help    Content Issues Game Programming Discussion    C and C++ Game Programming    Java Game Programming    Language Agnostic Programming    .NET Game Programming    VB Game Programming    Mobile Game Programming    Web-Based Game Programming    Other Languages    OpenGL Development    Direct X Development Game Development Discussion    Game Design    Game Media Off-Topic Discussion    Announcements    Off-Topic    Community Projects    News