-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat-meme.js
More file actions
54 lines (42 loc) · 951 Bytes
/
chat-meme.js
File metadata and controls
54 lines (42 loc) · 951 Bytes
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
50
51
52
53
54
// Typewriter for p5js
// by Olaf Val
function setup() {
createCanvas(400, 400);
tw1 = new Typewriter();
tw2 = new Typewriter();
tw3 = new Typewriter();
tw4 = new Typewriter();
textFont('Arial');
fill(80,55,25);
}
function draw() {
background(245);
noStroke();
textSize(32);
textStyle(ITALIC);
textAlign(RIGHT);
text('hey', 380,120);
// Blind text for creating a pause
tw1.twSpeed(500); // potional
tw1.twType(' ',0 , 0);
if (tw1.twCompleted()) {
tw2.twSpeed(80); // potional
tw2.twType('hey sorry i was busy', 20, 200);
}
// Blind text for creating a pause
if (tw2.twCompleted()) {
tw3.twSpeed(500);
tw3.twType(' ', 0, 0);
}
if (tw3.twCompleted()) {
tw4.twSpeed(150);
tw4.twAlign('RIGHT');
tw4.twType('i sent that 2 years ago', 380, 300);
}
}
function mousePressed() {
tw1.twRestart();
tw2.twRestart();
tw3.twRestart();
tw4.twRestart();
}