Author Topic: Transform Hierarchy  (Read 3926 times)

Matthias

  • Guest
Transform Hierarchy
« on: April 18, 2012, 10:57:57 PM »
Hi,

I am new to NGUI and spent some time learning it today and I can't figure out how to control the pivot of a root transform of a hierarchy of UI objects.

Basically I am trying to make a window with several widgets on it that I can rotate around its left edge. But I seem to have no control over the location of the widget parents. Somehow they take on some kind of average position of the buttons in it.

I tried all kinds of combinations of with/without UIRoot and UIAnchor scripts.

Basically I have a hierarchy like this:

UI Root
     ** desired Pivot 1 (tried with and without this Transform)
          ** Panel 1
               ** Sprite
               ** Button
               ** etc.
     ** desired Pivot 2
          ** Panel 2
               ** Sprite
               ** Buttons, etc.

I tried to put the buttons under the sprite and use the sprite pivot control, but whatever I do, I have no control over the pivot of the Panels or the 'desired Pivot' and it appears to change depending on the Buttons in the Panel. I don't understand how and why the child transform settings get communicated up the hierarchy.

Any thoughts or advice?

Thanks,
Matthias


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Transform Hierarchy
« Reply #1 on: April 18, 2012, 11:11:36 PM »
Wuh? Make sure you have "Pivot" toggled in Unity in the top-left corner, not "Center".

Matthias

  • Guest
Re: Transform Hierarchy
« Reply #2 on: April 18, 2012, 11:38:43 PM »
HAHA, OMG.   :D :-[

I have been using Unity for over a month now 10+ hours every day and have never noticed or used this option. And it is on 'pivot' in my work project but on 'center' in my test project that I have been using to learn NGUI. This option actually moves an object in rotate mode ::) ... and I thought NGUI is somehow messing with the hierarchy internally...

Thanks for the super fast reply!   :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Transform Hierarchy
« Reply #3 on: April 18, 2012, 11:40:19 PM »
Hehe, no worries. If it makes you feel any better, I ran into this problem myself a few years ago :)