Search Unity

Screen Resolution Limited in Editor?

Discussion in 'Scripting' started by Marc, Nov 30, 2007.

  1. Marc

    Marc

    Joined:
    Oct 4, 2007
    Posts:
    499
    Im doing a screen resolution switcher which is fairly simple using the Screen.SetResolution. For this i create a gui of possible options using Screen.resolutions array. Simple.

    I noticed however that the Editor seem to override this array to only contain one resolution namely 640x480. Correct me if im wrong please.

    My thesis for this behavior is that cause the editor do not need to be rendered in the actual resolution as it is for testing, but why am i not allowed to see all supported resolutions in the editor as stated in the API? In my opinion such limitation should happen in the Screen.SetResolution if you dont want people running other resolutions in the editor and not by removing the option to see it as supported.

    Makes it a little harder to create the gui if you have to build each time to check allignment.

    Is there a way to get all supported resolution while in the editor?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not sure, but a simple workaround would be to have the script check to see if you're running in the editor (using Application.platform) and use a pre-defined array of resolutions in that case.

    --Eric
     
  3. DGuy

    DGuy

    Joined:
    Feb 7, 2007
    Posts:
    187
    * BUMP *

    Just came across this issue myself.

    So is this done on purpose for some reason, or is it a bug ?

    DGuy
     
  4. Marc

    Marc

    Joined:
    Oct 4, 2007
    Posts:
    499
    I didnt find any so i went with erics idea of using a predefined array while in the editor.