2D Toolkit Forum

2D Toolkit => Support => Topic started by: jjv on August 09, 2014, 03:16:03 pm

Title: What is the most future proof way of handling multiple resolutions?
Post by: jjv on August 09, 2014, 03:16:03 pm
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:

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.
Title: Re: What is the most future proof way of handling multiple resolutions?
Post by: unikronsoftware 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