Skip to content

Instantly share code, notes, and snippets.

@IosysPio
Created March 24, 2018 13:50
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 IosysPio/b6a8e50ffa2b7073c3bb1a458299b40b to your computer and use it in GitHub Desktop.
Save IosysPio/b6a8e50ffa2b7073c3bb1a458299b40b to your computer and use it in GitHub Desktop.
random_test_001
PFont f;
void setup() {
loop();
size(320, 180);
background(0);
frameRate(30);
// Create the font
// printArray(PFont.list());
f = createFont("Source Code Variable", 36);
textFont(f);
}
void draw() {
background(152);
textAlign(CENTER);
int x = int(width * 0.5), y = int(height * 0.5);
fill(0);
text(int(random(500)), x, y);
if (mousePressed) {
loop();
redraw();
} else {
noLoop();
}
}
void mousePressed() {
loop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment