diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 92a8d9794..0881af2cf 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -444,9 +444,10 @@ class VirtualMachine extends EventEmitter { * @property {number} rotationCenterX - the X 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. + * @returns {?Promise} - a promise that resolves when the backdrop has been added */ addBackdrop (md5ext, backdropObject) { - loadCostume(md5ext, backdropObject, this.runtime).then(() => { + return loadCostume(md5ext, backdropObject, this.runtime).then(() => { const stage = this.runtime.getTargetForStage(); stage.sprite.costumes.push(backdropObject); stage.setCostume(stage.sprite.costumes.length - 1);