Tommy_ Posted July 18, 2018 Share Posted July 18, 2018 I have a platform game and I want my game to fit the page so in config i used this: width: window.innerWidth, height: window.innerHeight now the problem is when the player zoom out he can see more of the game world and i don't want that... I did some research and apparently there is no way to disable the browser zooming feature (right?), so how can I prevent user from zooming in the game? Link to comment Share on other sites More sharing options...
ol-web Posted July 18, 2018 Share Posted July 18, 2018 But as far as I'm concerned zooming the browser window doesn't affect the canvas's world size. Are you using any plugins? How does your game work? I'd appreciate some screenshots of the problem before and after zoom and with dev tools on the canvas and your camera controlling code; In the meantime maybe you could fix the problem with camera's methods such as scene.cameras.main.setSize(width,height). It would in theory just set the camera's size to a hardcoded number so that the player can't see anything beside it. Not ideal but maybe it's enough for you. Link to comment Share on other sites More sharing options...
samme Posted July 18, 2018 Share Posted July 18, 2018 Wouldn't it be the same problem if the user has a large display/window? Link to comment Share on other sites More sharing options...
Recommended Posts