xxxxxxxxxx
30
let sentence = "FORKED FROM XIN XIN ";
let sentenceArray = [];
let r = 100;
function setup() {
createCanvas(400, 400);
textAlign(CENTER);
textSize(18);
fill(255);
sentenceArray = sentence.split(""); // splits a string into an array of chars
print(sentenceArray);
}
function draw() {
background(20, 185, 222);
translate(width / 2, height / 2);
for (let i = 0; i < sentenceArray.length; i++) {
let theta = ((2 * PI) / sentenceArray.length) * i - PI / 2;
let x = r * cos(theta);
let y = r * sin(theta);
push();
translate(x, y);
text(sentenceArray[i], 0, 0);
pop();
}
}