Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: joelsantos on April 12, 2012, 04:08:07 AM

Title: Best way to support multiple resolutions
Post by: joelsantos on April 12, 2012, 04:08:07 AM
Hi there.
I have a game on the Google Play Store (https://play.google.com/store/apps/details?id=com.trollugames.caverun3d) (Shameless self promotion ftw  :D ) that as all its UI done by hand with the unity gui system.
I have bought NGUI and I am trying to learn and I am having some doubts.
Is there an easy way to maintain the same aspect ratio on resolution change? I could easily do this in the GUI system using the GUI.Matrix option... But I'm not being able to do it in NGUI. In the Y Axis it seems to work fine if I set the camera to manual... But in the X-Axis in can't maintain the same aspect...
I am not interested in pixel perfect for the moment.. I was just wishing that I could work in one resolution and it would work as expected for every other one.
Any help?
Title: Re: Best way to support multiple resolutions
Post by: ArenMook on April 12, 2012, 04:20:16 AM
If you set UIRoot to "manual", it will keep the height you specify regardless of resolution changes. Aspect ratio changes simply let you see more or less on the left and right sides of the screen. You can glue widgets (and groups of widgets) to corners and sides of the screen by using UIAnchor. I'd suggest you take advantage of that instead of squishing / stretching your UI with the aspect ratio changes, which looks hideous when going from a 4:3 iPad to a 16:9 monitor. :)
Title: Re: Best way to support multiple resolutions
Post by: joelsantos on April 12, 2012, 04:25:52 AM
Thanks for the quick response.
I see. I've been playing with the tutorials and trying to learn, but I'll give the Anchor documentation a full read and will try to use it then.
Thanks for your time  ;D You are amazing
Title: Re: Best way to support multiple resolutions
Post by: PapaWhiskey on December 22, 2012, 01:11:58 PM
aspect ratio changes dont just show or hide more or less of an object..

consider a circle...if you dont maintain aspect ratio while scaling, you end up with an oval, or anything non circular when you change resolutions.
Title: Re: Best way to support multiple resolutions
Post by: Nicki on December 22, 2012, 09:09:39 PM
When you change aspect, either height or width changes. NGUI is based on height, so your circle will "fit" on the height size, if you leave the UIRoot on automatic, but it will either cut off or make space around the circle. It will not scale it so that the widget changes its aspect, it's the screen that changes aspect.