Commit graph

174 commits

Author SHA1 Message Date
Karishma Chadha
9b1aa7d7c7 Move comments 2018-05-04 11:00:45 -04:00
Karishma Chadha
55352e88b1 Tests and cleanup of addSprite3 so that .sprite3 format does not need to be nested inside an extra {targets: ...} 2018-05-04 11:00:45 -04:00
Karishma Chadha
adf7571851 Add API to generically validate and add sprite based on validation results. 2018-05-04 11:00:45 -04:00
DD Liu
5e6873628e
Merge pull request #1082 from fsih/updateBitmap
Add updateBitmap function. getCostume can now serve bitmaps as well as svgs
2018-05-01 17:05:34 -04:00
Mx Corey Frang
dbdee0ca8b
Fix downloadProjectId method (#1093)
* Fix downloadProjectId method

* use .data not .data.buffer
2018-05-01 08:56:22 -04:00
Andrew Sliwinski
326d1c491a
Merge pull request #1086 from mortendybdal/feature/add-sprite-3
Included a function to add sprite 3  to vm
2018-05-01 08:38:08 -04:00
Morten Dybdal
41be65ba4d Fixing js linting issues 2018-05-01 13:23:21 +02:00
DD
bd772e5f77 Remove bitmap resolution from svgs 2018-04-30 19:58:48 -04:00
DD
78cd327237 Move the place where we divide rotation center by resolution into the VM. Also revert the method of putting data into storage to the one that was convoluted but working 2018-04-30 16:35:24 -04:00
kchadha
8e65b3d80f
Merge pull request #1092 from kchadha/refactor-video-io
Refactor Video IO
2018-04-30 09:27:10 -04:00
DD
9f0f2fcd27 Pass a data uri 2018-04-27 17:23:30 -04:00
DD
b2aa87da77 fix lint 2018-04-26 18:43:49 -04:00
DD
009253a8d1 Code review 2018-04-26 18:34:35 -04:00
DD
3a3d807cba switch polyfill to one that doesn't break tests 2018-04-26 15:14:51 -04:00
DD
c73b06a254 add polyfill 2018-04-26 15:14:51 -04:00
DD
f1e70c430f updateBitmap 2018-04-26 15:14:51 -04:00
DD
fc36ea5208 Rename getCostumeSvg to getCostume 2018-04-26 13:36:51 -04:00
Karishma Chadha
5f4139cbe4 Use video provider instead of making call to getUserMedia directly. 2018-04-26 13:24:31 -04:00
Morten Dybdal
d033271a1f Included a function to add sprite 3 to vm 2018-04-26 10:59:53 +02:00
Karishma Chadha
dfa3408add Update sound dataFormat after editing 2018-04-20 14:13:57 -04:00
kchadha
8739a524eb
Merge pull request #1031 from kchadha/block_serialization_compression
Block serialization compression
2018-04-11 19:17:42 -04:00
Paul Kaplan
f23b5a9625
Merge pull request #1041 from paulkaplan/fix-clone-drag
Only select the original target after a drag.
2018-04-11 10:04:25 -04:00
Paul Kaplan
64c2d1f7b1
Merge pull request #1038 from paulkaplan/skin-size
Attach the costume size to the costume when loaded and modified
2018-04-11 09:30:02 -04:00
Paul Kaplan
4a9adcc3d9 Make stopDrag deal with bare targets and add tests 2018-04-11 09:12:43 -04:00
Chris Willis-Ford
631d7fb4de
Merge pull request #1021 from cwillisf/features-for-control-extension
Features for control extension
2018-04-10 12:17:43 -07:00
Paul Kaplan
da539ea6cd Only select the original target after a drag.
This allows you to still drag clones around, but when you stop dragging,
the original sprite gets selected.
2018-04-10 14:31:49 -04:00
Paul Kaplan
89eb1ce39b Set the costume asset size when a costume is loaded or modified. 2018-04-10 09:51:29 -04:00
Karishma Chadha
e92db8fa1e Don't really need level 9 compression. 2018-04-06 15:47:24 -04:00
Karishma Chadha
334058b081 Block and variable compression. No need to serialize uid of block and shadow if they are the same, reduce duplication of information. 2018-04-06 11:33:44 -04:00
Christopher Willis-Ford
3be16eddb1 Add code to load 'core' extensions 2018-04-05 12:20:03 -07:00
Karishma Chadha
b8e67a7727 Hookup sb2 import code to deserialize assets from local sb2 file. 2018-03-25 18:14:30 -04:00
kchadha
dbc7b9597f
Merge pull request #979 from kchadha/serialization-cleanup
SB3 Serialization & Load Project
2018-03-23 10:11:49 -04:00
Karishma Chadha
c4ad76eef1 Turns out ArrayBuffers are not views of themselves. 2018-03-22 16:19:36 -04:00
Karishma Chadha
3a4f620318 Check if loadProject input is any typed array using ArrayBuffer.isView. This allows us to pass a project's asset.data (from storage) directly instead of calling toString on it first. 2018-03-22 14:04:58 -04:00
Karishma Chadha
2c3e3472ed Add warning to 'fromJSON' function since it is now just a wrapper around loadProject. Change vm sb3_serialization test to use 'loadProject' function instead of 'fromJSON'. 2018-03-21 17:55:02 -04:00
Karishma Chadha
ce6ef92eb5 Clear runtime after validation success instead of before. 2018-03-21 17:46:39 -04:00
Paul Kaplan
140094a7ad Make "when clicked" blocks target dependent.
This involves adding a new opcode, event_whenstageclicked, and adding a
method to the blocks container to update the opcode pair depending on
whether the target is the stage. This method is then called in two
places: first after the sb2 import parses the blocks (not done in the
sb2 parsing itself because no other blocks are target specific) and then
again when blocks are shared between targets.

Also added tests for the block container method, and a fixture project
that tests the opcode splitting on sb2 import.
2018-03-20 10:41:50 -04:00
Karishma Chadha
003ed01015 Update VM to use scratch-parser callback interface 2018-03-15 22:40:40 -04:00
kchadha
0d55e4c74f Modifying apis to accomodate existing tests. 2018-03-14 22:52:00 -04:00
kchadha
22be2b15f3 Major refactor of project loading. Removed loadProjectLocal, in favor of going back to single API (loadProject). loadProject uses scratch-parser to unpack and validate project. Scratch-parser is getting updated to return validated project, with appended project metadata, and unpacked zip (JSZip object) if provided a buffer. 2018-03-14 22:52:00 -04:00
kchadha
d59a4ffd55 VM receives input buffer representing project to load and unpacks it as zip. This functionality will eventually move to storage. 2018-03-08 10:25:58 -05:00
Karishma Chadha
d6e248aab8 VM should do the heavy lifting of saving project to a zip file, and return a promise of the zip to gui. 2018-03-05 17:20:36 -05:00
Karishma Chadha
c0afcd2ab3 Ensure that md5 and assetId stay in sync. 2018-03-05 15:16:06 -05:00
Karishma Chadha
e0b23cde31 Can load saved sb3 files (including sounds and costumes that were modified in the 3.0 editors and saved in the sb3 zip when the project was saved). Tests still need to be fixed. 2018-03-05 15:16:06 -05:00
Karishma Chadha
089df0a50f Sounds get updated in storage and vm runtime when they are updated in the sound editor. The updateSvg function ensures that the costume that was edited has an updated dataFormat property in the vm runtime. This is specifically for when pngs get edited in the vector editor. Their file format should then get updated to svg. 2018-03-05 15:16:06 -05:00
Karishma Chadha
525a8c2ce7 Serializing sounds and costumes into file descriptors upon 'saveProjectSb3'. 2018-03-05 15:16:06 -05:00
kchadha
a0c7d9aeb3
Merge pull request #956 from kchadha/validate-sb2
Validate sb2
2018-03-02 10:28:53 -05:00
DD
b885402081 Merge branch 'develop' into privateSprite 2018-03-01 17:27:10 -05:00
Karishma Chadha
d9fb315e3b Removing log messages. 2018-02-28 17:10:54 -05:00
Karishma Chadha
7c7b016643 scratch-parser expects json string... 2018-02-28 11:52:22 -05:00