Hello, I'm currently working with a fork from Scratch from
https://www.turbowarp.org and I'm trying to implement my own custom block that executes javascript code and I've been trying to read through the Snap! source code to see how the JS function is implemented but I can't find anything. I don't know if I'm just not looking hard enough or don't understand how Snap! works under the hood. Any help is appreciated.
Find the block in the database in objects.js; that'll tell you the name of the procedure that implements it, then just look for that.
I have a feeling that the code that you put into the js function block is ran as a lambda function, so, I think that might help.
Welcome to the forums, @qwert0149!
Here's the source code for :
function anonymous(p0
) {
return arguments[arguments.length - 1].reportJSFunction.apply(arguments[arguments.length - 1], [new List([p0]), p0])
}
(Sorry, I do not think it can be put into TurboWarp, TurboWarp and Snap! run on very different engines)
There is creation of javascript "first class" function object
And actuall call.
All those concept are well known to Javascript. So to do something usefull you need to extend your skillset.
Thanks for the reply! Do you think it's possible to create a custom block on TurboWarp that allows the size of a textbox to change dimensions like in the snap JS function or would that also not be possible?
I actually have no idea, sorry.
are you saying that you want want to be able to have multiple lines in a block in turbowarp? if so, I think you may need to modify turbowarp to get that in. Just saying, I know nothing about scratch's source code, so I have absolutely no idea if it is indeed possible or not.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.