mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
Add Export To Rendered Target
This commit is contained in:
parent
3989959ebf
commit
cac52020a4
1 changed files with 15 additions and 0 deletions
|
@ -64,6 +64,21 @@ RenderedTarget.prototype.initDrawable = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
RenderedTarget.prototype.export = function () {
|
||||||
|
var result = new Object();
|
||||||
|
var notSaved = ["renderer","effects","sprite","drawableID","runtime"];
|
||||||
|
for (x in this) {
|
||||||
|
if (typeof(this[x]) === "function") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (notSaved.indexOf(x) == -1) {
|
||||||
|
result[x] = this[x];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.sprite = this.sprite.export();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this represents an "original" non-clone rendered-target for a sprite,
|
* Whether this represents an "original" non-clone rendered-target for a sprite,
|
||||||
* i.e., created by the editor and not clone blocks.
|
* i.e., created by the editor and not clone blocks.
|
||||||
|
|
Loading…
Reference in a new issue