Created
April 19, 2014 11:16
-
-
Save Swimburger/dcf8b2b624172b49ff87 to your computer and use it in GitHub Desktop.
Visual timer Processing
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
int timer; | |
int timespan=1000*10; | |
void draw() { | |
if(millis()>timer+timespan) | |
{ | |
timer=millis(); | |
moveToNextHashtag(); | |
} | |
if(toPdf) | |
beginRecord(PDF, "frame-####.pdf"); | |
try{ | |
List<Status> twities = tweets.get(getCurrentHashtag()); | |
map.draw(); | |
fill(85,172,238,180); | |
rect(0,0,((float)((float)(millis()-timer)/timespan)*width),15); | |
if(twities==null) | |
return; | |
if(twities.size()==0) | |
return; | |
drawTweets(twities); | |
}catch (Exception e) { | |
} | |
if(toPdf) | |
{ | |
endRecord(); | |
toPdf=false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment