Fixed UV updates for WebGL textures.

This commit is contained in:
Richard Davey 2014-10-15 11:36:35 +01:00
parent 3fb5df95e6
commit 86cfc7111e
3 changed files with 11 additions and 9 deletions

View file

@ -294,6 +294,8 @@ Phaser.Image.prototype.loadTexture = function (key, frame) {
} }
} }
this.texture.baseTexture.dirty();
if (setFrame) if (setFrame)
{ {
this._frame = Phaser.Rectangle.clone(this.texture.frame); this._frame = Phaser.Rectangle.clone(this.texture.frame);
@ -356,10 +358,8 @@ Phaser.Image.prototype.setFrame = function(frame) {
{ {
this.updateCrop(); this.updateCrop();
} }
else
{ this.texture._updateUvs();
this.texture.baseTexture.dirty();
}
}; };

View file

@ -410,6 +410,8 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame, stopAnimation) {
} }
} }
this.texture.baseTexture.dirty();
if (setFrame) if (setFrame)
{ {
this._frame = Phaser.Rectangle.clone(this.texture.frame); this._frame = Phaser.Rectangle.clone(this.texture.frame);
@ -472,10 +474,8 @@ Phaser.Sprite.prototype.setFrame = function(frame) {
{ {
this.updateCrop(); this.updateCrop();
} }
else
{ this.texture._updateUvs();
this.texture.baseTexture.dirty();
}
}; };

View file

@ -378,6 +378,8 @@ Phaser.TileSprite.prototype.loadTexture = function (key, frame) {
} }
} }
this.texture.baseTexture.dirty();
}; };
/** /**
@ -424,7 +426,7 @@ Phaser.TileSprite.prototype.setFrame = function(frame) {
this.texture.trim = null; this.texture.trim = null;
} }
this.texture.baseTexture.dirty(); this.texture._updateUvs();
}; };