* When a Sprite is destroyed any active filters are removed as well.

* Updated Pixi.js so that removing filters now works correctly without breaking the display list.
This commit is contained in:
photonstorm
2013-12-04 22:39:53 +00:00
parent 8f14483b60
commit c5c754725a
4 changed files with 35 additions and 23 deletions
+5 -7
View File
@@ -840,6 +840,11 @@ Phaser.Sprite.prototype.kill = function() {
*/
Phaser.Sprite.prototype.destroy = function() {
if (this.filters)
{
this.filters = null;
}
if (this.group)
{
this.group.remove(this);
@@ -860,13 +865,6 @@ Phaser.Sprite.prototype.destroy = function() {
this.animations.destroy();
}
if (this._filters)
{
console.log('removeFilter', this._filters);
this.removeFilter(this._filters);
console.log(this._filters);
}
this.alive = false;
this.exists = false;
this.visible = false;