Skip to content

Commit 433d017

Browse files
author
amp
committed
fix(gui): migrate empty sprites and costumes to Scratch 3
This fixes the "paint" button
1 parent 01a3322 commit 433d017

1 file changed

Lines changed: 27 additions & 18 deletions

File tree

packages/gui/src/lib/empty-assets.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
*/
1111
const emptyCostume = name => ({
1212
name: name,
13-
md5: 'cd21514d0531fdffb22204e0ec5ed84a.svg',
14-
rotationCenterX: 0,
15-
rotationCenterY: 0,
1613
bitmapResolution: 1,
17-
skinId: null
14+
dataFormat: 'svg',
15+
assetId: 'cd21514d0531fdffb22204e0ec5ed84a',
16+
md5ext: 'cd21514d0531fdffb22204e0ec5ed84a.svg',
17+
rotationCenterX: 0,
18+
rotationCenterY: 0
1819
});
1920

2021
/**
@@ -26,27 +27,35 @@ const emptyCostume = name => ({
2627
* @return {object} object expected by vm.addSprite
2728
*/
2829
const emptySprite = (name, soundName, costumeName) => ({
29-
objName: name,
30-
sounds: [],
30+
name: name,
31+
isStage: false,
32+
variables: {},
33+
lists: {},
34+
broadcasts: {},
35+
blocks: {},
36+
comments: {},
37+
currentCostume: 0,
3138
costumes: [
3239
{
33-
costumeName: costumeName,
34-
baseLayerID: -1,
35-
baseLayerMD5: 'cd21514d0531fdffb22204e0ec5ed84a.svg',
40+
name: costumeName,
3641
bitmapResolution: 1,
42+
dataFormat: 'svg',
43+
assetId: 'cd21514d0531fdffb22204e0ec5ed84a',
44+
md5ext: 'cd21514d0531fdffb22204e0ec5ed84a.svg',
3745
rotationCenterX: 0,
3846
rotationCenterY: 0
3947
}
4048
],
41-
currentCostumeIndex: 0,
42-
scratchX: 36,
43-
scratchY: 28,
44-
scale: 1,
45-
direction: 90,
46-
rotationStyle: 'normal',
47-
isDraggable: false,
49+
sounds: [],
50+
volume: 100,
51+
layerOrder: 1,
4852
visible: true,
49-
spriteInfo: {}
53+
x: 36,
54+
y: 28,
55+
size: 100,
56+
direction: 90,
57+
draggable: false,
58+
rotationStyle: 'all around'
5059
});
5160

52-
export {emptyCostume, emptySprite};
61+
export {emptyCostume, emptySprite};

0 commit comments

Comments
 (0)