Search Unity

Resolutions being weird

Discussion in 'General Graphics' started by DerpMerf, Jul 28, 2015.

  1. DerpMerf

    DerpMerf

    Joined:
    Jan 1, 2014
    Posts:
    33
    So, I set a list of resolutions in the Game view, which I believed to be a list of available resolutions for the game.

    Resolutions.png

    And then wanted to see if it actually worked. So I created this code:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ListResolutions : MonoBehaviour {
    5.  
    6.     void Start () {
    7.         Resolution[] resolutions = Screen.resolutions;
    8.  
    9.         foreach (Resolution res in resolutions) {
    10.             Debug.Log(res.width + "x" + res.height);
    11.         }  
    12.     }
    13.  
    14. }
    15.  
    And attached it to a new GameObject. When I click Play, it prints out "640x480". As you can see, that is not in fact a resolution supported on that list. After doing a bit of research, I found that it prints out a list of the resolutions supported by your computer. I looked at my resolution options, just to be sure. As you could expect, 640x480 is not in fact a resolution supported by my computer:

    ResOptions.png

    Any clue at all what's going on here? I'm just trying to get a resolution option into my game without using the stupid ugly Unity launcher, and if the settings in the Game view are not how you add resolution options, please enlighten me regarding that. Thanks in advance!
     
  2. DerpMerf

    DerpMerf

    Joined:
    Jan 1, 2014
    Posts:
    33