Skip to content

Instantly share code, notes, and snippets.

@drart
Created September 19, 2011 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drart/1226756 to your computer and use it in GitHub Desktop.
Save drart/1226756 to your computer and use it in GitHub Desktop.
Processing sketch to present a Petcha Kutcha for images 1.jpg to 20.jpg
/*
* Adam R. Tindale 2010
* http://www.adamtindale.com
*
* Create a data folder with your 1-20.jpg files to get it working.
*/
PImage[] images = new PImage[20];
int counter = 0;
int loadtime;
void setup() {
size(screen.width,screen.height);
for (int i = 0 ; i < 20; i++)
images[i] = loadImage( Integer.toString(i+1) + ".jpg" );
imageMode(CENTER);
noCursor();
loadtime = millis();
}
void draw(){
background(0);
if ( counter >= 20 )
{
text( "FIN", width/2, height/2 );
return;
}
if ( images[counter].width > width && images[counter].height > height)
image (images[counter] ,width/2, height/2, width, height);
else
image (images[counter] ,width/2, height/2);
counter = ( millis() - loadtime ) / 20000 ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment