Author Topic: Anchors Not Updated Immediately  (Read 6126 times)

iron59

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 16
    • View Profile
Anchors Not Updated Immediately
« on: July 28, 2015, 06:27:25 AM »
Good day. I have a UI sprite that acts like a sliding window. I'm using an anchor to keep that window at the edge of the panel. However, I've observed that changing the resolution in the game window does not apply the anchor immediately as you will see in NewRes.png. The red window is still pixels apart from the edge of the panel. However, when I click the resolution dropbox of the game window (take note, I haven't changed the resolution yet, just expanding the drop-down component), the window is moved to its proper position. I think this behaviour is carried over to the actual build as I see incorrect positions of my window in my test device (asus zenfone 5). Any suggestions on how to resolve this? Thank you very much.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Anchors Not Updated Immediately
« Reply #1 on: July 28, 2015, 06:45:15 PM »
What are your anchor's settings? Only Update type anchors will update every frame.

iron59

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Anchors Not Updated Immediately
« Reply #2 on: July 30, 2015, 07:46:53 PM »
The Execute attribute is set to On Update. For what it's worth, I'm using Unity 5.1.0f3 Personal Edition. NGUI version 3.8.0.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Anchors Not Updated Immediately
« Reply #3 on: July 31, 2015, 10:00:17 PM »
Please update your NGUI to the latest version before seeking support.

iron59

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Anchors Not Updated Immediately
« Reply #4 on: August 02, 2015, 07:33:08 PM »
Sorry about that. I updated my package to 3.9.1. The outcome is still the same. Still having a problem with the anchors.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Anchors Not Updated Immediately
« Reply #5 on: August 05, 2015, 07:56:17 AM »
Ok reading your post I think I see two issues.

1: Changing the resolution doesn't update the anchor right away. Are you talking about changing the resolution in the editor? What do you use to change it? I need more info here.

2. Your anchor doesn't update properly on your mobile device when you build the app. Is the mobile platform the only one affected? What about other platforms? Can I reproduce it on my end somehow using stock NGUI example scenes?