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