Setting GameView resolution

Is there really no way to change the GameView’s resolution through script? I’ve found some (fairly hacky) ways of using Reflection to get the GameView EditorWindow, but don’t see any API methods for setting its resolution.

Has anyone managed to do this? Either by choosing a preset index or passing a specific resolution?

Note that I’m not talking about changing the window’s size; rather the equivalent of using this drop-down, which scales the chosen resolution into the GameView window:

The GameView uses the UnityEngine.Screen-Resolution. Thus, what you’re looking for is UnityEngine.Screen.SetResolution()

1 Like