Skip to content

Commit 6c11124

Browse files
committed
adding ml.js and dom.js new ones
1 parent 8978fe5 commit 6c11124

File tree

2 files changed

+54
-64
lines changed

2 files changed

+54
-64
lines changed

Scripts/camScript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function anotheEffectForCamera() {
1919
noStroke();
2020

2121
// fill(redVal, greenVal, blueVal, 150); // face becomes lit up, the rest is transparent
22-
fill(redVal, greenVal, blueVal); // face becomes lit up, the rest is transparent
22+
// fill(redVal, greenVal, blueVal); // face becomes lit up, the rest is transparent
2323

2424
// tint(255, 255, 255, 100);
2525

@@ -42,7 +42,7 @@ function renderCamera() {
4242

4343
if (cameraVideo) { //under video
4444
// console.log('camera VIdeo');
45-
// image(myCamera, 0, 0, width, height); //size and position of video // COMENTED FOR PIXELS
45+
image(myCamera, 0, 0, width, height); //size and position of video // COMENTED FOR PIXELS
4646
// filter(INVERT);
4747
// filter(POSTERIZE, 3);
4848
// filter(BLUR, 3);

Scripts/textScript.js

Lines changed: 52 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,46 @@ function randomize() {
55

66
}
77

8+
function DoText() {
9+
10+
//subtitute for millis
11+
12+
terminal = true;
13+
showTerminal++;
14+
15+
console.log('Counting: ' + count);
16+
17+
if (terminal && !subtitle) {
18+
doTerminal();
19+
showTerminal++;
20+
// terminal = false;
21+
}
22+
23+
if (showTerminal == 400) { // maybe poner el final del texto producido.
24+
terminal = false;
25+
subtitle = true;
26+
}
27+
28+
if (subtitle) {
29+
DoSubtitle();
30+
showSubtitle++;
31+
}
32+
33+
if (showSubtitle == 1000) { // maybe poner el final del texto producido.
34+
terminal = true;
35+
subtitle = false;
36+
37+
showSubtitle = 0;
38+
showTerminal = 0;
39+
}
40+
41+
// TERMINAL TEXT
42+
// text(sourceText.substring(startWriting, right + 1), posXtextT, posYtextT + 100, w, h);
43+
// // SUBTITLE TEXT
44+
// DoSubtitle();
45+
46+
}
47+
848
function doTerminal() {
949

1050
let posXtextT = windowWidth - (windowWidth - 100);
@@ -37,6 +77,8 @@ function doTerminal() {
3777
'\nActualizando narrativa...';
3878
} else {
3979

80+
//MAKE THIS SENTENCE MORE VARIABLE
81+
4082
if (translate) {
4183
sourceText = 'Generando narrativa...' +
4284
'\nElemento encontrado: ' +
@@ -62,29 +104,6 @@ function doTerminal() {
62104
}
63105
}
64106

65-
// // Speed of the text being generated
66-
67-
// if (textSpeed < sourceText.length) {
68-
// textSpeed += 0.3;
69-
// } else {
70-
// textSpeed = 0;
71-
// textSpeed += 0.3;
72-
// }
73-
74-
// ------------------------------- END OF TERMINAL TEXT
75-
76-
//CODE TO SIMULATE WRITING
77-
// https://creative-coding.decontextualize.com/text-and-type/
78-
79-
// var startWriting = 0;
80-
// // var left = startWriting - textSpeed ;
81-
// var right = startWriting + textSpeed;
82-
83-
// var count = 0;
84-
85-
// var random = Math.floor(random(150, 300));
86-
87-
88107
var startWriting = 0;
89108
// var left = startWriting - textSpeed ;
90109
var right = startWriting + textSpeed;
@@ -99,49 +118,20 @@ function doTerminal() {
99118
}
100119

101120
text(sourceText.substring(startWriting, right + 1), posXtextT, posYtextT + 100, w, h);
102-
console.log('narrative tur');
103-
terminal = false;
104-
105-
106-
}
107-
108-
109-
function DoText() {
110-
111-
//COUNTER TO SLOW APPEARANCES
112-
113-
console.log('wmxlksmxl');
114-
115-
count++;
116-
console.log(count);
117-
118-
var tiempoTerminal = 0;
119-
120-
if (count > tiempoTerminal) {
121-
doTerminal();
122-
}
123-
if (count == tiempoTerminal + 350) {
124-
count = 0;
125121

126-
}
127-
128-
// TERMINAL TEXT
129122

123+
// ------------------------------- END OF TERMINAL TEXT
130124

131-
// text(sourceText.substring(startWriting, right + 1), posXtextT, posYtextT + 100, w, h);
132-
133-
134-
//this is static text
135-
136-
// text(sourceText, posXtextT, posYtextT + 100, w, h);
125+
//CODE TO SIMULATE WRITING
126+
// https://creative-coding.decontextualize.com/text-and-type/
137127

138-
// Add cursor
139-
// fill(color + sin(frameCount * 0.1) * 128);
140-
// text('_', posXtextT, posYtextT + 100, w, h);
128+
// var startWriting = 0;
129+
// // var left = startWriting - textSpeed ;
130+
// var right = startWriting + textSpeed;
141131

142-
// SUBTITLE TEXT
143-
DoSubtitle();
132+
// var count = 0;
144133

134+
// var random = Math.floor(random(150, 300));
145135
}
146136

147137
function DoSubtitle() {
@@ -219,7 +209,7 @@ function extraText() {
219209
}
220210

221211

222-
function keyPressed() {
212+
function keyPressed() { // make extratext advance by pressing keys
223213
count++;
224214
if (count == totalSentences) {
225215
count = 0;
@@ -266,5 +256,5 @@ function replacer(match) {
266256

267257
console.log('match: ' + match);
268258

269-
259+
270260
}

0 commit comments

Comments
 (0)