Fixed stupid error in destroy().

This commit is contained in:
photonstorm
2014-02-28 06:17:18 +00:00
parent e45a929b00
commit 4562939e4e
7 changed files with 49 additions and 6 deletions
+8 -1
View File
@@ -211,7 +211,14 @@ Phaser.BitmapText.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
this.parent.remove(this);
if (this.parent.instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
}
var i = this.children.length;
+8 -1
View File
@@ -148,7 +148,14 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
this.parent.remove(this);
if (this.parent.instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
}
var i = this.children.length;
+8 -1
View File
@@ -376,7 +376,14 @@ Phaser.Image.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
this.parent.remove(this);
if (this.parent.instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
}
if (this.events)
+8 -1
View File
@@ -499,7 +499,14 @@ Phaser.Sprite.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
this.parent.remove(this);
if (this.parent.instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
}
if (this.input)
+8 -1
View File
@@ -191,7 +191,14 @@ Phaser.Text.prototype.destroy = function (destroyChildren) {
if (this.parent)
{
this.parent.remove(this);
if (this.parent.instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
}
this.texture.destroy();
+8 -1
View File
@@ -291,7 +291,14 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
this.parent.remove(this);
if (this.parent.instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
}
this.animations.destroy();
+1
View File
@@ -9,6 +9,7 @@
* These properties affect how the body reacts to forces, what forces it generates on itself (to simulate friction), and how it reacts to collisions in the scene.
* In most cases, the properties are used to simulate physical effects. Each body also has its own property values that determine exactly how it reacts to forces and collisions in the scene.
* By default a single Rectangle shape is added to the Body that matches the dimensions of the parent Sprite. See addShape, removeShape, clearShapes to add extra shapes around the Body.
* Note: When bound to a Sprite to avoid single-pixel jitters on mobile devices we strongly recommend using Sprite sizes that are even on both axis, i.e. 128x128 not 127x127.
*
* @class Phaser.Physics.Body
* @classdesc Physics Body Constructor