Working sprite bounds / vertices regardless of scale or rotation

This commit is contained in:
Richard Davey
2013-06-11 21:30:15 +01:00
parent 1f8c809f53
commit c5f6817c4c
21 changed files with 1718 additions and 203 deletions
+6 -2
View File
@@ -72,6 +72,8 @@ module Phaser {
this.worldView = new Rectangle(x, y, this.width, this.height);
this.cameraView = new Rectangle(x, y, this.width, this.height);
this.transform.setCache();
}
/**
@@ -243,8 +245,10 @@ module Phaser {
this.transform.update();
this.worldView.x = this.x * this.transform.scrollFactor.x;
this.worldView.y = this.y * this.transform.scrollFactor.y;
this.worldView.x = (this.x * this.transform.scrollFactor.x) - (this.width * this.transform.origin.x);
this.worldView.y = (this.y * this.transform.scrollFactor.y) - (this.height * this.transform.origin.y);
//this.worldView.x = this.x * this.transform.scrollFactor.x;
//this.worldView.y = this.y * this.transform.scrollFactor.y;
this.worldView.width = this.width;
this.worldView.height = this.height;