xxxxxxxxxx
59
let myString= "hello !ssalc ";
function setup() {
createCanvas(600, 600);
// fill(255,0,0);
textFont("Courier New",25)// font, size
let myChar = myString.charAt(4);
// print(myChar);
}
//(moving letters_)
// function draw() {
// background(255);
//first line
// push();
// textAlign(CENTER); // SO ITS not on bottom left
// text(myString, width/2, height*0.25); //3 parameters, what you want, what x, and what y, draws on bottom left
// pop();
// second line
// 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.50);
// third line
// let noiseValue= noise(frameCount * 0.01,i *.09); // framecount, and individualize each character
// let scaledNoise = (noiseValue - 0.5) * 100;
// text(myChar, x, height*0.75 + scaledNoise);
// }
// }
function draw() {
background(255);
let angle = PI;
let radius= 100;
push(); // don't need push and pop, but use when doing a translate
translate(width/2, height/2)
for (let i = 0 ; i < myString.length; i++) {
let myChar = myString.charAt(i);
let x= cos(angle) * radius ;
let y= sin(angle) * radius ;
text(myChar, x, y);
angle += TWO_PI/ myString.length;
}
pop();
}