sb-edit icon indicating copy to clipboard operation
sb-edit copied to clipboard

.sb loading support

Open adroitwhiz opened this issue 4 years ago • 6 comments

The original Scratch 1.x file format (.sb) would be good to implement.

The following sources might be useful for figuring out how it works:

Scratch 1.x uses mostly the same block opcodes as 2.0, so the same opcode mappings could potentially be used for both formats. As such, this is kinda blocked on ~~a .sb2 implementation.~~ the library rework in #100.

adroitwhiz avatar Feb 29 '20 21:02 adroitwhiz

Couldn't you just use https://github.com/LLK/scratch-sb1-converter and load the sb2, once sb2 loading is done?

easrng avatar Apr 20 '20 21:04 easrng

scratch-sb1-converter-bundle.zip We can use the JS file I have above. Then you can use ScratchSB1Converter. If you don't know how to use it, here is an example:

fetch("https://projects.scratch.mit.edu/1000").then(res => res.arrayBuffer()).then(data => new ScratchSB1Converter.SB1File(data)).then(data => {
  console.log(data.json); // This logs a Scratch 1 project as a Scratch 2 JSON object in the console.
  console.log(data.zip); // This logs all bytes of the Scratch 1 project's assets in the console (but not the JSON).
});

BoomerScratch avatar Jul 08 '20 09:07 BoomerScratch

Yeah, we know about that. Currently it is blocked by sb2 loading support.

On Wed, Jul 8, 2020, 5:35 AM Boomer001 [email protected] wrote:

scratch-sb1-converter-bundle.zip https://github.com/PullJosh/sb-edit/files/4889780/scratch-sb1-converter-bundle.zip We can use the JS file I have above. Then you can use ScratchSB1Converter. If you don't know how to use it, here is an example:

fetch("https://projects.scratch.mit.edu/1000").then(res => res.arrayBuffer()).then(data => new ScratchSB1Converter.SB1File(data)).then(data => { console.log(data.json); // This logs a Scratch 1 project as a Scratch 2 JSON object in the console. console.log(data.zip); // This logs all bytes of the Scratch 1 project's assets in the console (but not the JSON).});

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PullJosh/sb-edit/issues/37#issuecomment-655407980, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQENB4IPABSLOTJMRKBRK3R2Q4WNANCNFSM4K66PROA .

easrng avatar Jul 13 '20 12:07 easrng

@adroitwhiz, is this something you're interested in exploring in the near future or would you like to clear the assignment and let anyone (maybe yourself) come back to it later?

towerofnix avatar Mar 10 '23 17:03 towerofnix

I'm interested on working this after the library is recoded to fix #100. I was blocked in the past on a resolution to #53, but I think we should be good once #100 is fixed.

adroitwhiz avatar Mar 10 '23 18:03 adroitwhiz

Sounds good, that makes sense!

towerofnix avatar Mar 10 '23 19:03 towerofnix