Created
March 27, 2019 03:58
-
-
Save iainnash/a735ded1f01ce02dda650722ad6767c5 to your computer and use it in GitHub Desktop.
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
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