Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | dbu |
I made my game work well in the HTML export on a PC. However, on a mobile phone, i see only the upper left part of the game. Same problem if i load the game in a small browser window.
I have configured stretch mode “2d” and the aspect to “keep”. When inspecting the HTML, i found that the #canvas element is always set to the window size i configured in the project settings. How can i scale down to show the whole game on a smaller screen? OS.get_window_size() returns the canvas size, not the actual browser window size, otherwise i could scale the viewport to fit into the actual browser window size.
What is the proper way to make the game scale down to fit into a small browser window?
Is Resizable enabled in the Project Settings?
Calinou | 2021-11-17 14:39
it is enabled, yes. and it works fine when building the native linux app, i can resize the window and the game scales as expected.
in the web browser, the canvas is fixed size and seems to not adjust to the browser window size.
i will check if the problem is still present with godot 3.4.0, the changelog indicates that quite some improvements have been done.
dbu | 2021-11-17 15:26
Try enabling Fullscreen in the project settings and export the project again.
Calinou | 2021-11-18 20:42