(NEW) trying to have a programme that loads the next picture once ive clicked on it. why is my code not working!!
in
Programming Questions
•
2 years ago
int N = 5;
int Current = 0;
PImage[] Pics;
int W,
H;
void Setup_ArrayPic() {
Pics = new PImage[N];
int i;
Pics = new PImage[N];
for(i = 0; i < N; i++) {
Pics[i] = loadImage("T" + (i + 1) +".jpg");
}
W = Pics[0].width;
H = Pics[0].height;
frameRate(0.5);
}
void mousePressed() {
Setup_ArrayPic();
}
void draw() {
size(W, H);
image(Pics[Current], 0, 0);
Current = (Current + 1)%N;
}
1
