- Home /
How to make game recognise Screen resolution on startup
Hello, i'm working on my menu scripts and im making a system to change the screen resolution in game, working in C#, i know this can be done in the main menu but i know its also possible to do in game so figured i might as well
what i want to know is how i can get the game to recognize the games resolution on startup, since in my options menu the drop down will have the current resolution selected
the only thing i could find of any use was Screen.currentresolution, however that appears to be read only, there is Screen.SetResolution but thats what il be using to set it and im not sure how i could use this to determine what the screen resolution is on startup.
any ideas? i hope this is possible with unity
By resolution on startup, do you mean the resolution of the desktop, before the game is launched? Does Screen.currentResolution not give the correct resolution on startup?
okay il try and explain better, you know how if you build the game you have a launcher, and in thta you can change the screen resolution along with the quality and display, now in that i can set the resolution to anything i like, however i also want the option to alter reolution ingame
my question is, say i set the resolution to 1280, 720 in the launcher, how do i script it so it knows that this is the resolution i have selected, tried using an if statement, something like
if (Screen.currentresolution = 1280, 720)
but i got errors so im assu$$anonymous$$g that isnt how it works, any ideas how i can word this so i can use an if statement to deter$$anonymous$$e what the screen resolution is, and then i can use that to deter$$anonymous$$e which resolution is currently ticked in the options menu
Answer by SuperMasterBlasterLaser · Jul 01, 2015 at 10:58 AM
Look at this documentation and if you using uGUI with canvas, look there.
Also, LET ME GOOGLE IT FOR YOU