phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Home Page:http://phaser.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

thanh-taro opened this issue · 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);