#Rendering Scratch like blocks
17 messages · Page 1 of 1 (latest)
I don't think the idea alone should be that difficult. The time consuming part would probably be finding the correct offsets for each block, like exactly how much the outer block needs to expand to hold the inner ones and so on. I haven't looked into cetz or fletcher much, but I think it should be doable. It's basically just decorated boxes with indents (and tabs) sticking in (and out).
there’s a javascript library for automatically turning plain text into svg blocks, perhaps it’s possible to make an extension that does that
Why the reply so randomly?
idk
Otherwise, I'm aiming to help out @upper burrow on his blockst package, from a forum post that was made.
I tried at the time to translate the latex package with cetz and I managed to do the blocks and a few more things but I couldn't figure out how to have them grow correctly the way @upper burrow did. The idea was to simply create the blocks with no text inside so the user could simply put what they wanted in their language...
If you are interested I could try to find my files and share them
I don't think he did either, because he used only the curve function. I would too. Share yours if you want, though I would be most interested in screenshots.
Wouldn’t it be easier to use SVG export directly from scratch/turbowarp? Keep your code in one place for testing
May https://github.com/scratchblocks/scratchblocks really could be a good way of translating code to svg as a wasm plugin?
@round aurora What do you think?
I'm not a fan of that, since the existing approach has proven to be possible. It's also not reliant on such libraries if we want to add non-Scratch blocks.
The locales and the reference Scratch blocks from there could be very useful though.
My own attempts were even less successfull that I remebered : this is a screenshot of what I got, but unless you are interested in the code for the pen or the flag, I don't think my code has anything interesting compared to what you have
I would have been interested to help but I looked at the code and, as I have never learned any german, that would be difficult
Thanks for sharing your screenshot! Even if it’s not quite accurate I really like the style of your blocks.
This shouldn’t be a problem because I can easily translate all code comments to English if this would help.
The next logical step would be to translate all render functions to the according English names which shouldn’t be a problem either.
I will give a short update when I have translated the code.