I'm trying to create a stop motion animation in processing using 19 images. The only image it shows is the last one in the array which then I thought it must be because of the framerate it would load all 19 in one second, so I tried putting the framerate to "1" with no luck. I then added an if statement to tell the counter to start over and repeat the animation. Any help greatly appreciated.
PImage[] images = new PImage[20];
void setup() {
size(280, 120);
for ( int i = 0; i < images.length; i++ )
{
images[i] = loadImage(i + ".jpg" );
}
}
void draw() {
frameRate(1);
for (int i = 0; i < images.length; i++)
{
image(images[i], 0, 0);
if (i == images.length-1) {
i = 0;
}
}
}