HTML5 Game canvas size

Hello! I’m developing HTML5 games. And I have a problem with the size.
My game has HD resolution (1280x720). The canvas extends beyond the screen and scroll bars appear.
Previously, I worked with the Godot and Defold engines. And everything worked much simpler there.
I tried using different project settings, but it didn’t help.
I want to achieve the same canvas behavior as in other engines, otherwise the moderators will not allow the game on the platform.

I would like to show how it works in other engines, but I’m a new user, so I can only post one image.

How to solve this problem?

Cocos examples:


You should choose platform Web Mobile in build setting

1 Like