Author Topic: Snapping to next texture in scroll view instead of just moving through  (Read 3393 times)

stingman

  • Guest
This question is based off of Example 8 in the NGUI Tutorials: Scroll View (Camera)

I've adapted this technique to something of my own but I'm having trouble snapping to each image. 

In the example you have a list of "items" that you can scroll through.  Is there an easy built in way to just move to the next item in position?  Ultimately I would like to swipe to scroll to the next item in the list of items, but not pass that item until the user swipes again.  So swipe, move camera to next item in position, snap camera to that item.  Swipe again move camera to next item in position... etc.

Is this possible with any NGUI features or do I have to write something to achieve this?

Thanks!

-Stingman

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Snapping to next texture in scroll view instead of just moving through
« Reply #1 on: October 19, 2012, 10:37:52 AM »
Seeing as you're using a camera, you can just use SpringPosition.Begin to move it to a specific spot.

stingman

  • Guest
Re: Snapping to next texture in scroll view instead of just moving through
« Reply #2 on: October 19, 2012, 08:08:51 PM »
Thanks, works perfect  ;D