diff --git a/package.json b/package.json index ce17a4f..75656b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "4.5.1", + "version": "4.5.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ diff --git a/package.json b/package.json index ce17a4f..75656b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "4.5.1", + "version": "4.5.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ diff --git a/src/extras/AnimatedSprite.js b/src/extras/AnimatedSprite.js index 43ea7d0..a24f07c 100644 --- a/src/extras/AnimatedSprite.js +++ b/src/extras/AnimatedSprite.js @@ -262,11 +262,17 @@ /** * Stops the AnimatedSprite and destroys it * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - destroy() + destroy(options) { this.stop(); - super.destroy(); + super.destroy(options); } /** diff --git a/package.json b/package.json index ce17a4f..75656b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "4.5.1", + "version": "4.5.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ diff --git a/src/extras/AnimatedSprite.js b/src/extras/AnimatedSprite.js index 43ea7d0..a24f07c 100644 --- a/src/extras/AnimatedSprite.js +++ b/src/extras/AnimatedSprite.js @@ -262,11 +262,17 @@ /** * Stops the AnimatedSprite and destroys it * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - destroy() + destroy(options) { this.stop(); - super.destroy(); + super.destroy(options); } /** diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index f31c2b6..72fee21 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -324,12 +324,18 @@ } /** - * Destroys this tiling sprite + * Destroys this sprite and optionally its texture and children * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - destroy() + destroy(options) { - super.destroy(); + super.destroy(options); this.tileTransform = null; this.uvTransform = null;