Ahmed Khalifa Posted November 25, 2017 Share Posted November 25, 2017 Hello everyone, I am trying to make the screen scale automatically based on the browser window. So I used the scale variable in world to scale it. I was trying to center it so I used the following code: this.world.x = Math.floor((this.game.width - Global.SCALE * Global.WIDTH) / 2); this.world.y = Math.floor((this.game.height - Global.SCALE * Global.HEIGHT) / 2); which didn't work nothing on the screen moved, I tried world.position.x/world.position.y and world.left/world.top and still nothing changed. Any help? Link to comment Share on other sites More sharing options...
samme Posted November 28, 2017 Share Posted November 28, 2017 Use this.camera.bounds = null; // then … this.camera.focusOnXY(X, Y); But maybe you could just use scaleMode: SHOW_ALL instead? Link to comment Share on other sites More sharing options...
Recommended Posts