Hi,
I’m packaging my game for HTML export, but I can’t set the default resolution of the game.
Each time it loads, it takes the entire width of the browser as the default width, with a creepy pixelized resolution.
I’ve tried a r.SetRes 800x600w command line, also changed some .ini but with no results.
From editor, it works fine, but not when packaged for html.
Thanks svv3dUDN for your answer, but it doesn’t work. I’ve set 60% but it still launches the game in the full width.
I’ve found in the same file this :
For those who are still stuck with game resolution, I’m sharing here how I fixed the problem:
Project Settings → Platforms/Html5 → Canvas/Canvas Scaling Mode
Set to “Fixed” so the resolution won’t always change
After cooking your project, open the file “YourProject-HTML5-Shipping.UE4.js” and modify these variables:
var canvasAspectRatioWidth
var canvasAspectRatioHeight
Set the desired values (about line ~283)
Don’t import the compressed file version “YourProject-HTML5-Shipping.UE4.jsgz”
(to make the compress game working, I had to add “gz” at the end of the line “AddType application/octet-stream .data” in the .htaccess)