GetKeyState for mouse clicks

Talk about making games.

GetKeyState for mouse clicks

Postby Rebenely » Sat Dec 06, 2014 4:14 pm

Is there a getKeyState equivalent for mouse clicks?
I am trying to create a function that will the count number of right clicks made.
User avatar
Rebenely
 
Posts: 16
Joined: Fri Apr 05, 2013 1:13 pm
Score: 1 Give a positive score

Re: GetKeyState for mouse clicks

Postby Zivouhr » Sat Dec 06, 2014 5:07 pm

Here are a couple threads that might help a little:

http://game-editor.com/docs/script_reference.htm

viewtopic.php?f=31&t=13052&p=93636&hilit=mouse+clicks#p93636

I haven't used mouse buttons much yet while experimenting with Game Editor, so the only thing I can think of is having a hit point counter on the object the mouse is over in the screen, and each time you press the mouse, it would tally it up until the certain amount of clicks, and then do the action.

Not sure how to code that offhand or if that's exactly the goal.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: GetKeyState for mouse clicks

Postby lcl » Sun Dec 07, 2014 3:49 pm

There isn't a way to get mouse state the same way as GetKeyState does for keyboard.
What you would need to do, is to have an actual actor, most likely a Filled Region actor, which you would use to count the clicks.
Every time user clicks that actor, a variable holding the amount of times clicked would increase. You could resize the Filled Region to cover the whole screen so that every click would be clicked on that specific actor.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron