Support => NGUI 3 Support => Topic started by: Progeny on September 22, 2012, 08:36:11 AM
Title: Making scroll view selector menu
Post by: Progeny on September 22, 2012, 08:36:11 AM
Hi everyone! I'm new to Unity development and NGUI package. I know NGUI is going to save my life!
I'm trying to implement this: http://www.tasharen.com/ngui/ex7.html for making a level selector. I can manage button's click to start a new scene, simply trigger OnClick()
What I want is having on start the first item centered (highlighted). When I startup the scene it behave like that: http://img109.imageshack.us/img109/7752/schermata20120922alle15.png
But i don't know to what object attach a script and how to shift the first item to the correct position to be centered and highlighted.
Could you help me? Thanks
Title: Re: Making scroll view selector menu
Post by: Progeny on September 22, 2012, 09:06:26 AM
I'm now able to recent on startup by doing this in the UICenterOnChild but how can I access to a specified index panel? suppose I want the last level (we suppose number 5) to be centered, how can I access to the 5th panel?
void Update()
{
Recenter();
}
Title: Re: Making scroll view selector menu [SOLVED]
Post by: Progeny on September 22, 2012, 09:11:53 AM
:-[ :-[ solved
GetChild(i);
i is the index of the centered panel
// Determine the closest child
for(int i =0, imax = trans.childCount; i < imax;++i)