I want the coordinates in the string to change every time the mouse is clicked, but they flash by too quickly to read and I am not sure how to fix, code is below:
PImage cityscape, landscape, sky, moon;
String [] coordinates= {“Utah: 40.693050 N, -111.838330 E”, “Oregon: 45.398290 N, -122.635400 E”, “Kentucky: 39.083730 N, -84.513920 E”, “Dublin: 53.278061 N, -6.149347 E”
};
float skySlide = 0;
float cityscapeSlide = 0;
void setup() {
size(1600, 600);
cityscape = loadImage(“cityscape.png”);
sky = loadImage(“sky.png”);
}
void draw() {
background(255);
//SKY LOGIC
if (mouseX<100) skySlide += 1;
if (mouseX>width-100) skySlide -= 1;
//CITYSCAPE LOGIC
if (mouseX<100) cityscapeSlide += 3;
if (mouseX>width-100) cityscapeSlide -= 3;
//SKY GROUP
push();
translate(skySlide, 0);
image(sky, 0, -993);
image(sky, 2000, -993);
image(sky, -2000, -993);
pop();
if (skySlide>2000) skySlide -= 2000;
if (skySlide< -2000) skySlide += 2000;
//CITYSCAPE GROUP
push();
translate(cityscapeSlide, 0);
image(cityscape, 0, -348);
image(cityscape, 2000, -348);
image(cityscape, -2000, -348);
pop();
if (cityscapeSlide>2000) cityscapeSlide -= 2000;
if (cityscapeSlide< -2000) cityscapeSlide += 2000;
}
void mousePressed(){
fill(255);
textSize(30);
text(coordinates[int(random(coordinates.length))], 600, 300);
}