We are about to switch to a new forum software. Until then we have removed the registration on this forum.
HALP!
So I have two canvas's
function setup() {
createCanvas(300, 300);
graphics = createGraphics(300, 300);
}
the bottom one I have created an animation with p5.js, the top one I want to import an image..
I want to do a
if (mouseIsPressed) {
graphics.fill(255);
graphics.stroke(255);
graphics.ellipse(mouseX, mouseY, 50, 50)
}
but instead of drawing I want to show the image..
One idea is to have the top image transparent and use the mouseIsPressed to turn that ellipse not transparent, I tried doing it in reverse and making the graphics.fill transparent but of course it draws transparent over top of an image..
I am stuck.. HALP
Answers
you may get more answers if you include runnable examples rather than snippets
TBH I don't have much because I am not really sure how to wrap my head around doing it ..
This is what I have, I am playing just with a simple shape at the moment to try and wrap my head around working with two canvas's
oopphh also, if you would know how I should format this properly let me know! my three `'s didn't work...
To format your code, edit post, select code and press
ctrl+o
. Ensure there is an empty line before and one after your code.Kf