Author Topic: static panels not letting Anchor update?  (Read 4364 times)

patch24

  • Guest
static panels not letting Anchor update?
« on: May 25, 2012, 01:51:31 PM »
I'm finding that when using the automatic checkbox on UIRoot along with a panel marked static, when the app starts up it doesn't move the sprites over to their correct anchor positions.  It's really odd, the colliders etc are moved to the right spot though. so if I click in the seemingly empty area to the side of where the incorrectly placed sprite images appear, it registers a button hit and then updates the sprite after. 
My dir structure looks like:
UIRoot     <----set to 'Automatic'
   -UICamera
      -UIPanel (static)
         --Buttons

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: static panels not letting Anchor update?
« Reply #1 on: May 25, 2012, 02:08:42 PM »
When you say yo mark the panel as static, do you mean "widgetsAreStatic" or gameObject.isStatic?

ranilian

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 24
    • View Profile
    • Industry Corporation
Re: static panels not letting Anchor update?
« Reply #2 on: May 25, 2012, 02:31:57 PM »
I'm not sure if this is related or not, but when you set the Panels' widgetsAreStatic button to true, it doesn't seem to update anymore in editor mode.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: static panels not letting Anchor update?
« Reply #3 on: May 25, 2012, 04:58:46 PM »
Thanks, I'll fix that.

patch24

  • Guest
Re: static panels not letting Anchor update?
« Reply #4 on: May 25, 2012, 05:55:11 PM »
I'm referring to the checkbox in UIPanel for widgets.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: static panels not letting Anchor update?
« Reply #5 on: May 25, 2012, 08:40:20 PM »
Your hierarchy should have UIAnchor above the panel, then it will work. "widgets are static" checkbox tells NGUI that widgets aren't going to move, but UIAnchor moves them. It will only work if the anchor is above the panel, not below.