Author Topic: Sprites scale/position in Panel different between game and scene view  (Read 1505 times)

paw9000

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
    • Precocial Software LLC
I have an issue where a sprite in my scene view is not the same size or position in my game view when its inside of a separate panel.  Any common gotchas that might explain that?  Sprite might be 1/8th the scale of what it looks like going from scene to game view.

My layout is something like this:
UIRoot (Has a Panel)
|
-> |-Bunch of other NGUI controls
   |-Empty game object (transform set to identity)
   | |
   | ->Panel (game object transform set to identity)
   |   |
   |   ->Sprite
   |-Bunch of other NGUI controls

If I drag the sprite up a level it shows up fine.  Clipping is set to None.  Panel object has a rigidbody.  Trying to make a separate dialog.
Download my free 3d Unit Origami modeling app made with NGUI at http://www.precocialsoftware.com

paw9000

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
    • Precocial Software LLC
Solved the problem!  My bad.  The issue was the child panel was set to a different layer then the rest of the GUI.

Once I changed it to the same layer that all the other NGUI elements were on then things lined up and worked as expected.  Slightly surprised that when I add a panel from the NGUI menu that the resulting panel didn't inherit the layer of its parent, but not a big deal.

Thanks for the very helpful console message which I missed yesterday saying:
"You can't place widgets on a layer different than the UIPanel that manages them."

My apologies and thanks for a wonderful product! =)
Download my free 3d Unit Origami modeling app made with NGUI at http://www.precocialsoftware.com