Skip to content

Commit a6a2c61

Browse files
committed
Sprites that had a tint on them, that then had their frame changed via either Sprite.frame or Sprite.frameName wouldn't re-tint the new frame, and would become stuck on the old frame in Canvas mode (thaks @spayton phaserjs#2453)
1 parent d161a7f commit a6a2c61

4 files changed

Lines changed: 3 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
357357
* If you set Game.renderType to `Phaser.HEADLESS` it will no longer render the output to the canvas. The canvas is still created (although not added to the DOM), as it's required internally, but no rendering now takes place on it (thanks @ForgeableSum #2464)
358358
* Sounds played using the Audio tag, that were paused and then resumed again (either directly in code, or via a game pause event) would not resume from the point at which they paused (thanks @rroylance #2473)
359359
* Sounds played using the Audio tag, set to loop, would get caught in an endless pause-play loop cycle (thanks @rroylance #2473)
360+
* Sprites that had a tint on them, that then had their frame changed via either `Sprite.frame` or `Sprite.frameName` wouldn't re-tint the new frame, and would become stuck on the old frame in Canvas mode (thaks @spayton #2453)
360361

361362
### Pixi Updates
362363

src/gameobjects/components/Core.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ Phaser.Component.Core.preUpdate = function () {
112112
this.renderOrderID = this.game.stage.currentRenderOrderID++;
113113
}
114114

115-
if (this.texture)
116-
{
117-
this.texture.requiresReTint = false;
118-
}
119-
120115
if (this.animations)
121116
{
122117
this.animations.update();

src/gameobjects/components/LoadTexture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Phaser.Component.LoadTexture.prototype = {
194194
{
195195
this.updateCrop();
196196
}
197-
197+
198198
this.texture.requiresReTint = true;
199199

200200
this.texture._updateUvs();

src/pixi/display/Sprite.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
458458
this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint);
459459

460460
this.cachedTint = this.tint;
461+
this.texture.requiresReTint = false;
461462
}
462463

463464
renderSession.context.drawImage(this.tintedTexture, 0, 0, cw, ch, dx, dy, cw / resolution, ch / resolution);

0 commit comments

Comments
 (0)