I'm not sure how to get input (maybe take every keypress and put it in an array?) but maybe I can help you with the string part, once you already have strings.
I ran the sketch, and instantly ran into an error: you need to import a font.
First go to Tools > Create Font...
Select the font and size... I selected "Arial Black" with the font size 12.
Here's the version with the font implemented (have you even been testing this code?):
PFont font;
float amount = 2;
void setup(){
noLoop();
size(500,500);
background(255);
////draws 2 lines each second///
frameRate(30);
font = loadFont("Arial-Black-12.vlw");
}
void draw(){
////Have black text
fill(0);
////This is where the fun is, This randomly selects only special charactars
////and sets the charecters to the cariable "letter"
////Finally it prints the character to the concol
////Set varibales with a random number and rounds it to the nearest full number
float siz = round(random(height)-10);
float siz2 = round(random(height)-10);
int siz3 = round(random(15));
////This deals with the visuals
////
for (int i=10; i<siz; i=i+siz3){
for( int k=0; k<=amount; k++){
char letter = char(round(random(32, 255)));
text(letter, i, siz2 );
}
}
if (keyPressed==true && key=='s' || key=='S'){
saveFrame("img_####.jpg");
}
}
When I ran the sketch, I noticed that all the text is horizontal rows of the exact same letter.
We have to rotate the text each time. There is no way to rotate the text itself... so here's the next best thing.
PFont font;
float amount = 2;
void setup(){
//noLoop();
size(500,500);
background(255);
frameRate(2) //30 FPS is too fast, and may slow down your computer... it did mine.
font = loadFont("Arial-Black-12.vlw");
}
void draw(){
////Have black text
fill(0);
////Set varibales with a random number and rounds it to the nearest full number
float siz = round(random(height)-10);
float siz2 = round(random(height)-10);
int siz3 = round(random(15));
////This deals with the visuals
////
float toRotate = round(random(-3, 4)); //a random number from -3 to 3.
toRotate *= 90; //the amount to rotate by, in degrees...
toRotate = radians(toRotate); //convert to radians, the unit that rotate() uses
pushMatrix(); //popMatrix() will put the grid to its original state
float randomX = random(width);
float randomY = random(height);
translate(randomX, randomY); //Anything drawn after this and before popMatrix will be offset by a //random amount
rotate(toRotate); //Anything drawn after this and before popMatrix will be rotated a random amount
for (int i=10; i<siz; i=i+siz3){
for( int k=0; k<=amount; k++){
char letter = char(round(random(32, 255)));
- //The random letter is created within the loop, so you get a different letter every time.
text(letter, i, siz2 );
}
}
popMatrix(); //Resets stuff, leaving the text how it was.
if (keyPressed==true && key=='s' || key=='S'){
saveFrame("img_####.jpg");
}
}
Okay, now in response to your question:
This will use the string in the variable userText to write a value to the screen.
PFont font;
float amount = 2;
String userText;
void setup(){
//noLoop();
size(500,500);
background(255);
////draws 2 lines each second///
frameRate(2);
font = loadFont("Arial-Black-12.vlw");
userText = "Cheese, cheese CHEESE"; //change this
}
void draw(){
////Have black text
fill(0);
////Set varibales with a random number and rounds it to the nearest full number
float siz = round(random(height)-10);
float siz2 = round(random(height)-10);
int siz3 = round(random(15));
////This deals with the visuals
////
float toRotate = round(random(-3, 4)); //a random number from -3 to 3.
toRotate *= 90;
toRotate = radians(toRotate);
pushMatrix();
float randomX = random(width);
float randomY = random(height);
translate(randomX, randomY);
rotate(toRotate);
for (int i=10; i<siz; i=i+siz3){
for( int k=0; k<=amount; k++){
char letter = char(round(random(32, 255)));
text(letter, i, siz2 );
}
}
siz = round(random(height)-10);
siz2 = round(random(height)-10);
siz3 = round(random(15));
//redefines the variables, so the text doesn't overlap the random stuff exactly
for (int i=0; i<userText.length(); i++) { //A similar process to the random text
for (int k=0; k<=amount; k++) {
char letter = userText.charAt(i);
text(letter, i * siz3, siz2);
}
}
popMatrix();
if (keyPressed==true && key=='s' || key=='S'){
saveFrame("img_####.jpg");
}
}
Whew! You know I'm bored when I spend three hours on someone's forum question.