Author Topic: Center Couple Buttons in UIPanel  (Read 3614 times)

PiotrT

  • Guest
Center Couple Buttons in UIPanel
« 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 ?


Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Center Couple Buttons in UIPanel
« Reply #1 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.

PiotrT

  • Guest
Re: Center Couple Buttons in UIPanel
« Reply #2 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 ?
« Last Edit: April 17, 2013, 05:14:32 AM by PiotrT »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Center Couple Buttons in UIPanel
« Reply #3 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.