Page 1 of 1

Mouse Button Down Question

PostPosted: Sun Dec 09, 2012 6:53 pm
by happyjustbecause
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?

Re: Mouse Button Down Question

PostPosted: Sun Dec 09, 2012 9:03 pm
by skydereign
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.