Skip to content

Instantly share code, notes, and snippets.

@iainnash
Created March 27, 2019 03:58
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 iainnash/a735ded1f01ce02dda650722ad6767c5 to your computer and use it in GitHub Desktop.
Save iainnash/a735ded1f01ce02dda650722ad6767c5 to your computer and use it in GitHub Desktop.
PFont f;
void setup() {
f = createFont("Arial", 42, true);
cnt = 0;
fullScreen();
}
String[] words = {
"beautiful",
"strong",
"loved",
"powerful",
"worthy of love",
"secure",
"unique",
"enough",
"fabulous",
"safe",
"protected",
"appreciated",
"treasured",
"accompanied",
"at peace"
};
int cnt;
int txt;
void draw() {
cnt++;
background(255); // sets background color
textAlign(CENTER, CENTER);
textFont(f, 42); // sents font (from var) and font isze
fill(0); // sets text colour
int step = cnt++ % 100; // changes step every 100 frames
if (step < 2) {
text("You feel " + words[txt++ % words.length], width/2, height/2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment