Skip to content

Commit 86cfc71

Browse files
committed
Fixed UV updates for WebGL textures.
1 parent 3fb5df9 commit 86cfc71

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/gameobjects/Image.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ Phaser.Image.prototype.loadTexture = function (key, frame) {
293293
setFrame = !this.animations.loadFrameData(this.game.cache.getFrameData(key), frame);
294294
}
295295
}
296+
297+
this.texture.baseTexture.dirty();
296298

297299
if (setFrame)
298300
{
@@ -356,10 +358,8 @@ Phaser.Image.prototype.setFrame = function(frame) {
356358
{
357359
this.updateCrop();
358360
}
359-
else
360-
{
361-
this.texture.baseTexture.dirty();
362-
}
361+
362+
this.texture._updateUvs();
363363

364364
};
365365

src/gameobjects/Sprite.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame, stopAnimation) {
409409
setFrame = !this.animations.loadFrameData(this.game.cache.getFrameData(key), frame);
410410
}
411411
}
412+
413+
this.texture.baseTexture.dirty();
412414

413415
if (setFrame)
414416
{
@@ -472,10 +474,8 @@ Phaser.Sprite.prototype.setFrame = function(frame) {
472474
{
473475
this.updateCrop();
474476
}
475-
else
476-
{
477-
this.texture.baseTexture.dirty();
478-
}
477+
478+
this.texture._updateUvs();
479479

480480
};
481481

src/gameobjects/TileSprite.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ Phaser.TileSprite.prototype.loadTexture = function (key, frame) {
377377
this.animations.loadFrameData(this.game.cache.getFrameData(key), frame);
378378
}
379379
}
380+
381+
this.texture.baseTexture.dirty();
380382

381383
};
382384

@@ -424,7 +426,7 @@ Phaser.TileSprite.prototype.setFrame = function(frame) {
424426
this.texture.trim = null;
425427
}
426428

427-
this.texture.baseTexture.dirty();
429+
this.texture._updateUvs();
428430

429431
};
430432

0 commit comments

Comments
 (0)