Processing JS/HTML in Snap!

Could we add a Processing JS or HTML function option? I have been learning PJS on Khan Academy, and I would like to be able to use PJS to generate game levels quickly. If not, we could add HTML and I can import PJS through that.

This has come up before.

Where's that?

They don't have it, that's why I asked. If this has come up before, @bh, why can't we add it? Or just make a Snap 2, with html. If you can send me the HTML for Snap*!*, I might be able to do it. It would be SUPER tough though.

I know how to put PJS into HTML, unfortunately I can't really run HTML anywhere. Snap*!* is my my coding place.

If I'm not mistaken, Snap! is rendered only (or mostly?) by Morphic.js

As I said the first time, if you try to do HTML formatting on the stage, as opposed to in another window, you will be fighting Morphic. For example, you use your HTML block and then resize the stage with one of the buttons on the toolbar. Morphic redraws the stage, and your HTML doesn't know anything about it, because the stage isn't a DOM element.

And many more subtle issues. Is your HTML rendered in front of, or behind, Snap!'s drawing? If you want it in front of the background but behind the sprites, you can't say that in HTML because the layers aren't DOM elements.

We are eventually going to have text boxes that you can use (I hope, but this part isn't settled yet) as a sprite's costume. Then you can control its layering in the usual Snap! way. But I'm not promising that the text box will be controlled by HTML code. It'd be easier for users if we do something more like the language used here in the forum to control italics and boldface and the like. Also note that I said "eventually," not "soon"!

There is an example of HTML rich formatting and data entry. It can be extended to create an HTML costume or be coupled with a SNAP HTML builder described by someone else : https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=HTMLDialog

Also quite legitimate use case - animated GIF import : https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=GIFImport.2

And the early stage of scratch-paint import - without the data transfer yet ;( https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=costume_editor.2

Sorry if I caused any problems, @bh, and anyways the HTML I wanted to use doesn't work as expected

Maybe we can just add a text feature, like we thought. Sorry for any issues/offense!

No worries.

K Thanks

i support because processing js is the only typing language i know

I thought that was a js library

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.