- Home /
Resolution exclude all refresh rates but current refresh rate
So I've been trying to work on a solution to this but I'm not coming up with anything that works.
I've got a resolution drop down, that collects all possible resolutions and refresh rates for the monitor. Using full screen window I know I can't set the refresh rate to anything but the desktops current refresh rate which is fine.. But I still end up with multiple duplicates of resolutions with refresh rates that can't be used. In my case 50Hz, 59Hz, and 60Hz. I'd like to remove the options for resolutions for anything that isn't the current refresh rate. That way if anyone plays with something higher than 60Hz it'll just automatically select and use the desktop(current) refresh rate and only display resolution options with that refresh rate.
resolutions = Screen.resolutions;
resolutionDropdown.ClearOptions();
List<string> options = new List<string>();
int currentResolutionIndex = 0;
for(int i = 0; i < resolutions.Length; i++)
{
string option = resolutions[i].width + "x" + resolutions[i].height + " " + resolutions[i].refreshRate + "Hz";
options.Add(option);
if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height && resolutions[i].refreshRate == Screen.currentResolution.refreshRate)
{
currentResolutionIndex = i;
}
}
resolutionDropdown.AddOptions(options);
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do I clear my screen after changing resolution? 1 Answer
How to bypass resolution limits in window mode 0 Answers
How to handle mobile resolutions without a headache? 0 Answers