Created
December 19, 2019 12:58
-
-
Save midorikocak/fd13b011f7715c88e27ef4c7b74ac0be to your computer and use it in GitHub Desktop.
Processing Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String words[]; | |
void setup() { | |
words = loadStrings("speech.txt"); | |
size(640, 360); | |
background(255); | |
fill(0); | |
background(255); | |
float indent = 0; | |
float offset = 0; | |
for (int i = 0; i < words.length; i++) { | |
indent += i == 0 ? 0 : textWidth(words[i-1]); | |
indent = indent > 640 ? 0 : indent; | |
if(indent>640){ | |
indent = 0; | |
offset += 16; | |
} | |
else{ | |
offset += 16; | |
} | |
println(indent); | |
textSize(16); | |
text(words[i], indent, offset ); | |
} | |
} | |
void draw() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment