Author Topic: NGUI and screen resolution  (Read 42338 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI and screen resolution
« Reply #15 on: January 25, 2014, 02:36:35 AM »
If you want consistency, set it to just "fixed size". But fixed size means that the size of the UI will stay proportional with the screen height, so if your widget takes 25% of the screen's height vertically, then it will still be 25% of the screen's height when the resolution goes up or down.

NGUIJeffS

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: NGUI and screen resolution
« Reply #16 on: January 25, 2014, 10:03:38 AM »
What I'm hearing you say is that if I use "fixed size" then the UI will not stretch to match to size the device screen height. Given this then the UI should match any device regardless of that devices screen size. Correct?
I think my problem is the aspect ration setting in Unity. When I use 320x480 portrait, which is the device screen size, the UI gets stretched in the Y-Axis, but when I use 600x1024 the UI is not stretched as much (it's almost the correct size.). I thought that screen resolution and aspect ratio where one and the same, but I guess they are not. Correct?

I'll try publishing with the 600x1024 portrait setting and see what happens.

Thanks for your help.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI and screen resolution
« Reply #17 on: January 25, 2014, 10:17:30 AM »
NGUI bases itself on the height of the device - that means if you use fixed size and it's set to use 50 % of the height, it will use 50 % of the height always.

Width is not automatically handled, so when the aspect ratio of the screen changed Say from ipad to iphone 5, it will still stay where you had originally placed it unless you do thing like anchor to the sides  - then the position will be determined by the anchor, while the size is still affected by the reported height.