diff --git a/src/import/sb2import.js b/src/import/sb2import.js index 45f738942..cf97efa1d 100644 --- a/src/import/sb2import.js +++ b/src/import/sb2import.js @@ -51,7 +51,7 @@ function parseScratchObject (object, runtime, topLevel) { var costume = object.costumes[i]; // @todo: Make sure all the relevant metadata is being pulled out. sprite.costumes.push({ - skin: 'https://cdn.assets.scratch.mit.edu/internalapi/asset/' + skin: 'https://cdn.assets.scratch.mit.edu/internalapi/asset/' + costume.baseLayerMD5 + '/get/', name: costume.costumeName, bitmapResolution: costume.bitmapResolution, @@ -68,26 +68,27 @@ function parseScratchObject (object, runtime, topLevel) { var target = sprite.createClone(); // Add it to the runtime's list of targets. runtime.targets.push(target); - if (object.scratchX) { + if (object.hasOwnProperty('scratchX')) { target.x = object.scratchX; } - if (object.scratchY) { + if (object.hasOwnProperty('scratchY')) { target.y = object.scratchY; } - if (object.direction) { + if (object.hasOwnProperty('direction')) { target.direction = object.direction; } - if (object.scale) { + if (object.hasOwnProperty('scale')) { // SB2 stores as 1.0 = 100%; we use % in the VM. target.size = object.scale * 100; } - if (object.visible) { + if (object.hasOwnProperty('visible')) { target.visible = object.visible; } - if (object.currentCostumeIndex) { + if (object.hasOwnProperty('currentCostumeIndex')) { target.currentCostume = object.currentCostumeIndex; } target.isStage = topLevel; + target.updateAllDrawableProperties(); // The stage will have child objects; recursively process them. if (object.children) { for (var j = 0; j < object.children.length; j++) {