Author Topic: UI Scroll View  (Read 3540 times)

BigB

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
UI Scroll View
« on: January 23, 2014, 03:50:00 PM »
UI scroll view functioning almost perfectly in my game. Just, the  position does not spring/lock to an object until i have touched an object. Can i 'touch' the script to achieve this, or am i missing a setting? Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Scroll View
« Reply #1 on: January 24, 2014, 10:18:05 AM »
Are you using UICenterOnChild? The scroll view won't "lock" itself to an object otherwise. Assuming so, you can call UICenterOnChild's Recenter() function to achieve this programmatically.

NGUIJeffS

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: UI Scroll View
« Reply #2 on: January 24, 2014, 11:13:44 AM »
Yes, you need both UICenterOnChild (on the ScrollView window) and UICenterOnClick (on the items in the scroll list). I've also found that when you use the UICenterOnChild that setting the Spring Strength and NextPageThreshold can give you a nice "pop into place" effect.

Aren's latest video touches on using UICenterOnChild and UICenterOnClick. It's an excellent tutorial.
http://www.youtube.com/watch?annotation_id=annotation_1679152271&feature=iv&src_vid=OT0hTxjjkY4&v=B66xhIvYF00

Hope this helps.