We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone, I am working on an installation based on visual and texts. I would like to extract random quotes from a txt file and show them for a fixed time (eg. 5 seconds) but I am having some trouble. Here is the part of code related to the issue. Thanks in advance!
PFont f;
//Database variables String[] lines; int index = 0;
void setup() { size(800, 800, P3D); noStroke(); frameRate(30); f = createFont("AmericanTypewriter", 16, true);
lines = loadStrings("OBLQ.txt");
}
void draw() { background(230);
//Database if (index < lines.length) { String[] pieces = split(lines[index], " "); if (pieces.length == 2) { int x = int(pieces[' ']) ; int y = int(pieces[1]) ;
println(x); index = index + 1;
//HERE IS WHERE I WOULD LIKE TO INSERT THE TEXT();
} } //Loop database if(index > 20) { index = 0;
} }
Answers
you need this
Thank you so much Chrisir! Have a nice day!