mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-03 09:04:40 -04:00
Merge pull request #1148 from kchadha/stage-layering
Layer group ordering.
This commit is contained in:
commit
a85f641d25
11 changed files with 79 additions and 40 deletions
|
@ -15,6 +15,7 @@ const StringUtil = require('../util/string-util');
|
|||
const specMap = require('./sb2_specmap');
|
||||
const Variable = require('../engine/variable');
|
||||
const MonitorRecord = require('../engine/monitor-record');
|
||||
const StageLayering = require('../engine/stage-layering');
|
||||
|
||||
const {loadCostume} = require('../import/load-costume.js');
|
||||
const {loadSound} = require('../import/load-sound.js');
|
||||
|
@ -400,7 +401,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip)
|
|||
}
|
||||
|
||||
// Create the first clone, and load its run-state from JSON.
|
||||
const target = sprite.createClone();
|
||||
const target = sprite.createClone(topLevel ? StageLayering.BACKGROUND_LAYER : StageLayering.SPRITE_LAYER);
|
||||
|
||||
const getVariableId = generateVariableIdGetter(target.id, topLevel);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ const vmPackage = require('../../package.json');
|
|||
const Blocks = require('../engine/blocks');
|
||||
const Sprite = require('../sprites/sprite');
|
||||
const Variable = require('../engine/variable');
|
||||
const StageLayering = require('../engine/stage-layering');
|
||||
const log = require('../util/log');
|
||||
const uid = require('../util/uid');
|
||||
|
||||
|
@ -779,7 +780,7 @@ const parseScratchObject = function (object, runtime, extensions, zip) {
|
|||
// process has been completed.
|
||||
});
|
||||
// Create the first clone, and load its run-state from JSON.
|
||||
const target = sprite.createClone();
|
||||
const target = sprite.createClone(object.isStage ? StageLayering.BACKGROUND_LAYER : StageLayering.SPRITE_LAYER);
|
||||
// Load target properties from JSON.
|
||||
if (object.hasOwnProperty('tempo')) {
|
||||
target.tempo = object.tempo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue