Author Topic: UIScrollView - Dampening speed  (Read 2484 times)

Dagohan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
UIScrollView - Dampening speed
« on: March 03, 2015, 08:06:42 AM »
I need to control the slowing pace of UIScrollView when it is sliding with it's momentum on. It is possible to change the momentum amount from the inspector but it is not possible to change it's slowing pace.

I've located the piece of code where the slowing down is made on to the view;
"Vector3 offset = NGUIMath.SpringDampen(ref mMomentum, 9f, delta);" -> UIScrollView.cs

As can be seen the constant "9f" defines the slowing down speed. Is it possible for NGUI to add this slowing down speed as a variable in the inspector for UIScrollView? I don't want to change the source, since it will mess up new updates for NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView - Dampening speed
« Reply #1 on: March 03, 2015, 05:44:49 PM »
I can expose it via code, but I am hesitant to add any more values to the inspector as it's already quite cluttered.

Dagohan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIScrollView - Dampening speed
« Reply #2 on: March 04, 2015, 02:51:45 AM »
Would be awesome. Thank you.