Author Topic: Multiple Resolutions and Aspect Ratios - Best Practices  (Read 5594 times)

michelhabib

  • Guest
Multiple Resolutions and Aspect Ratios - Best Practices
« on: August 10, 2012, 04:02:53 AM »
I have read some of the posts here, but I still have questions regarding what to do about multiple resolutions and aspect ratios.
I am building a game that works only in the landscape mode, both on Android and iOS devices. So that means i have to deal with Multiple Resolutions and Multiple Aspect Ratios.
Thanks to NGUI it seems to be designed to handle such tough situation, but i think i need to find out the best combination of settings to get that done right.

1- I am very confused about which one to use, set the Automatic checkbox to on or off? setting it to on helps alot with fitting different aspect ratios, so is this the best practice?
I have read many post that advise to set it off and put the height manually, but it didn't work well when i had different Aspect Ratios.

2- Using Anchors is very good, but when i try to animate the panels, the anchors always stay where they are [this is what they are supposed to do i understand], so to be able to animate Panels, i put an offset gameobject as a parent of all widgets [or anchors], and i animate the offset. and for that to work correctly, i have to define the panel object for every anchor, is that the correct way to do it?

I have more questions that i will add as i progress, and try to compile this into a best practices thread, thank you in advance for your support.

Lukas

  • Guest
Re: Multiple Resolutions and Aspect Ratios - Best Practices
« Reply #1 on: August 10, 2012, 04:32:52 AM »
My trick is:
Design a UI at a specific resolution, 1024x768 i.e. Make sure the aspect ratio is the smallest you want to support. (for mobile most likely 4:3 iPad)
In that design you need to take into account the widest aspect ratio (for mobile most likely 16:9) This means backgrounds etc needs to be wider then you create your design. I.e. with the 1024x768 you need to support a width of 768 / 9 * 16 = 1365  So you canvas needs to be 1365x768.
Another solution is to use stretchable or tillable sprites for backgrounds.
Then you have to make sure you anchor stuff to the left and right sides.

That's it really. Yes animating with anchors is a bit tedious as you always needs to 'stay one child below the anchor' to animate and have to make sure you have your pivot points right.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Multiple Resolutions and Aspect Ratios - Best Practices
« Reply #2 on: August 10, 2012, 04:33:40 AM »
Assuming you want everything to look crisp, leave the checkbox on. Create your UI using modular pieces -- with multiple UIAnchors. If some widget is supposed to be in the bottom left corner, make sure it's somewhere underneath a bottom-left anchor, for example. Depending on whether you need to support SD / HD / UD atlases, you may also want to take advantage of the reference atlas functionality and load a higher resolution atlas when you notice that the resolution can support it.

michelhabib

  • Guest
Re: Multiple Resolutions and Aspect Ratios - Best Practices
« Reply #3 on: August 10, 2012, 11:23:14 AM »
Thanks Guys.
@ Lukas, i am designing my UI at 2048*1536 - which is both the lowest Aspect Ratio [by luck, i didnt mean to], and is also the highest resolution [on the new ipad, which will also give me the highest graphics resolution]
I would then create the 3 resolutions out of this UI, with help of the atlas reference video that @Aren made a while back.
Are there specific thresholds i should use when switching between the 3 resolution ranges? any best practices?

I already have my Automatic setting on right now, and experimenting with that. I will post more questions if anything stops me, thank you :)