Hi,
I’m working on a game focussed on mobile and a portrait layout, however deploying to web early on for testing and feedback is really helpful.
I currently export the game from unity at 540 x 960, but in 1080p this means the top and bottom are not visible at the same time. I’ve tried changing the sizes in the index.js, but It doesn’t appear to work as I’m expecting.
I tried changing the height to 90% as suggested but this massively breaks the aspect ratio.
In this screenshot, the bottom navigation bar is cut off and requires scrolling.
Has anyone experience with this issue?
Thanks.
Is this app running in fullscreen mode of the browser? In fullscreen it should adapt automatically, at least provided the aspect ratio matches (540x960 matches if the device’s “1080p” moniker actually corresponds to a 1920x1080 resolution).
Otherwise it’s a matter of the canvas scaler respectively if you use UI Toolkit how its elements are set to align. Assuming the bottom toolbar is a UI element, not just an image.
Without fullscreen you would have to take the browser tab bar into account, which is different for every browser and quite often auto-hides too. I doubt you will ever get a fullscreen effect that works on any device without actually entering fullscreen.