// Uses movie file from Processing example Libraries | Video (Movie) | Loop import processing.video.*; // video library Movie mov; int cur = 0; // current frame coordinates void setup() { size(480,480); smooth(); textFont(loadFont("Helvetica-14.vlw")); // load and start the movie mov = new Movie(this, "movie.mov"); mov.loop(); } // this is called when a new frame is available // albeit this does nothing, it appears to help the program running well void movieEvent(Movie m) { } void draw() { if(mov.available()) { mov.read(); // determine offsets: need to place it here since it has to be after we read a frame int tileW = mov.width/2, tileH = mov.height/2; int numX = width / tileW, numY = height / tileH; // number of tiles in x,y int x = cur % numX, y = (cur / numX) % numY; image(mov,x*tileW,y*tileH,tileW,tileH); // now treat the movie frame like an image text(mov.time(),x*tileW,(y+1)*tileH); cur ++; } } // START NO NOTES // code used to capture screenshots void keyReleased() { if(key == '`' && !online) save("sketch.png"); }