Skip to content

Instantly share code, notes, and snippets.

@kmancher
Created February 13, 2019 00:44
Show Gist options
  • Select an option

  • Save kmancher/b4effde6632b3ccdec6237cadf6bb375 to your computer and use it in GitHub Desktop.

Select an option

Save kmancher/b4effde6632b3ccdec6237cadf6bb375 to your computer and use it in GitHub Desktop.
Weight counter text
PFont f;
int weight = 0;
void setup() {
size(640, 360);
// Create the font
//printArray(PFont.list());
f = createFont("SpaceMono-Bold.ttf", 18);
textFont(f);
}
void draw() {
background(102);
textAlign(RIGHT);
fill(255);
text(weight + " pounds of trash thrown away", width-10, height-10);
}
void mousePressed() {
weight++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment