Skip to content

Commit f9ee9bf

Browse files
committed
Merge pull request phaserjs#239 from jcd-as/dev
move TilemapLayer positioning/rendering to postUpdate to be in line with...
2 parents 0256117 + 2b99cb4 commit f9ee9bf

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/core/World.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Phaser.World.prototype.update = function () {
113113
*/
114114
Phaser.World.prototype.postUpdate = function () {
115115

116+
this.camera.update();
117+
116118
if (this.game.stage._stage.first._iNext)
117119
{
118120
var currentNode = this.game.stage._stage.first._iNext;
@@ -128,8 +130,6 @@ Phaser.World.prototype.postUpdate = function () {
128130
}
129131
while (currentNode != this.game.stage._stage.last._iNext)
130132
}
131-
132-
this.camera.update();
133133
}
134134

135135
/**

src/tilemap/TilemapLayer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,15 @@ Phaser.TilemapLayer.prototype = Phaser.Utils.extend(true, Phaser.TilemapLayer.pr
279279
Phaser.TilemapLayer.prototype.constructor = Phaser.TilemapLayer;
280280

281281
/**
282-
* Automatically called by World.preUpdate. Handles cache updates.
282+
* Automatically called by World.postUpdate. Handles cache updates.
283283
*
284-
* @method Phaser.TilemapLayer#update
284+
* @method Phaser.TilemapLayer#postUpdate
285285
* @memberof Phaser.TilemapLayer
286286
*/
287-
Phaser.TilemapLayer.prototype.update = function () {
287+
Phaser.TilemapLayer.prototype.postUpdate = function () {
288288

289+
Phaser.Sprite.prototype.postUpdate.call( this );
290+
289291
this.scrollX = this.game.camera.x * this.scrollFactorX;
290292
this.scrollY = this.game.camera.y * this.scrollFactorY;
291293

0 commit comments

Comments
 (0)