-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.sb loading support #37
Comments
Couldn't you just use https://github.com/LLK/scratch-sb1-converter and load the sb2, once sb2 loading is done? |
scratch-sb1-converter-bundle.zip 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).
}); |
Yeah, we know about that. Currently it is blocked by sb2 loading support.
…On Wed, Jul 8, 2020, 5:35 AM Boomer001 ***@***.***> 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
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQENB4IPABSLOTJMRKBRK3R2Q4WNANCNFSM4K66PROA>
.
|
@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? |
Sounds good, that makes sense! |
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:
kurt
, a Python library which supports reading the Scratch 1.x file format.scratch-sb1-converter
, the JS library that Scratch itself currently uses to convert .sb files into .sb2.ObjReader.as
, the ActionScript code used by Scratch 2.0 to read .sb files.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.The text was updated successfully, but these errors were encountered: