-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcluhanquote.js
49 lines (40 loc) · 940 Bytes
/
mcluhanquote.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Typewriter for p5js
// by Olaf Val
function setup() {
createCanvas(400, 400);
tw1 = new Typewriter();
tw2 = new Typewriter();
tw3 = new Typewriter();
tw4 = new Typewriter();
textFont('Times New Roman');
fill(80,55,25);
}
function draw() {
background(245);
noStroke();
textSize(35);
textStyle(ITALIC);
tw1.twSpeed(80); // potional
tw1.twType("I don't necessarily agree ", 20, 150);
if (tw1.twCompleted()) {
tw2.twSpeed(120); // potional
tw2.twType('with everything that I say.', 20, 200);
}
// Blind text for creating a rhetorical pause
if (tw2.twCompleted()) {
tw3.twSpeed(400); // potional
tw3.twType(' ', 20, 250);
}
textStyle(NORMAL);
textSize(25);
if (tw3.twCompleted()) {
tw4.twSpeed(50); // potional
tw4.twType('Marshall McLuhan', 20, 250);
}
}
function mousePressed() {
tw1.twRestart();
tw2.twRestart();
tw3.twRestart();
tw4.twRestart();
}