Simple Code - How to load image X if key==r or image Y if key==s
in
Programming Questions
•
2 years ago
PImage d;
PImage c;
void setup () {
size(1000,760);
background(0);
}
void keyPressed()
{
if(key=='r'){
d = loadImage("lin.jpg");
image(d, 0, 0);
}
if(key=='s'){
c = loadImage("links.jpg");
image(c, 0, 0);
}
}
1