Multiple Canvas

I want this sketch (#1) to be the background p5.js Web Editor of this sketch (#2) p5.js Web Editor

I want to save sketch#1 output as an image and use the image as the background of another sketch#2, all in the same program.

I know Instantiation / namespace (video by Dan Shiffman and doc), is that the best way of doing what I described above?

If not, is there a way two canvas can overlap each other without interfering with one another’s code?

Hi @vorfra,

Can I ask you, why this approach and not just using another p5.Graphics and using this as backround for your main sketch ?

Cheers
---- mnse

4 Likes

Hi @mnse,

Thanks for mentioning creategraphics. I wasn’t aware of that as an option to what I was trying to do. Figured it out.

Thanks for the hint.

Best,
vorfra

1 Like