Skip to content

Instantly share code, notes, and snippets.

@Swimburger
Created April 19, 2014 11:16
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 Swimburger/dcf8b2b624172b49ff87 to your computer and use it in GitHub Desktop.
Save Swimburger/dcf8b2b624172b49ff87 to your computer and use it in GitHub Desktop.
Visual timer Processing
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