From 3d4a49c84cd5b01384e12424b4c5f347bd13f7ff Mon Sep 17 00:00:00 2001 From: Code WvS Date: Fri, 27 Feb 2015 12:56:13 +0100 Subject: spritify markers --- gui.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gui.js') diff --git a/gui.js b/gui.js index 7fb48ac..875a3d2 100644 --- a/gui.js +++ b/gui.js @@ -211,6 +211,10 @@ IDE_Morph.prototype.init = function (isAutoFill) { this.serializer = new SnapSerializer(); this.globalVariables = new VariableFrame(); + + // recreate all Sprite markers (Snap-YOW) + window.spriteGroup = L.layerGroup().addTo(window.map); + this.currentSprite = new SpriteMorph(this.globalVariables); this.sprites = new List([this.currentSprite]); this.currentCategory = 'map'; @@ -2797,6 +2801,11 @@ IDE_Morph.prototype.newProject = function () { location.hash = ''; } this.globalVariables = new VariableFrame(); + + // recreate all Sprite markers (Snap-YOW) + window.map.removeLayer(window.spriteGroup); + window.spriteGroup = L.layerGroup().addTo(window.map); + this.currentSprite = new SpriteMorph(this.globalVariables); this.sprites = new List([this.currentSprite]); StageMorph.prototype.dimensions = new Point(480, 360); -- cgit v1.3.1