Game Development Community

Periodically Mouse Down Event for Button (GUI)

by beyond · in Torque Game Engine Advanced · 02/22/2011 (7:04 am) · 2 replies

Hi!

I need to do "Continuous Pressing" Button,
which must be work with "Auto-Repeat Clicking"
while Mouse button Pressed... I try to use
MouseDown event, but it's executed once..
But i need a event, which can be executing
periodically, while button pressed...

Thanks for any help.

#1
02/22/2011 (4:00 pm)
I'm aware of a performClick(); function on some gui controls, you may want to combine a mouse event with a loop on that function.

Be cautious though, you don't want to send multiple calls to the same function at once, that would give you a nice infinite loop.
#2
03/06/2011 (10:12 pm)
You can use movemap.bind("your_function");

function your_founction(%val)
{
//your logic
}

check if(%val == 1) then call a schedule function to repeat itself.

else if(%val == 0) stop the schedule function.

Hope this will help.