Merge 7b677aec3a
into fda87985c7
This commit is contained in:
commit
5134fe10b7
2 changed files with 9 additions and 1 deletions
|
@ -306,6 +306,9 @@ Interpreter.prototype.initPrims = function() {
|
||||||
this.primitiveTable['timerReset'] = function(b) { interp.timerBase = Date.now(); };
|
this.primitiveTable['timerReset'] = function(b) { interp.timerBase = Date.now(); };
|
||||||
this.primitiveTable['timer'] = function(b) { return (Date.now() - interp.timerBase) / 1000; };
|
this.primitiveTable['timer'] = function(b) { return (Date.now() - interp.timerBase) / 1000; };
|
||||||
|
|
||||||
|
// added by Lucas
|
||||||
|
this.primitiveTable['stopScripts'] = function(b) { interp.activeThread = new Thread(null); interp.threads = []; };
|
||||||
|
|
||||||
new Primitives().addPrimsTo(this.primitiveTable);
|
new Primitives().addPrimsTo(this.primitiveTable);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,11 @@ var Sprite = function(data) {
|
||||||
this.stacks = [];
|
this.stacks = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Creates a formatted URI for a costume image resource.
|
||||||
|
Sprite.prototype.formatCostumeImageUri = function(costume, io) {
|
||||||
|
return io.asset_base + costume.baseLayerMD5 + io.asset_suffix;
|
||||||
|
};
|
||||||
|
|
||||||
// Attaches a Sprite (<img>) to a Scratch scene
|
// Attaches a Sprite (<img>) to a Scratch scene
|
||||||
Sprite.prototype.attach = function(scene) {
|
Sprite.prototype.attach = function(scene) {
|
||||||
// Create textures and materials for each of the costumes.
|
// Create textures and materials for each of the costumes.
|
||||||
|
@ -142,7 +147,7 @@ Sprite.prototype.attach = function(scene) {
|
||||||
})
|
})
|
||||||
.attr({
|
.attr({
|
||||||
'crossOrigin': 'anonymous',
|
'crossOrigin': 'anonymous',
|
||||||
'src': io.asset_base + this.costumes[c].baseLayerMD5 + io.asset_suffix
|
'src': this.formatCostumeImageUri(this.costumes[c], io)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue