Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: gamedivisionuk on June 02, 2014, 05:56:34 AM

Title: Scroll view search
Post by: gamedivisionuk on June 02, 2014, 05:56:34 AM
What I'm trying to do:
I input data on one line then click search,it's then searching what's in the scroll view

I want the scroll view to show the results of my search by snapping it to the middle,so if I have 100 labels within the scroll view,soon as I click search it will file through the scroll view and show the result directly in the middle of the scroll view


Thank you
Title: Re: Scroll view search
Post by: Nicki on June 03, 2014, 05:03:43 PM
Then you find the position of the label you want to go to, and you set the ClipOffset to that and move the panel opposite that.

If you want it to animate towards that positions, then you have to tween both of those values. Look inside TweenPosition how it's done for position and make your own for tweening clipoffset.

There might be a built in method too, but I'm not sure. Otherwise look at how CenterOnChild.cs works.