Author Topic: Layout changed, after run in editor (full screen mode)  (Read 1519 times)

Christof

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Layout changed, after run in editor (full screen mode)
« on: July 04, 2014, 04:06:28 AM »
Hi,

I have an issue with the layout of ngui controls in my scenes:

when I run the scene in the editor (especially in full screen mode) and go back to the edit mode then the control layout has changed.

I appended three images to explain what I mean:

1. the correct layout
2. the layout after stopping the execution
3. the layout after running it again, without fullscreen mode

the third image is better but still different from the correct layout.

Somtimes it helps to select the camera, to restore the correct result (but not in this case).

But most times I have to reload the scene and my own changes are lost, if I forgot to save the scene before I run it.

I recently updated from 3.6.1 to version 3.6.6.


Best regards
Christof

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Layout changed, after run in editor (full screen mode)
« Reply #1 on: July 04, 2014, 02:26:43 PM »
Are you using any legacy anchors there?

Christof

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Layout changed, after run in editor (full screen mode)
« Reply #2 on: July 07, 2014, 04:21:35 AM »
Thanks, this was a good advise.

My hierachy was:

UIRoot
Camera
Anchor
Panel
...

if I delete the Anchor, everything seems to work.

Are there any problems, when I place my controls in the hierachy below the camera?  (I don't want to change all of my existing scenes). I saw, that in a new empty scene, you place the camera beside the controls.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Layout changed, after run in editor (full screen mode)
« Reply #3 on: July 07, 2014, 04:27:40 AM »
Anchor was only needed for legacy UIs, prior to NGUI 3.0.7 which was a very long time ago. Right now a center-based legacy anchor does absolutely nothing.

You should place your controls as children of the UIRoot or other elements, not UICamera. Camera can be separate.

UIRoot
- Camera
- UI elements

You don't have to, but this is the suggested hierarchy.