mirror of
https://github.com/wassname/phaser.git
synced 2026-08-12 12:20:38 +08:00
Merge pull request #239 from jcd-as/dev
move TilemapLayer positioning/rendering to postUpdate to be in line with...
This commit is contained in:
+2
-2
@@ -113,6 +113,8 @@ Phaser.World.prototype.update = function () {
|
|||||||
*/
|
*/
|
||||||
Phaser.World.prototype.postUpdate = function () {
|
Phaser.World.prototype.postUpdate = function () {
|
||||||
|
|
||||||
|
this.camera.update();
|
||||||
|
|
||||||
if (this.game.stage._stage.first._iNext)
|
if (this.game.stage._stage.first._iNext)
|
||||||
{
|
{
|
||||||
var currentNode = this.game.stage._stage.first._iNext;
|
var currentNode = this.game.stage._stage.first._iNext;
|
||||||
@@ -128,8 +130,6 @@ Phaser.World.prototype.postUpdate = function () {
|
|||||||
}
|
}
|
||||||
while (currentNode != this.game.stage._stage.last._iNext)
|
while (currentNode != this.game.stage._stage.last._iNext)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.camera.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -279,12 +279,14 @@ Phaser.TilemapLayer.prototype = Phaser.Utils.extend(true, Phaser.TilemapLayer.pr
|
|||||||
Phaser.TilemapLayer.prototype.constructor = Phaser.TilemapLayer;
|
Phaser.TilemapLayer.prototype.constructor = Phaser.TilemapLayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Automatically called by World.preUpdate. Handles cache updates.
|
* Automatically called by World.postUpdate. Handles cache updates.
|
||||||
*
|
*
|
||||||
* @method Phaser.TilemapLayer#update
|
* @method Phaser.TilemapLayer#postUpdate
|
||||||
* @memberof Phaser.TilemapLayer
|
* @memberof Phaser.TilemapLayer
|
||||||
*/
|
*/
|
||||||
Phaser.TilemapLayer.prototype.update = function () {
|
Phaser.TilemapLayer.prototype.postUpdate = function () {
|
||||||
|
|
||||||
|
Phaser.Sprite.prototype.postUpdate.call( this );
|
||||||
|
|
||||||
this.scrollX = this.game.camera.x * this.scrollFactorX;
|
this.scrollX = this.game.camera.x * this.scrollFactorX;
|
||||||
this.scrollY = this.game.camera.y * this.scrollFactorY;
|
this.scrollY = this.game.camera.y * this.scrollFactorY;
|
||||||
|
|||||||
Reference in New Issue
Block a user