Support => NGUI 3 Support => Topic started by: t_n on June 21, 2014, 11:22:32 AM
Title: UIScrollView
Post by: t_n on June 21, 2014, 11:22:32 AM
Hello,
I'm using UIScrollView and have a request.
When I set onDragFinished and set currentMomentum to 0, the event won't be fired.
I think that the setter:
public Vector3 currentMomentum {get{return mMomentum;}set{ mMomentum =value; mShouldMove =true;}}
should be modified to fire event if it has.
Thanks.
Title: Re: UIScrollView
Post by: t_n on June 21, 2014, 12:48:24 PM
In addition....
I want to handle event of starting momentum movement (when the user moves its finger off screen) because onDragFinished event is fired when the movement finishes. The two are different in case that momentum is enabled.
Thanks again.
Title: Re: UIScrollView
Post by: ArenMook on June 21, 2014, 04:03:37 PM
Attach a script that listens to OnDragStart, and you will have your event.
Title: Re: UIScrollView
Post by: t_n on June 22, 2014, 07:07:35 PM
Thank you Aren, but I want to handle an event that the user moves finger OFF the screen, not ON. (Then the scroll view starts momentum movement)
I may be able to handle the event adding OnDragEnd, but there are so many UIDragScrollView, so I would be happy if I could handle the event on UIScrollView.
Title: Re: UIScrollView
Post by: ArenMook on June 22, 2014, 11:38:22 PM
So your request is then to just know when the scroll view starts moving using momentum, and nothing really to do with the finger, right? Because momentum can be triggered via other means as well, such as the scroll wheel.
Title: Re: UIScrollView
Post by: t_n on June 23, 2014, 09:22:02 PM
Aren,
I would like to handle the event that the scroll view starts moving using momentum both by the finger, and by the scroll wheel.
Title: Re: UIScrollView
Post by: ArenMook on June 24, 2014, 04:39:05 AM
I would say just watch the UIScrollView.isDragging.
Title: Re: UIScrollView
Post by: t_n on June 24, 2014, 05:44:19 AM
ummm, I can understand but I have to watch the value update by update with your solution, I think that using an event is more efficient.
Anyway, thank you so much.
Title: Re: UIScrollView
Post by: wallabie on June 24, 2014, 09:41:28 AM
I asked for the same thing about a month ago. Listening to isDragging is not performant.
Title: Re: UIScrollView
Post by: ArenMook on June 25, 2014, 05:06:52 AM
I've added it already. My suggestion is for how to get it working now without waiting for the update.