Author Topic: Stuff change position when I change game view aspect  (Read 5856 times)

leandroeidi

  • Guest
Stuff change position when I change game view aspect
« on: September 03, 2013, 02:31:27 PM »
I organize the GUI the way I want, but when I change the game view aspect to test how my game is seen in different resolutions, the GUI just changes position and I have to reorganize it again. Does it happen with anyone other than me?

Now I encountered the same problem without changing the game view aspect, but opening the project on another computer. I work on my project at home and at my "day job". At home the GUI was in its place, but when I opened the project in this other pc, it moved up and I think it got bigger, and I'm having some difficulty in puttin everything in place again. Why does this happen?

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Stuff change position when I change game view aspect
« Reply #1 on: September 04, 2013, 02:52:11 AM »
Are you editing your program in the "Scene" window or "Game" window.

The "Scene" window is not a true representation of the the proper view. If you are having problems in your "Game" window I suspect you have all your objects at the same Z and Depth settings. If you do that, it's going to be random what appears in front of what.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Stuff change position when I change game view aspect
« Reply #2 on: September 04, 2013, 04:08:52 AM »
You need to use multiple anchors. One center anchor is not enough. Watch the "catering to screen sizes" video. It's in the NGUI docs page.

leandroeidi

  • Guest
Re: Stuff change position when I change game view aspect
« Reply #3 on: September 04, 2013, 07:51:36 AM »
I think I fixed it by changing the "Scaling Style" parameter on UIRoot script from PixelPerfect to FixedSize. At least here at my day job's PC, the GUI is at the same location where I left it at home, and changing the game views aspect ratio didn't break it, either. Tonight I'll test it at home to see if it stays at the same place there, but I think it will.

From the "catering to screen sizes" video, I understood that FixedSize (or "manual" in the NGUI version shown in the video) is the most recommended setting, so I think it should be the default option instead of PixelPerfect.

And ENAY, the problem was things changing the Y position and size, not the depth or things getting in front of the others when they shouldn't.