Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Detect resolution selected in Editor Game view?

Discussion in 'Scripting' started by ShadowM8, Feb 22, 2015.

Thread Status:
Not open for further replies.
  1. ShadowM8

    ShadowM8

    Joined:
    Aug 21, 2012
    Posts:
    16
    Hi all,
    I would like to be able to get the resolution setting (not the actual resolution) in the game view, is that possible?

    Thanks!
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Reading the docs helps.
     
  3. ShadowM8

    ShadowM8

    Joined:
    Aug 21, 2012
    Posts:
    16
    Thanks for your reply Graham, however as I mentioned I would like to be able to query the resolution setting (i.e. value in the resolutions drop down like iPhone4 Tall (640x960)) and not the actual current resolution of the game view.
     
  4. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  5. ShadowM8

    ShadowM8

    Joined:
    Aug 21, 2012
    Posts:
    16
    Thanks Graham, I did look through the the available methods/properties on GameView class via reflection before unfortunately the methods available still return the actual current view size and appear to be identical to Handles.GetMainGameViewSize. In my case I needed to know the resolution it was trying to display prior to scaling the view based on layout constraints, hence why I was looking for querying the setting itself. It doesn't appear like it is possible though.
     
    Last edited: Feb 23, 2015
    muhammad_ali_safdar likes this.
  6. cyborgjinx

    cyborgjinx

    Joined:
    Dec 10, 2014
    Posts:
    28
    I know this is an old post, but I couldn't find it in the docs.
     
Thread Status:
Not open for further replies.