Author Topic: Move GUI together with the screen.  (Read 2524 times)

Moran

  • Guest
Move GUI together with the screen.
« on: January 21, 2013, 04:16:40 AM »
I have the following scenario:

- Container Object
-- Screen 1
--- Screen 1 GUI (GUI1 Layer + camera)
-- Screen 2
--- Screen 2 GUI (GUI2 Layer + camera)

I'm moving Container Object along the Y axis to scroll between screens, which should both be active at all times. The GUI of course is not moving with the rest of the sprites. How do I make each GUI anchored to the screen it's in so it will move along with it? They are on separate layers, with separate cameras of a different ortho size than the main camera.

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Move GUI together with the screen.
« Reply #1 on: January 21, 2013, 07:35:00 AM »
You need to disable the anchors if you intend to move your UI.

Moran

  • Guest
Re: Move GUI together with the screen.
« Reply #2 on: January 21, 2013, 11:10:32 AM »
For future generations:

You need to disable the anchors if you intend to move your UI.
First of all, THIS^^^^.
When NGUI creates a panel (at least in the free version I initially used) it creates it with anchors automatically.

Also: an animation in the container object, which moves the container itself, and also each GUI panel separately, did the trick. Simple, once my brain un-n00bed.

Thanks!