HTML5 - Windowed on Black Screen

Below is a link to my HTML5 build on both Chrome and Firefox. The resolution is set to 960x540. The issue seems to be that the window is still created at something like 1280, and renders the game at 960 inside of that. Has anyone else encountered this issue?

Full-Res: http://imgur.com/a/We5wR

Alright, here is the fix. Open the .html file, under .wrapper remove the top “position: relative;” line. and set all the min-width, min-height, max-width to the correct pixel values. (Use px instead of %)

Then, under html, body, container set the height to the pixel value you want. (Make sure to use px instead of %)

In #canvas:not([fullscreen]) change the width to be the pixel value you want.

That’s what worked for me.

In the future there will be an incorporated fix in the HTML shell template that UE4 uses which allows customizing between a couple of different “stock” behaviors for flexibility, e.g. fixed window, standard dpi and high dpi. These earlier resize bugs have all been confirmed to be fixed there. You can see an example of that in action in the new Zen Garden demo that launched this week,

Awesome! Glad to see it!

You have no idea how helpful this was. I’m bookmarking this answer for further use. Combined with r.setres console command in blueprints, you can control the size and aspect ratio of your game in html5.