File Listing Order

When I need to code a very simple sketch, w/o any animations or even functions, I use what is so called “static sketch”.

The standard 1 is called “interactive sketch”, in which we can have the callbacks setup() & draw().

More info on them here: Processing Overview / Processing.org

Here’s the my “static sketch” converted to “dynamic sketch”: :grinning:

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

void setup() {
  final File dir = dataFile("");
  println(dir);

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

  if (dir.isDirectory()) {
    imagePaths = listPaths(dir.getPath(), "files", "recursive", PICS_EXTS);
    imagesFound = imagePaths.length;
  }

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

  exit();
}
1 Like