Author Topic: UIScrollView  (Read 3321 times)

t_n

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
UIScrollView
« 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:
  1. public Vector3 currentMomentum { get { return mMomentum; } set { mMomentum = value; mShouldMove = true; } }
should be modified to fire event if it has.

Thanks.

t_n

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: UIScrollView
« Reply #1 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #2 on: June 21, 2014, 04:03:37 PM »
Attach a script that listens to OnDragStart, and you will have your event.

t_n

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: UIScrollView
« Reply #3 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #4 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.

t_n

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: UIScrollView
« Reply #5 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #6 on: June 24, 2014, 04:39:05 AM »
I would say just watch the UIScrollView.isDragging.

t_n

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: UIScrollView
« Reply #7 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.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: UIScrollView
« Reply #8 on: June 24, 2014, 09:41:28 AM »
I asked for the same thing about a month ago.   Listening to isDragging is not performant.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #9 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.