Author Topic: NGUI UIs w/ multiple device resolutions  (Read 5453 times)

metaphysician

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
NGUI UIs w/ multiple device resolutions
« on: January 28, 2014, 09:52:30 PM »
hi Folks! thanks for making such an awesome product!

i'm running into some difficulties in my app with the size of my interface relative to other platforms. i noticed that the builds on my iPad4 had much smaller text size that what appeared in my Unity project. to work around this issue, i resized the Anchors and went back and forth on builds until everything looked fine on the device, even though it looked wrong in the project. the method also seems to have worked for the iPad3. however, the iPad2 now shows the text too large (probably due to smaller screen size).

i ran into a somewhat similar post referring to different resolutions that seemed to indicate that NGUI could query for a particular resolution and then do different things based on that resolution. can you point me to the method that might cover this situation? or is there another recommended approach that would allow me to keep my GUI sizes appearing consistent? right now i'm using PixelPerfect but i seem to remember changing it to Fixed had no effect.

any help appreciated.

scott

Ugur

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 60
    • View Profile
Re: NGUI UIs w/ multiple device resolutions
« Reply #1 on: January 28, 2014, 10:43:35 PM »
you can set the scaling style in the UIRoot to FixedSize and then add the script i posted in this thread: http://www.tasharen.com/forum/index.php?topic=7597.msg36165#msg36165 to the UIRoot containing gameObject to make the ui keep the same physical dimensions.

metaphysician

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: NGUI UIs w/ multiple device resolutions
« Reply #2 on: January 29, 2014, 05:36:10 AM »
thanks for the link and advice Ugur! i'll give you a proper thank you once i've tested it out. actually, i'm brand new here. do i do the thanking under your profile?


metaphysician

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: NGUI UIs w/ multiple device resolutions
« Reply #3 on: February 06, 2014, 03:09:10 AM »
OK - something is wrong here, Ugur. either i'm not doing something correctly or this script isn't doing what it's supposed to do. i'm doing this for iPads only, so i set the Manual Height for my various UIRoots to 768 with the Min height at 768 and the Max Height at 1536 (the height of a iPad Air). pixel density is 160.

in the project itself it sizes correctly for each scene in Play mode. running on the device though results in significant inconsistencies.

so am i not doing something properly or maybe there's another method? just not sure here. advice appreciated...

scott

NGUIJeffS

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: NGUI UIs w/ multiple device resolutions
« Reply #4 on: February 06, 2014, 04:59:55 PM »
I'm having similar issue with my android. The phone is 320x480. I created my game as 320x480. I set the UI root to FixedSizeOnMobile Manual 480 and when I run via remote the height is stretched. The only solution I've found is to set the game aspect to 600x1024. For some reason this creates less stretch but the resolution is a mess. Trying to find an answer to that one. Anyway, the ratio is different so it makes some sort of sense that there is less stretch. So, perhaps if you try a different game window aspect ratio it will help. Hope it helps.