Hi, I am trying to display a series of thumbnail pre-loaded thumbnail images in a grid. I'm having trouble getting the image to increment after each cell in the grid. Right now it only draws the last image loaded. The code is below. Any help would be greatly appreciated!!
int totalFrames = 12;
PImage[] images = new PImage[totalFrames];
int xSize = 50;
int ySize = 36;
int x = 0;
int y = 0;
void setup() {
size(500, 500);
for (int i=0; i<totalFrames; i++) {
String imageName = i + ".jpg";
images[i] = loadImage(imageName);
print(images[i]);
}
}
void draw() {
background(0);
for (int i = 0; i < width; i = i+xSize) {
for (int j = 0; j < height; j = j+ySize) {
for (int f = frameNumLow; f < frameNumHigh; f++) {
image(images[x], i, j);
if ((i + i)%2==0){
x++;
}
if (x >=11) {
x = x-1;
}
}
}
}
1