xxxxxxxxxx
36
let myString = "hello class!";
function setup() {
createCanvas(600, 600);
textFont("Courier New", 25);
}
function draw() {
background(255);
textAlign(CENTER);
text(myString, width/2, height*0.25);
for (let i=0; i<myString.length; i++){
// push();
let myChar = myString.charAt(i);
let startX = width/2 - textWidth(myString)/2;
let x = startX + textWidth(myChar)*i;
let noiseValue = noise(frameCount * 0.01, i * 0.1);
let scaledNoise = (noiseValue - 0.5) * 100;
text(myChar, x, height*0.5 + scaledNoise/2);
// let angle = noiseValue * TWO_PI;
// translate(i,x);
text(myChar, x, height*0.75+ scaledNoise + i);
// rotate(angle);
// pop();
}
}