From 0f4e80cbfcbaaec25016246a216d0d1615b7ae7f Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Tue, 29 Nov 2016 17:23:28 -0500 Subject: [PATCH] Add Export To Sprite --- src/sprites/sprite.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/sprites/sprite.js b/src/sprites/sprite.js index 0f189206..479647c3 100644 --- a/src/sprites/sprite.js +++ b/src/sprites/sprite.js @@ -54,4 +54,18 @@ Sprite.prototype.createClone = function () { return newClone; }; +Sprite.prototype.export = function () { + var result = new Object(); + var notSaved = ["clones","runtime"]; + for (x in this) { + if (typeof(this[x]) === "function") { + continue; + } + if (notSaved.indexOf(x) == -1) { + result[x] = this[x]; + } + } + return result; +}; + module.exports = Sprite;