Mouse Button Down Question

Non-platform specific questions.

Mouse Button Down Question

Postby happyjustbecause » Sun Dec 09, 2012 6:53 pm

Is there a way to have different events happen when holding down the mouse button down? I want to make a number go down faster if the "click" is held down but to have it go down incrementally by just clicking individually. Is there any way to do this?
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Mouse Button Down Question

Postby skydereign » Sun Dec 09, 2012 9:03 pm

You need to do three things. Have a mouse button down event, the draw event (or a repeating timer), and a mouse up event. In the mouse down event, you increase your variable, and set another variable to on (or create a repeating timer). That way in your draw (or timer) you can increase the variable as you want. Then in the mouse up event, you set the variable to off (or destroy the variable). The reason I mention the timer in parenthesis is it doesn't do very well with pausing.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron