new getAttrs() method

This commit is contained in:
Eric Rowell
2012-04-07 18:50:53 -07:00
parent 0a94c75e22
commit d3b025254a
5 changed files with 69 additions and 11 deletions

View File

@@ -183,7 +183,7 @@ Kinetic.Stage.prototype = {
addLayer(0);
},
/**
* serialize stage and children as JSON object
* serialize stage and children as a JSON object
*/
toJSON: function() {
var go = Kinetic.GlobalObject;
@@ -210,7 +210,13 @@ Kinetic.Stage.prototype = {
return JSON.stringify(addNode(this));
},
/**
* load stage with JSON string
* load stage with JSON string. De-serializtion does not generate custom
* shape drawing functions, images, or event handlers (this would make the
* serialized object huge). If your app uses custom shapes, images, and
* event handlers (it probably does), then you need to select the appropriate
* shapes after loading the stage and set these properties via on(), setDrawFunc(),
* and setImage()
* @param {String} JSON string
*/
load: function(json) {
function loadNode(node, obj) {