Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Feedback Add GameView API for changing the resolution and scale

Discussion in 'Editor & General Support' started by DrummerB, May 7, 2020.

  1. DrummerB


    Dec 19, 2013
    Please consider exposing some public APIs to allow us to change the resolution of the GameView, as well as the scale setting.

    This is an important feature for Play Mode Tests if you want to take screenshots with a fixed resolution and compare them to a baseline.

    The ScreenCapture.CaptureScreenshot method takes a screenshot at the currently active resolution, which happens to be the GameView resolution if you're running in the Editor.

    There are workarounds, but no really good solution. You can render into a RenderTexture with a fixed size, but that will can produce different results (no UI, possibly different effects, view port, occlusion mesh settings). Or you can use reflection to set the resolution, but that is an unstable and breaks between versions.
    mitaywalle likes this.