Merge pull request from kchadha/variable-scope

Variable scope
This commit is contained in:
kchadha 2018-07-06 14:39:56 -04:00 committed by GitHub
commit 6c118cf8e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 29 deletions
src/engine

View file

@ -1715,6 +1715,15 @@ class Runtime extends EventEmitter {
return this._editingTarget;
}
getAllVarNamesOfType (varType) {
let varNames = [];
for (const target of this.targets) {
const targetVarNames = target.getAllVariableNamesInScopeByType(varType, true);
varNames = varNames.concat(targetVarNames);
}
return varNames;
}
/**
* Tell the runtime to request a redraw.
* Use after a clone/sprite has completed some visible operation on the stage.