Added Sprite.fixedToCamera, fixed Angular Velocity and Acceleration, fixed jittery Camera, added skipQuadTree flag and created lots more examples.

This commit is contained in:
photonstorm
2013-10-08 00:58:20 +01:00
parent 1bc6ac25fa
commit c307f79102
20 changed files with 444 additions and 61 deletions
+11 -7
View File
@@ -164,8 +164,7 @@ Phaser.Camera.prototype = {
*/
focusOnXY: function (x, y) {
this.view.x = Math.round(x - this.view.halfWidth);
this.view.y = Math.round(y - this.view.halfHeight);
this.setPosition(Math.round(x - this.view.halfWidth), Math.round(y - this.view.halfHeight));
},
@@ -185,6 +184,16 @@ Phaser.Camera.prototype = {
this.checkBounds();
}
if (this.view.x !== -this.displayObject.position.x)
{
this.displayObject.position.x = -this.view.x;
}
if (this.view.y !== -this.displayObject.position.y)
{
this.displayObject.position.y = -this.view.y;
}
},
updateTarget: function () {
@@ -283,9 +292,6 @@ Phaser.Camera.prototype = {
this.view.x = x;
this.view.y = y;
this.displayObject.x = -x;
this.displayObject.y = -y;
if (this.bounds)
{
this.checkBounds();
@@ -323,7 +329,6 @@ Object.defineProperty(Phaser.Camera.prototype, "x", {
set: function (value) {
this.view.x = value;
this.displayObject.position.x = -value;
if (this.bounds)
{
@@ -347,7 +352,6 @@ Object.defineProperty(Phaser.Camera.prototype, "y", {
set: function (value) {
this.view.y = value;
this.displayObject.position.y = -value;
if (this.bounds)
{
+2 -2
View File
@@ -71,8 +71,6 @@ Phaser.World.prototype.boot = function () {
*/
Phaser.World.prototype.update = function () {
this.camera.update();
this.currentRenderOrderID = 0;
if (this.game.stage._stage.first._iNext)
@@ -104,6 +102,8 @@ Phaser.World.prototype.update = function () {
*/
Phaser.World.prototype.postUpdate = function () {
this.camera.update();
if (this.game.stage._stage.first._iNext)
{
var currentNode = this.game.stage._stage.first._iNext;