Open villares opened 3 years ago
@villares yes, we can. I think it's just a matter of:
sketch-holder
window.instance
to store the p5.js sketch object and change it to a Javascript object. Something like:sketch_holder = "sketch_holder" // this can be passed by users via argument or something like that
window.pyp5js_instances = {sketch_holder: window.instance = p5.new(sketch_setup, sketch_holder)}
The only thing to have in mind is that this should also work for Transcrypt. And this is the thing that most frighten me about having n + 1 interpreters: making sure all features are available to all of them.
IMHO, although this feature is something interesting in terms of web, I don't know if it's going be enabled in pyp5js
next. I feel that there are issues with more impacts that will come first such as #132, #125 and #124.
Probably once we have #189 done, this issue should also have been fixed.
As I was looking at how it would feel to have a sketch running on pyodide without the editor (here) I wonder if we could make many sketch instances work in single pyodide.