Instantly share code, notes, and snippets.

Embed
What would you like to do?
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