mirror of
https://github.com/wassname/phaser.git
synced 2026-06-30 16:40:20 +08:00
Added Text.destroy and BitmapText.destroy.
This commit is contained in:
@@ -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}
|
||||
|
||||
+26
-1
@@ -114,7 +114,6 @@ Phaser.Text = function (game, x, y, text, style) {
|
||||
Phaser.Text.prototype = Object.create(PIXI.Text.prototype);
|
||||
Phaser.Text.prototype.constructor = Phaser.Text;
|
||||
|
||||
|
||||
/**
|
||||
* Automatically called by World.update.
|
||||
* @method Phaser.Text.prototype.update
|
||||
@@ -140,6 +139,32 @@ Phaser.Text.prototype.update = function() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @method Phaser.Text.prototype.destroy
|
||||
*/
|
||||
Phaser.Text.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}
|
||||
|
||||
Reference in New Issue
Block a user