Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thanh-taro opened this issue Jul 29, 2018 · 0 comments
Open

Comments

@thanh-taro
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants