Generative Text

For this assignment, I wanted to explore more of generative text. After 3 different project ideas, I worked with a mirror image that displays motivational words in random order.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
var adjectives = [
"INDEPENDENT",
"HUMBLE",
"HAPPY",
"AMBITIOUS",
"DETERMINED",
"DILIGENT",
"RESILIENT",
"CREATIVE",
"PROGRESSIVE",
"INNOVATIVE",
"HARDWORKING",
"SUCCESSFUL",
];
function preload() {
photo = loadImage("mirror.jpg");
}
function setup() {
createCanvas(360, 480);
frameRate(1);
}
function draw() {
background(220);
image(photo, 0, 0);
textFont("Magnolia", 18);
fill("black");
text("I AM", 165, 100);
textFont("Magnolia", 14);
fill("white");
text(random(adjectives), 140, 340);
}
var adjectives = [ "INDEPENDENT", "HUMBLE", "HAPPY", "AMBITIOUS", "DETERMINED", "DILIGENT", "RESILIENT", "CREATIVE", "PROGRESSIVE", "INNOVATIVE", "HARDWORKING", "SUCCESSFUL", ]; function preload() { photo = loadImage("mirror.jpg"); } function setup() { createCanvas(360, 480); frameRate(1); } function draw() { background(220); image(photo, 0, 0); textFont("Magnolia", 18); fill("black"); text("I AM", 165, 100); textFont("Magnolia", 14); fill("white"); text(random(adjectives), 140, 340); }
var adjectives = [
  "INDEPENDENT",
  "HUMBLE",
  "HAPPY",
  "AMBITIOUS",
  "DETERMINED",
  "DILIGENT",
  "RESILIENT",
  "CREATIVE",
  "PROGRESSIVE",
  "INNOVATIVE",
  "HARDWORKING",
  "SUCCESSFUL",
];

function preload() {
  photo = loadImage("mirror.jpg");
}

function setup() {
  createCanvas(360, 480);
  frameRate(1);
}

function draw() {
  background(220);
  image(photo, 0, 0);
  textFont("Magnolia", 18);
  fill("black");
  text("I AM", 165, 100);
  textFont("Magnolia", 14);
  fill("white");
  text(random(adjectives), 140, 340);
}

Reflection: it was relatively simple working with generative text. For future improvements, I would love to experiment generative art with text.

Leave a Reply