Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Hot Zone for Mouse Clic Detection

Author
Message
Fernando Castro
18
Years of Service
User Offline
Joined: 21st Dec 2005
Location: Mexico
Posted: 25th Jan 2006 08:04 Edited at: 25th Jan 2006 08:05
Hi, is it posible to create a 'hot zone' for mouse clic detection in that area? and another question... is it posible to detect a mouse clic over a 3D object?

This is for made the Option Menu of the game, for select the tipical options... New Game, High Scores, Load Game and Exit Game...

Thanks
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 25th Jan 2006 08:37 Edited at: 25th Jan 2006 09:20
Yes... and yes

"Hot Zone": You have to implement it by yourself, check the position of the mouse every sync. //edit Of course, only when a mousebutton is clicked you have to check the area.

(is Mouseclick && is it inside the area? YES -> doSomeWikkidStuff)

"mouseclick over 3d-Object"
Same goes for mouseclick over 3d-Object.
I think dbPickObject will do a good job.
(at least this was the command I used for a similar thing)

If the user clicks a mouse-button then check with dbPickObject.
If it returns >0 you can do the item stuff.

ps: with PickObject you can provide a start and end ID so you
can check only your ID range for the Menu items which will speed up things (if you have other 3d objects that are not menu-options).

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;
Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 25th Jan 2006 11:09
Here is what I do:

I always have a variable with the object where the mouse is. This allows me to do hover kind of action to highlight the current object.

The I have an IF statement that sends all the relevant data to another function.

Something like this:



Hope this helps.

The only lazy people that can complete games are genius. You don't look like a genius, so you better stop being lazy.
Support your local Riker 9 Chapter.
Fernando Castro
18
Years of Service
User Offline
Joined: 21st Dec 2005
Location: Mexico
Posted: 26th Jan 2006 03:19
Both methods were very good for the resolution of the problem,
thanks,

Fernando

Login to post a reply

Server time is: 2024-11-19 04:19:30
Your offset time is: 2024-11-19 04:19:30