LingDong- / q5xjs

A small and fast alternative (experimental) implementation of p5.js
https://q5xjs.netlify.app/
The Unlicense
544 stars 25 forks source link

Targetting a specific canvas ? #10

Open b2renger opened 3 years ago

b2renger commented 3 years ago

Hello !

I was wondering if q5 was able to target a specific (already existing) canvas in a web page ? This is a restriction in p5js that would be nice to be able to lift in q5 in my opinion.

ww-wolt commented 3 years ago

Just wanted to raise the same issue. It would really be cool to define the canvas instead of always adding a canvas on the root dom node.

rx2347 commented 1 year ago

I think this is a crucial function, especially for a library that small to replace p5js. And yes, there is other ways to do it, but having parent() would make life so much easier, especially if dealing with multiple instances on the same page.

dchicchon commented 1 year ago

Are there any workarounds for this issue at the moment? Running into the same problem

quinton-ashley commented 1 year ago

See my response on issue #7

Adding a canvas to a parentElem could be done for global or instanced Q5!