You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
newP5Instance("p5sketch1"):
let
x =100
y =100
setup:
createCanvas(200, 200)
draw:
background(0)
fill(255)
rect(x, y, 50, 50)
and the difference between global and instance mode would just be a macro away (instead of having to add manually sketch.).
and we could actually have in nimib a nbP5Instance which automatically provides a new id and an html container for the sketch in order to have multiple sketches on the same page.
note that I would not know at the moment where to start to build that macro and in particular on how to generate all the closure js syntax (my fallback would be: use emit...).
The text was updated successfully, but these errors were encountered:
with nim macros it could be actually much more painless than in p5js to support instance mode: https://github.com/processing/p5.js/wiki/Global-and-instance-mode
instead of:
we could have:
and the difference between global and instance mode would just be a macro away (instead of having to add manually
sketch.
).and we could actually have in nimib a
nbP5Instance
which automatically provides a new id and an html container for the sketch in order to have multiple sketches on the same page.note that I would not know at the moment where to start to build that macro and in particular on how to generate all the closure js syntax (my fallback would be: use emit...).
The text was updated successfully, but these errors were encountered: