Support => NGUI 3 Support => Topic started by: Biggix on December 19, 2014, 07:34:17 PM
Title: UIButton - sending event on touch down, not touch up
Post by: Biggix on December 19, 2014, 07:34:17 PM
Hi,
I'm having a bunch of UIButtons. They work fine, however on iOS device they send info to script mentioned in the onClick field, when the user's finger is LIFTED from the button.
I really need the action to happen, just when the user touches the UIbutton, without waiting when he will lift the finger.
How do I accomplish this?
Thanks!
Title: Re: UIButton - sending event on touch down, not touch up
Post by: Biggix on December 21, 2014, 11:11:27 PM
Hey I'm really waiting for any support regarding this issue. It is driving me crazy! Having events upon touch up is absolutely unacceptable behavior. I need them to happen on touch down! :-[
Title: Re: UIButton - sending event on touch down, not touch up
Post by: ArenMook on December 22, 2014, 10:21:18 AM
UICamera has a touch threshold. it's 40 pixels by default. Raise it up higher, and make sure your button colliders are big enough so that your finger doesn't slide off them.
If you want just the touch down event, then that's OnPress(true). OnClick is not the right even for it.
Title: Re: UIButton - sending event on touch down, not touch up
Post by: Biggix on May 15, 2016, 11:25:15 AM
Hi,
I'm still struggling with it.
In UIButton.cs, if I change "OnClick()" function with "OnPress()", it works but it sends out two events: one on touch down, and a second one on touch up.
I don't want anything to happen on touch up, just the touch down! How do I do it?
Also, is there an easy way to implement the long tap support into UIButton?
Thanks!
Title: Re: UIButton - sending event on touch down, not touch up
Post by: ArenMook on May 18, 2016, 04:44:16 AM