Basic Rollover/ Image Load help?
in
Programming Questions
•
1 years ago
Hi Guys,
Real Basic.
I have a map with 4 circles on it. When the user rolls over each of the circles, I want corresponding images from my data folder to pop up.
Can anybody explain an easy way to do that? My incorrect code below:
Thanks,
Jeff
Real Basic.
I have a map with 4 circles on it. When the user rolls over each of the circles, I want corresponding images from my data folder to pop up.
Can anybody explain an easy way to do that? My incorrect code below:
Thanks,
Jeff
- PImage mapImage;
PImage b = loadImage( "BartTreiber.jpg");
PImage w = loadImage( "EdwinWheeler.jpg");
PImage e = loadImage( "EugeneWilliams.jpg" );
PImage s = loadImage( "StanleyIvey.jpg" );
void setup() {
size(700, 958);
mapImage = loadImage("map.jpg");
smooth();
noStroke();
}
void draw() {
background(255);
image(mapImage, 0, 0);
fill (206, 43, 38);
ellipse(487, 172, 18, 18);
ellipse(475, 209, 18, 18);
ellipse(656, 221, 18, 18);
ellipse(471, 273, 18, 18);
}
void over()
{
if(mouseX, mouseY, 487, 172 ) {
over = true, loadImage( "BartTreiber.jpg");
}
} else {
over = false;
}
1