Hello Guest

Author Topic: What is the most future proof way of handling multiple resolutions?  (Read 4264 times)

jjv

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Hi there,

Understanding that there is a compromise between the quality and ease of development what would be the most future proof way of handling multiple resolutions in your opinion?

Here is my take after some research (I'm very new to the topic). In order from least future proof to the most future proof:
  • Using conditional compilation "#if UNITY_IPHONE" or any other means to detect device type and then scale or swap textures.
  • Using tk2dCamera overrides with different resolutions
  • Using tk2dCamera overrides with different aspect ratios
  • Using tk2dCamera wildcard override to Fit Visible and switch tk2dSystem.CurrentPlatform to 2x or 4x based on most common resolution ranges at run time to minimize blurring effect, that occurs due to "fitting".

Q1: Does this sound correct? Are there any other even more generic/future proof methods?
Q2: Given the plethora of device out there, what are the best "native/design resolution" values for 1x, 2x and 4x? Would it be 960x640 and then literally 1920x1280 and for 4x - 3840x2560?
Q3: Will that runtime switching code look something like this?

Code: [Select]
using UnityEngine;
using System.Collections;
 
public class ResolutionSetting : MonoBehaviour {
    void Awake () {
       
if(Screen.width<=960){
tk2dSystem.CurrentPlatform = "1x";
}else if(Screen.width<=1920){
tk2dSystem.CurrentPlatform = "2x";
}else{
tk2dSystem.CurrentPlatform = "4x";
}

    }
}

Thanks.
« Last Edit: August 09, 2014, 03:25:31 pm by jjv »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: What is the most future proof way of handling multiple resolutions?
« Reply #1 on: August 10, 2014, 12:13:58 pm »
Q1 - There is 5. Create a separate scene for each device, but that generally is out of the question for most games and budgets. Also #2 and #3 are about the same thing really, just use tk2dCamera to scale as needed.
Q2 - My answer to this will be it depends on the game and art style... One thing of note - If you have large (fullscreen) backgrounds I wouldn't bother putting them into sprite collections, just load them explicitly using Resources.Load.
Q3 - Yup