Author Topic: How to make a "Click and Hold" Button  (Read 10845 times)

tylo

  • Guest
How to make a "Click and Hold" Button
« on: June 26, 2012, 09:28:21 AM »
Does NGUI have any built-in events for firing an event continuously while the user is clicking and holding down a button? Think an arrow key for movement, while the button is being held down the player would continuously move forward until the button was released.

PhilipC

  • Guest
Re: How to make a "Click and Hold" Button
« Reply #1 on: June 26, 2012, 09:54:16 AM »
No NGUI does not continuously fire events. If you need to have something happen every frame while a button is being held use the OnPress(bool pressed) function and store a local copy of pressed. Then in a Update function you can fire some event if your pressed variable is true.

YD4k

  • Guest
Re: How to make a "Click and Hold" Button
« Reply #2 on: June 27, 2012, 03:09:43 AM »
Sorry Miss reply