Objects that are 'fixedToCamera' are now still correctly placed even if the camera is scaled (#512)

This commit is contained in:
photonstorm
2014-03-06 17:12:12 +00:00
parent a6b05f4d02
commit 3b2573de9a
9 changed files with 110 additions and 10 deletions
+2 -2
View File
@@ -308,8 +308,8 @@ Phaser.Sprite.prototype.postUpdate = function() {
// Fixed to Camera?
if (this._cache[7] === 1)
{
this.position.x = this.game.camera.view.x + this.cameraOffset.x;
this.position.y = this.game.camera.view.y + this.cameraOffset.y;
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
}
// Update any Children