Hey,
I am having trouble with my code. I split my text into lines, which should be drawn in random sizes to the screen. Now, there are two problems: First of all splitTokens deletes all my delimiters, but also ', – and umlauts like ä, ü, ö from the text. Is there a way to add them again to the lines? And second, how could I write more than just one line per frame but all lines that fit in the screen each below the other and then go to the next frame?
Is there a solution or am I making something completely wrong?
I am relatively new to Processing, so every answer is helpful. Thanks a lot!
PFont font;
String [] lines;
int index = 0;
void setup() {
size(1000,100);
font = createFont("Menlo-Regular", 20);
String [] s = loadStrings("text.txt");
String everything = join(s, " ");
println(everything);
lines = splitTokens(everything,",.?!;:");
printArray(lines);
frameRate(2);
}
void draw() {
background(0);
textFont(font);
textSize(random(10,50));
text(lines[index], 10, 20);
index++;
saveFrame("output/line_####.png");
}