ptotheaul Posted March 22, 2018 Share Posted March 22, 2018 I have a game that on mobile devices I want to scale the game to 100% of the window width and keeping the aspect ratio have the height scale up and go off screen at the bottom if the aspect ratio make the height taller then the view area. Is this possible just using the Scale Manager? Link to comment Share on other sites More sharing options...
ptotheaul Posted March 22, 2018 Author Share Posted March 22, 2018 I've found this code that does what Phaser.ScaleManager.SHOW_ALL if I put it in the call back of USER_SCALE but know I need help figuring out how to limit the user scaling to the horizontal: gameResized(manager, bounds) { var scale = Math.min(window.innerWidth / this.game.width, window.innerHeight / this.game.height); //canvas.width = (game.width * hScale) - hTrim //canvas.height = (game.height * vScale) - vTrim manager.setUserScale(scale, scale, 0, 0); } Link to comment Share on other sites More sharing options...
Recommended Posts