From 5b69621ffa67322e17599254f8558ed8c2f8aec0 Mon Sep 17 00:00:00 2001 From: Sotiri Bakagiannis Date: Fri, 24 Jul 2020 17:11:40 +0100 Subject: [PATCH] core/MinimalStim: add release method --- js/core/MinimalStim.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/core/MinimalStim.js b/js/core/MinimalStim.js index 83ea680..be3dbda 100644 --- a/js/core/MinimalStim.js +++ b/js/core/MinimalStim.js @@ -160,6 +160,26 @@ export class MinimalStim extends PsychObject } + /** + * Release the PIXI representation, if there is one. + * + * @name module:core.MinimalStim#release + * @function + * @public + */ + release() + { + this._setAttribute('autoDraw', false, log); + this.status = PsychoJS.Status.STOPPED; + + if (typeof this._pixi !== 'undefined') + { + this._pixi.destroy(true); + this._pixi = undefined; + } + } + + /** * Update the stimulus, if necessary. *