xxxxxxxxxx
67
var letters = [ "T", "H", "E"];
var rows = 3;
var columns = 3;
var randomColor;
var randomText;
//variables for steps
var stepX;
var stepY;
function setup() {
createCanvas(600, 600);
background(255);
rectMode(CORNER);
//noStroke();
stepX = width / columns;
stepY = height / rows;
//noLoop();
}
function draw() {
textSize(150);
//for loop to iterate columns
for (var i = 0; i < columns; i++) {
//for loop to iterate rows
for (var j = 0; j < rows; j++) {
//Text
//rows
//fill(0);
// horizontal displacement only
textAlign(CENTER, CENTER);
text(letters[0], random(3) * stepX, stepY - 100 );
//text(letters[1], random(3) * stepX, stepY + 120);
text(letters[1], random(3) * stepX, random(3) * stepY );
text(letters[2], random(3) * stepX, stepY + 300);
//Grid
//noStroke();
noFill();
rect(i * stepX, j * stepY, stepX, stepY);
}
}
}