/* Matt Martell IAT 800 - Dr. Christopher Shaw Due Oct. 27, 2008 A3-02 - Write a small app that demonstrates kinetic text. Your app should allow the user to type something and move the text around in some way while they type. For example, the user might type text on a line, but slowly the words or letters start drifting apart, or perhaps the line starts bending, or the words and letters flutter to the bottom of the screen, etc. Of course you shouldn't exactly copy any of the typographic in Processing or that you find on the web (though using such examples for inspiration, as a place to start modifying code, etc. is fine). */ PFont font; String store = ""; char input; float x = 0.0; float a = 0.0; float z = 0.0; void setup() { background(255); size(800, 500); font = loadFont("ArialMT-12.vlw"); textFont(font, 20); frameRate(5); } void draw() { background(255); fill(0); String main = "Can you keep up?"; text (main, 100, 50, 300, 75); String follow = "The quick brown fox jumped over the lazy dog"; text (follow, a, 200); a = x + .5; x++; if (a+(textWidth(follow)) >= width+textWidth(follow)) { a = -textWidth(follow); } if (x >= width) { x = 1; } // Warnings to type faster if (x >= 150) { String slow = "Better type faster"; text (slow, 50, 150); } if (x >= 450) { String hurry = "Give up now"; text (hurry, 250, 150); } if (x >= 650) { String hurry = "Your Toast"; text (hurry, 450, 150); } for(int i=0; i= width) { z = 1; } //to speed up "follow" string x++; x++; if (x >= width) { x = 1; } } } void keyPressed() { input = (char)key; store = store + input; }