Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved WebGL matchWebGLToCanvasSize = false how to resize?!

Discussion in '2021.1 Beta' started by Laur3nt1u, Nov 22, 2020.

  1. Laur3nt1u

    Laur3nt1u

    Joined:
    Apr 30, 2014
    Posts:
    23
    The new WebGL template when matchWebGLToCanvasSize = true, the default value, sets the canvas size without taking in consideration the devicePixelRatio so the game will be rendered at a very high resolution.
    I want to set the size myself so I make matchWebGLToCanvasSize = false but the problem is that when I set the canvas size the game is rendered correctly but the "touch/input layer" is smaller, is like the game is not scaled to 100% even though the rendered image is 100%
     
    Last edited: Nov 27, 2020
  2. Laur3nt1u

    Laur3nt1u

    Joined:
    Apr 30, 2014
    Posts:
    23
    Ok so it seems that it's fixed

    config.matchWebGLToCanvasSize = true and config.devicePixelRatio = 1
     
    Last edited: Mar 18, 2021