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.

DarkBASIC Professional Discussion / Mouse 'Gesture' Recognition

Author
Message
Sad Professor
20
Years of Service
User Offline
Joined: 14th Apr 2005
Location:
Posted: 2nd Oct 2005 22:30
Hi, does anyone know how you would go about recognising mouse gestures that games like Black and White would use? I.e you draw the shape of a star, the game recognises the shape and executes a particular command associated with it?

Thanks for any help
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Oct 2005 22:42
I suppose you could take the position of the mouse at time intervals, and using some trickery perhaps convert the gesture to only 45 degree lines?

No idea really

"A book. If u know something why cant u make a kool game or prog.
come on now. A book. I hate books. book is stupid. I know that I need codes but I dont know the codes"
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 2nd Oct 2005 23:33 Edited at: 2nd Oct 2005 23:34
get the points where the direction changes by breaking the screen into zones and look for sequences like high point left,low point mid,high point right...the user made a "V" shape, you could have several hidden hotspots that where quite large that had to be passed through in the correct order for the specified shape, me I would right click and let em select a symbol from a cabalistic type wheel or something, gestures are a gimick and often don`t work when you want em in a hurry (as in Black and White), they are not what I call a proper control system, at least provide the option of another control method if you feel you must have gestures.



why do they say Aliens are gonna be friendly?, surely the agressive ones wipe out the peaceloving ones, so all you have left out there are crazed flesh eating interstellar monsters.
Raven
20
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 2nd Oct 2005 23:39
Gestures are done by taking the mouse position in an array and evalutating what it's done, against a vector map.

You compensate for the size of the screen the use has used, using the outer points as the markets. Then you check it's variation, provided it's within tolerance you then accept it.

If I could run DBP right now I'd show you a very simple method.

Sad Professor
20
Years of Service
User Offline
Joined: 14th Apr 2005
Location:
Posted: 2nd Oct 2005 23:54
Thanks for all the help. I could run DBPro right now...

Login to post a reply

Server time is: 2025-06-20 06:11:35
Your offset time is: 2025-06-20 06:11:35