Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: tylo on June 26, 2012, 09:28:21 AM

Title: How to make a "Click and Hold" Button
Post by: tylo 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.
Title: Re: How to make a "Click and Hold" Button
Post by: PhilipC 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.
Title: Re: How to make a "Click and Hold" Button
Post by: YD4k on June 27, 2012, 03:09:43 AM
Sorry Miss reply