phaser-ce icon indicating copy to clipboard operation
phaser-ce copied to clipboard

The Camera.checkBounds doesn't work well when game's resolution > 1

Open thanh-taro opened this issue 7 years ago • 0 comments

When setting game's resolution greater than 1, the checkBounds function of game camera doesn't work well. It will add more spaces at bottom and right of the game world. I found the code that makes this problem: https://github.com/photonstorm/phaser-ce/blob/c900c6765875b9d78796a0d6771fcaa22e394e2b/src/core/Camera.js#L724

https://github.com/photonstorm/phaser-ce/blob/c900c6765875b9d78796a0d6771fcaa22e394e2b/src/core/Camera.js#L747

That would be fixed if we change to:

this.view.x = (this.bounds.right * this.scale.x) - (this.width * this.game.resolution);
this.view.y = (this.bounds.bottom * this.scale.y) - (this.height * this.game.resolution);

thanh-taro avatar Jul 29 '18 17:07 thanh-taro