Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: PiotrT on April 16, 2013, 01:36:10 PM

Title: Center Couple Buttons in UIPanel
Post by: PiotrT on April 16, 2013, 01:36:10 PM
Hi
I have huge problem because I need to make an interesting transform and I don't know exactly how.

Maybe you can help me  ,or at least give  me an idea.

I have a UIPanel with 3 buttons one below another on the left side of the screen.
When I click a button ( different one) I want to Instantiate 10 more buttons, make them all positioned on the whole screen.
The  another problem is that this buttons are in a different size and the UIPanel should became a UIDragablePanel.
I know that it can be not easy, so I'am ready to pay for this kind of script.
Can someone help me with this ?

Title: Re: Center Couple Buttons in UIPanel
Post by: Nicki on April 16, 2013, 05:08:21 PM
That is easy.

Have the panel always be a draggablepanel and disable drag if fits.

You spawn new buttons by using NGUITools.AddChild with a prefab of your buttons.

Then you go to lunch.
Title: Re: Center Couple Buttons in UIPanel
Post by: PiotrT on April 17, 2013, 03:24:39 AM
Hi Nicki , thank you , this is a step forward for me, but how I can make a "wall" from the buttons in a different size?

I'am thinking something about  double "for" loop but it's not ok when objects are in a different size...


Hey maybe I can have two grids , one horizontal and second one vertical and just move items from one grid to another grid in each gap.
Is is possible ?
Title: Re: Center Couple Buttons in UIPanel
Post by: Nicki on April 20, 2013, 06:00:40 PM
I would likely just want to position them manually. That is, set up positions beforehand and use them when you spawn your objects.