Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: fanling3 on July 07, 2014, 02:42:48 AM

Title: Set initial value for UIScroll View
Post by: fanling3 on July 07, 2014, 02:42:48 AM
I have an UIScroll View, any way to initialize where I start from? Something like UIScrollbar.value
Thanks.
Title: Re: Set initial value for UIScroll View
Post by: ArenMook on July 07, 2014, 04:16:07 AM
You can set the scroll view's content origin and ResetPosition().
Title: Re: Set initial value for UIScroll View
Post by: fanling3 on July 07, 2014, 08:45:01 PM
Sorry, maybe my question is not clear enough.

I mean I have, for example, 10 UIDrag Scroll View Objects, and I want to stay on, let's say, the 3rd objects when I enter the scene, in stead of the 1st one.

Like when you use ScrollBar, you initialize ScrollBar.value to change where you start at the beginning.

EDIT: Ok, I figure it out myself by using:
  1. scrollView.MoveRelative(new Vector3(x, y, z));
  2. scrollView.ResetPosition();