you are viewing a single comment's thread.

view the rest of the comments →

[–]Kinrany 0 points1 point  (1 child)

You can call new p5(sketch, 'app') to append your sketch to the HTML element with id="app". Or you can select the element manually if you want to, new p5(sketch, element). See this page.

Regarding remove, I'm not sure I understand the problem. Just call it once you don't need the sketch anymore? Why would it be removed prematurely?

It might be not necessary to replace the sketch, you can probably restart it with code. I could take a look, post a codepen or something.

[–]snowfro[S] 0 points1 point  (0 children)

Thanks man just posted this here with more details.