Author Topic: Widget Anchor Execution order  (Read 4460 times)

frede

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Widget Anchor Execution order
« on: November 03, 2014, 08:59:20 AM »
I have some sprites that are relative anchored to root panel.

Then i have some other sprites that are relative anchored to the first sprites.

How can make sure that the position of the first sprites are always updated before the position of the second set of sprites?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Widget Anchor Execution order
« Reply #1 on: November 04, 2014, 09:21:28 AM »
This are done automatically. NGUI's widgets always update the target object before updating themselves.

frede

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Widget Anchor Execution order
« Reply #2 on: November 05, 2014, 07:11:41 AM »
Ok. It just seems like it takes several updates to place the widgets correctly after i change the aspect ratio. It is like they move a tiny bit closer to where they are supposed to be anchored each time i hit play, or resize the window a bit.

You say that targets are always updated first. What if I by mistake had made some kind of loop in anchors? What would happen then?

I am using ngui pro 3.7.4 btw.

frede

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Widget Anchor Execution order
« Reply #3 on: November 05, 2014, 08:02:28 AM »
Execute is set to OnEnable btw.

If i change it to update it seems to place the widgets correctly, it is just strange that i need several iterations before they are placed correctly

frede

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Widget Anchor Execution order
« Reply #4 on: November 05, 2014, 08:09:09 AM »
I solved they problem.

I had only set 3 of the anchors on some of the widgets.

Ty for the time though :D