Week 4 Assignment: Generative Text Output

For this week’s assignment, I was not able to really come up with my very own original creative idea, so I had to search online for some  examples online that had to do with some Generative Text Output. Firstly, when I was fumbling through countless Youtube videos with examples, I stumbled on this video where it showed how by repeating a bunch of short sentences and making them appear at different places on the screen really quick could create this kind of blurry image on the screen, just like how when our TV screen would act weird and these white and black bars would flicker on and off.

After I created this blurry image on the screen, I wanted to make a Typewriter effect for my text where my text would appear one by one, but I wasn’t sure how to incorporate that effect to the entire text (maybe because I had to create an array to make this effect for each character of my text?). So, after this wasn’t working, I wanted to make another effect and I thought I could use the mousePressed function to make it freeze or stop creating this blurry image when the mouse is pressed and at the same time create another text, but that did not work as well. So, I settled for making it change color each time the mouse was pressed.

String text1="Hello, my name is Ryan.";
String text2="Hi, I've stopped.";
PFont font;
int counter;
float i, x, y;

void setup() {
  size(800, 600, P2D);
  frameRate(5);
  smooth();
  font=createFont("Georgia", 30);
  textFont(font, 20);
  fill(0);
  counter=0;
}

void draw() {    
  background(255);
  translate(mouseX, mouseY);
  //typewriteText()
  for (i=0; i < 1000; i++) {
    float x = random(width);
    float y = random(height);
    text(text1, x, y);

    if ( mousePressed) {
      noLoop();
      fill(random(255), random(255), random(255));
      for (int i = 0; i < random(1000); i++) {
        textFont(font, random(50));
        x = random(width);
        y = random(height);
        text(text2, x, y);
      }
    } else {
      loop();
      background(255);
      for (i=0; i < 1000; i++) {
        x = random(width);
        y = random(height);
        text(text1, x, y);
      }
    }
  }
}

 

One thought on “Week 4 Assignment: Generative Text Output”

  1. I think giving the words some transparency would look nice. Right now they just turn into a big solid block of color. Also, giving some thoughts to what colors your choosing to use would be good.

Leave a Reply