Created
September 19, 2011 15:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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