- Home /
WebGL UI cropped on windowed mode
Ok this is a simple problem but I cannot find a solution to it. I am exporting my game for WebGL but the UI does not fit on the windowed mode of the game. More details:
UI Canvas reference resolution and the exported WebGL game resolution are both at 1366x768. The UI Canvas is scaled with the screen size and matches the screen's height i.e. Match = 1;
The problem description: I have two images one anchored to the top and one anchored to the bottom of the UI panel. They both appear on full screen but the top image is cropped on the windowed mode. See images.
Full screen print screen.
Windowed screen print screen.
The UI works perfectly on PC builds so the problem has to do with WebGL and the html canvas size. Exporting the game in a lower resolution such as 900x600 (i.e. change the gameContainer element size to 900x600) works but I want the game to run in 1366x768 or at least keep the aspect ratio.
Does anyone have any suggestions?
Your answer
Follow this Question
Related Questions
In WebGL, is it possible to make UI Coordinate scale with CSS style? 1 Answer
Unity 5 GUI Buttons Won't Show When Built 0 Answers
uGUI Mask Content 0 Answers
UI Canvas performance 2 Answers