xxxxxxxxxx
59
let font
function preload() {
font = loadFont('/EBGaramond-Regular.ttf');
britishText = loadStrings('god.txt');
}
function setup() {
createCanvas(710, 600, SVG);
//frameRate(2);
textFont(font);
textSize(20);
textAlign(CENTER, CENTER);
//background('#FCF8ED');
}
function draw() {
background('#FCF8ED');
let gap = 52;
let margin = 10;
translate(margin * 4, margin *4);
for(let y =0; y < 60; y+= 1){
var time = frameCount * 0.01;
var a = cos(4 * time + y * 0.5) * 1;
fill('#331E03');
//let firstphr = ['ruin made by', 'a prisoner of']
//let phrasefirst = random(firstphr);
//text(britishText[y], 150, 250 + 90 *a);
textAlign(LEFT);
let poem = 'he said: the sun was god, he painted the misty Thames as a river of fire, he dissolved the foundations of blood, blurred the earth and a little part of the universe';
let words = split(poem, (','));
if (keyCode === 84){
text(words[floor(random(0, 5))], random(0, 600), random(0, 600));
}
}
}
function mousePressed(){
save("mySVG.svg"); // give file name
print("saved svg");
}