-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsketch.js
49 lines (42 loc) · 906 Bytes
/
sketch.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
// textSlicer
// Werllen Castro, 2021
// github.com/werls
//
// Originally made for Lâmina — MOSTRA AUDIOVISUAL PRETA
// http://mostralamina.com.br
//
// Full design process on Behance:
// https://www.behance.net/gallery/122884567/LAMINA-Mostra-Audiovisual-Preta
p5.disableFriendlyErrors = true; // disables FES
function preload() {
myfont = loadFont('./Syncopate-Bold.ttf');
}
function setup() {
background(0);
txt = 'TEXT\nSLICER';
distortion = 30;
slicer = new textSlicer(txt, distortion);
slicer.setupCanvas();
slicer.setupText(txt);
}
function draw() {
clear();
background(0);
slicer.show();
fill(0);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
setup();
}
function showFrameRate() {
push();
fill(0);
textSize(20);
textFont('Courier New');
text(floor(frameRate()),100,100);
if (frameRate() < 30) {
text('LOW PERFOMANCE', 100,120);
}
pop();
}