Author Topic: Momentumless ScrollWheel?  (Read 2097 times)

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Momentumless ScrollWheel?
« on: November 12, 2014, 03:11:24 PM »
Hello,

I was digging around the code for UIScrollView today because it was requested that the mouse ScrollWheel not have any momentum to it when it moves a ScrollView. From what I was able to determine it appears that the code for UIScrollView does a momentum shift on it regardless of the input Axis value received and the momentum value on the scrollview. I want it to work like a PC scrollbar where it will stop immediately after the scroll wheel stops moving.

Is there an easy way that I can turn ScrollWheel momentum off? (Ideally through existing properties so that it isn't overwritten via NGUI updates)

Also as an optimization, I noticed that you're using a mMomentum.magnitude check in the LateUpdate() where a mMomentum.sqrMagnitude should be fine.

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: Momentumless ScrollWheel?
« Reply #1 on: November 13, 2014, 09:47:27 PM »
Nevermind, I figured it out. Just ended up setting the scroll wheel factor to 0, and wrote a script to handle the Mouse ScrollWheel input for the scrollview.