So we've been instructed to make a "paint toy" in my programming class. I'm trying to make a picture load with the press of a key. I want the image to load when I'm holding the key and clicking my mouse to paint the screen with the image. I got the color changes to work but I can't seem to do the same with an image. It runs when I play it, but the image doesn't show up. I do get a bit of slow down though, which means something is working....
here is my code so far!
here is my code so far!
void setup() {
size(800, 600);
noStroke();
fill(#E3EBF5);
background(#4A92F5);
noCursor();
}
void draw() {
if (mousePressed==true) {
ellipse(mouseX-50, mouseY, mouseX+50, mouseY);
stroke(#030303);
}
else {
stroke(#AD71D3);
}
if (keyPressed) {
if (key == 'b' || key == 'B') {
fill(#F05265);
}
}
if (keyPressed) {
if (key == 'v' || key == 'V') {
fill(#00FF46);
}
}
if (keyPressed) {
if (key == 'c' || key == 'C') {
PImage img;
img=loadImage ("Dailey1.png");
}
}
else {
fill(#AD71D3);
}
rect(0, 0, 50, 50);
}
1