diff --git a/src/extras/AnimatedSprite.js b/src/extras/AnimatedSprite.js index 5297778..cf0ff29 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/AnimatedSprite.js b/src/extras/AnimatedSprite.js index 5297778..cf0ff29 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;