diff options
| author | jmoenig <jens@moenig.org> | 2014-02-11 17:52:59 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-02-11 17:52:59 +0100 |
| commit | 0e0146a0d805389fed1064a5a94db43b1f0e4d3b (patch) | |
| tree | 43e3ee84c81510d14e1a270c4ba3b3167fdeed97 | |
| parent | 4e2bfdec206598317f4145e2cb23a9c9fc453bfb (diff) | |
| download | snap-0e0146a0d805389fed1064a5a94db43b1f0e4d3b.tar.gz snap-0e0146a0d805389fed1064a5a94db43b1f0e4d3b.zip | |
Saving & Loading for arbitrary stage dimensions in the project data
| -rwxr-xr-x | history.txt | 1 | ||||
| -rw-r--r-- | store.js | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/history.txt b/history.txt index 9e0e497..0ffa8c2 100755 --- a/history.txt +++ b/history.txt @@ -2093,3 +2093,4 @@ ______ 140211 ------ * GUI: Set stage dimensions arbitrarily (new entries in the settings menu when holding shift) +* Store: Saving & Loading for arbitrary stage dimensions in the project data @@ -61,7 +61,7 @@ SyntaxElementMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-February-04'; +modules.store = '2014-February-11'; // XML_Serializer /////////////////////////////////////////////////////// @@ -377,6 +377,15 @@ SnapSerializer.prototype.loadProjectModel = function (xmlNode) { project.pentrails.src = model.pentrails.contents; } project.stage.setTempo(model.stage.attributes.tempo); + StageMorph.prototype.dimensions = new Point(480, 360); + if (model.stage.attributes.width) { + StageMorph.prototype.dimensions.x = + +model.stage.attributes.width; + } + if (model.stage.attributes.height) { + StageMorph.prototype.dimensions.y = + +model.stage.attributes.height; + } project.stage.setExtent(StageMorph.prototype.dimensions); SpriteMorph.prototype.useFlatLineEnds = model.stage.attributes.lines === 'flat'; @@ -1341,7 +1350,8 @@ StageMorph.prototype.toXML = function (serializer) { '<project name="@" app="@" version="@">' + '<notes>$</notes>' + '<thumbnail>$</thumbnail>' + - '<stage name="@" costume="@" tempo="@" threadsafe="@" ' + + '<stage name="@" width="@" height="@" ' + + 'costume="@" tempo="@" threadsafe="@" ' + 'lines="@" ' + 'codify="@" ' + 'scheduled="@" ~>' + @@ -1364,6 +1374,8 @@ StageMorph.prototype.toXML = function (serializer) { (ide && ide.projectNotes) ? ide.projectNotes : '', thumbdata, this.name, + StageMorph.prototype.dimensions.x, + StageMorph.prototype.dimensions.y, this.getCostumeIdx(), this.getTempo(), this.isThreadSafe, |
