- Home /
Trying to Get Our Resolution Settings to Start on the Current Resolution of the Player's Computer
So we have a settings menu that allows the player to change the resolution of the game, however on startup it currently displays the wrong resolution. For example my laptop runs at 1366x768 however the resolution displayed when I enter settings is 1920x1080. I can't figure out a way to get the menu where I change resolution to display what the current resolution of the game is, because it is set to start at the player's native resolution. I included a snippet of code as well if that helps at all.
public void ChangeQuality() {
if (qualityDropdown.value == 0) {
QualitySettings.SetQualityLevel (0);
customSettingsManager.SetActive (false);
}
else if (qualityDropdown.value == 1) {
QualitySettings.SetQualityLevel (1);
customSettingsManager.SetActive (false);
}
else if (qualityDropdown.value == 2) {
QualitySettings.SetQualityLevel (2);
customSettingsManager.SetActive (false);
}
else if (qualityDropdown.value == 3) {
QualitySettings.SetQualityLevel (3);
customSettingsManager.SetActive (false);
}
else if (qualityDropdown.value == 4) {
QualitySettings.SetQualityLevel (0); //use ultra as base
customSettingsManager.SetActive (true);
}
}
public void ChangeResolution() {
if (resolutionDropdown.value == 0) {
Screen.SetResolution (2560, 1440, fullscreen, 0);
}
else if (resolutionDropdown.value == 1) {
Screen.SetResolution (1920, 1080, fullscreen, 0);
}
else if (resolutionDropdown.value == 2) {
Screen.SetResolution (1600, 900, fullscreen, 0);
}
else if (resolutionDropdown.value == 3) {
Screen.SetResolution (1366, 768, fullscreen, 0);
}
else if (resolutionDropdown.value == 4) {
Screen.SetResolution (1280, 720, fullscreen, 0);
}
else if (resolutionDropdown.value == 5) {
Screen.SetResolution (1152, 648, fullscreen, 0);
}
else if (resolutionDropdown.value == 6) {
Screen.SetResolution (1024, 576, fullscreen, 0);
}
}
Your answer
Follow this Question
Related Questions
Unity resolution dropdown duplicating 0 Answers
How to save the resolution of screen between scenes 2 Answers
Objects move when changing resolution 2 Answers
Best way to move elements around screen [uGUI] 0 Answers
UI Texture Max Size (inspector) 1 Answer