mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Return promise from backdrop loading
This commit is contained in:
parent
49aa363a30
commit
39115169ca
1 changed files with 2 additions and 1 deletions
|
@ -444,9 +444,10 @@ class VirtualMachine extends EventEmitter {
|
||||||
* @property {number} rotationCenterX - the X component of the backdrop's origin.
|
* @property {number} rotationCenterX - the X component of the backdrop's origin.
|
||||||
* @property {number} rotationCenterY - the Y component of the backdrop's origin.
|
* @property {number} rotationCenterY - the Y component of the backdrop's origin.
|
||||||
* @property {number} [bitmapResolution] - the resolution scale for a bitmap backdrop.
|
* @property {number} [bitmapResolution] - the resolution scale for a bitmap backdrop.
|
||||||
|
* @returns {?Promise} - a promise that resolves when the backdrop has been added
|
||||||
*/
|
*/
|
||||||
addBackdrop (md5ext, backdropObject) {
|
addBackdrop (md5ext, backdropObject) {
|
||||||
loadCostume(md5ext, backdropObject, this.runtime).then(() => {
|
return loadCostume(md5ext, backdropObject, this.runtime).then(() => {
|
||||||
const stage = this.runtime.getTargetForStage();
|
const stage = this.runtime.getTargetForStage();
|
||||||
stage.sprite.costumes.push(backdropObject);
|
stage.sprite.costumes.push(backdropObject);
|
||||||
stage.setCostume(stage.sprite.costumes.length - 1);
|
stage.setCostume(stage.sprite.costumes.length - 1);
|
||||||
|
|
Loading…
Reference in a new issue