Author Topic: Ngui widgets in layout anchor differently in scene vs game  (Read 1486 times)

paulecoyote

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Ngui widgets in layout anchor differently in scene vs game
« on: March 17, 2014, 02:11:49 PM »
I've uploaded a demonstration of my issue as an unlisted youtube video here:
http://youtu.be/TEwPlqoxaFY

The editor view of the scene get incorrectly resized.  Note how the long yellow line says 0 pixels anchored to the left, how it anchors to the left during play, but after saving and going back to edit mode it moves back to the wrong place.

Please let me know if there's anything I should try.  In the video I left the selected element properties open where you can see it is anchored 0 from the left to the ui root.

Video was made with NGUI 3.4.3 on Unity Free 4.3.4f1 ... it is still the case with NGUI 3.5.4r2 (I just noticed the update in the asset store, imported it, restarted the editor and it behaves the same).

Thanks,
Paul

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Ngui widgets in layout anchor differently in scene vs game
« Reply #1 on: March 18, 2014, 09:34:25 PM »
I'm in SF right now on slow wifi, so videos are difficult to look at, but if I was to guess based on your description, I'd say you have the Game View hidden while editing -- likely by your Scene view.

When the game view is hidden, its dimensions can't be determined properly in the current version of Unity.

You need to ensure that it's always on the screen.

paulecoyote

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Ngui widgets in layout anchor differently in scene vs game
« Reply #2 on: March 18, 2014, 10:58:34 PM »
I did not realise the game view was so vital to the scene view.

After playing with it I see now, the game view needs to be the same ratio / dimensions as the gui you are creating.  It can be behind the editor, but it needs to be there.  You are correct it cannot be in a tab.

Thank you for your assistance, I hope you are having a good GDC!