Author Topic: Building panel widgets  (Read 2234 times)

Sam55555

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Building panel widgets
« on: April 23, 2014, 05:14:38 AM »
Hi,
i have panel with few widgets on mobile device with anchors. On start you can see how widget move to right position in panel. I show fullscreen loading image to prevent to see this widget moving. How can i detect, that widget rebuild finished?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Building panel widgets
« Reply #1 on: April 23, 2014, 06:25:54 AM »
Just wait until the end of frame.

You can also force an immediate reposition of everything by broadcasting UpdateAnchors.
  1. UIRoot.Broadcast("UpdateAnchors");
You may also need to immediately refresh the panels afterwards though.
  1. UIRoot.Broadcast("Refresh");

Sam55555

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Building panel widgets
« Reply #2 on: April 23, 2014, 06:49:09 AM »
I waited to the end of frame, but on slow mobile phones (Galaxy S) that takes more than one frame. I see how every widget jump to position and that takes 2-7 seconds.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Building panel widgets
« Reply #3 on: April 23, 2014, 06:58:06 AM »
All anchors are updated in Update(). There is no delay, so I am not sure what you're seeing there. 2 to 7 seconds? What are you anchored to?

Sam55555

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Building panel widgets
« Reply #4 on: April 23, 2014, 07:03:51 AM »
Fullscreen background anchored to panel and other widgets anchored to background widget.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Building panel widgets
« Reply #5 on: April 23, 2014, 07:43:05 AM »
Are you using the built-in anchors, or the old style UIAnchor?

Sam55555

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Building panel widgets
« Reply #6 on: April 23, 2014, 08:11:32 AM »
only build-in anchors

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Building panel widgets
« Reply #7 on: April 24, 2014, 12:34:21 AM »
Then I honestly don't see a reason for that behaviour.