Author Topic: [solved] Issues on tallest screen resolutions not scaling UI properly.  (Read 2076 times)

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
This is likely a Unity issue, but I'm wondering if anyone has encountered this and solved it.  My app works great any any window size (windowed or full screen) except when the chosen "screen resolution" (or window size) is one that equals the vertical height of the display.  In this case it is when I pick one of the two resolutions that are *x1200.  (1920x1200 or 1600x1200)  In all other cases the NGUI ui is correctly scaled and pixel perfect.

In the two attachments to this post you can see that at 1920x1200 the UI has become oddly stretched, and the UI elements are slightly larger than they're supposed to be.  In addition, the calculation of screen coordinates goes haywire.  The mini map has logic where the white selection box centers up where ever you click with the mouse.  In the correct version, I have clicked on the center of the mini map and the coordinates are correctly calculated.  In the messed up version I have also clicked on the center of the mini-map, but the calculated coordinates are way off, resulting in the white view indicator being off.  This mis-calculation appears to be relative to the center point of the screen, which means the error gets larger the further away from the center of the screen you get.

In all other resolutions the UI is correct and the calculation of widget offsets for mouse clicks is also perfect.  I'm at a loss to explain why this is happening.  The actual 3D area of the application is *not* incorrect and is properly scaled and has no issues with stretching, pixel blurriness, or incorrect offsets.  The mouse handling in the OnGUI portion of the app is also correct.

Extra info:  Running two monitors side-by-side at 1920x1200.  Win7 x64.  Nivida card with latest drivers.  No other issues at all.
« Last Edit: November 09, 2012, 08:06:27 PM by JRoch »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issues when app height equals native display height. (Windows)
« Reply #1 on: November 09, 2012, 05:41:33 PM »
Check UIRoot -- do you have the max height set to 1024?

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Issues when app height equals native display height. (Windows)
« Reply #2 on: November 09, 2012, 07:41:31 PM »
Aha.  It was set to 1080, and likely had been since I created the project.  Didn't even know that was an option.

Thanks for the quick diagnosis.  Works perfectly.