Hey I'm having trouble figuring out how to load arrays of PImages so the can be switched between quickly once they have been loaded. I'm trying to make a sort of slideshow that I can control and I need to be able to cut quickly between images but there are too many to load all at once( around 4000).
If anyone thinks they could give me some help here is my code.
boolean loaded = false;
PImage images[];
void setup() {
size(screen.width,screen.height);
frameRate(40);
}
void draw() {
imageBank("a", 8);
}
void imageBank(String index, int filecount) {
if(loaded = false) {
PImage[] images = new PImage[filecount];
for ( int i = 1; i< images.length; i++ ) {
images[i] = loadImage(index + i + ".jpg" );
if(i == filecount) {
loaded = true;
}
}
}
if(loaded = true) {
image(images[x], 0, 0, screen.width, screen.height);
x = x++;
delay(1000);
if (x == filecount) {
x = 1;
}
}
}
1