Added Text.destroy and BitmapText.destroy.

This commit is contained in:
photonstorm
2013-10-17 15:40:44 +01:00
parent 4b2ac6c6c6
commit 275fa4641e
6 changed files with 92 additions and 6 deletions
+26
View File
@@ -145,6 +145,32 @@ Phaser.BitmapText.prototype.update = function() {
}
/**
* @method Phaser.Text.prototype.destroy
*/
Phaser.BitmapText.prototype.destroy = function() {
if (this.group)
{
this.group.remove(this);
}
if (this.canvas.parentNode)
{
this.canvas.parentNode.removeChild(this.canvas);
}
else
{
this.canvas = null;
this.context = null;
}
this.exists = false;
this.group = null;
}
/**
* Get
* @returns {Description}