File Listing Order


static final String PICS_EXTS = "extensions=,png,jpg,jpeg,gif,tif,tiff,tga,bmp,wbmp";

static final float FPS = .25;

PImage[] images;

void setup() {
  size(1200, 600);

  final File dir = dataFile("");

  String[] imagePaths = {};
  int imagesFound = 0;

  if (dir.isDirectory()) {
    imagePaths = listPaths(dir.getPath(), "files", "recursive", PICS_EXTS);
    imagesFound = imagePaths.length;
    java.util.Arrays.sort(imagePaths); // sorts the array in place

  println("Found", imagesFound, "image(s)");

  for (int i = 0; i < imagesFound; images[i] = loadImage(imagePaths[i++]));

void draw() {
  image(images[frameCount % images.length], width>>1, height>>1);


Yeah, I mentioned it in the first reply to this topic, and even you in the second reply…

I feel like this topic may or may not have went for WAY too long than needed and we are just kind of repeating ourselves here… :smiley: