mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Added Sprite.fixedToCamera, fixed Angular Velocity and Acceleration, fixed jittery Camera, added skipQuadTree flag and created lots more examples.
This commit is contained in:
+11
-7
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user