xxxxxxxxxx
68
let points;
let font;
let t = 0; // Time variable
function preload() {
font = loadFont("MAROLA__.TTF");
}
function setup() {
createCanvas(windowWidth, windowHeight,WEBGL);
textFont(font);
textSize(70);
points = font.textToPoints('free', 0, 0, 100, {
sampleFactor: 1,
simplifyThreshold: 0
});
}
function draw() {
// background(0,0,20);
background(0);
push();
translate(width / 2, height / 2);
drawLetterShape(t);
t += 0.01; // Control animation speed
pop();
}
function drawLetterShape(t) {
push();
// fill(51, 51, 255, frameCount%200);
// fill(51, 51, 255 - frameCount % 200);
fill(51,0,255);
let x = 0;
let y = 0;
let n = points.length;
let scl = 2;
let steps = 2;
for (let i = 0; i < n; i += steps) {
let radius = i * 2;
let angle = t + i * 0.05;
x = radius * cos(angle);
y = radius * sin(angle);
push();
translate(x, y);
translate(-5,-5)
rotateY(20)
rotate(cos(frameCount/30)*2)
text('bloop', 0, 0,100); // Draw the word "free"
pop();
}
pop();
}
function keyPressed() {
if (key === 's' || key === 'S') {
saveCanvas('swim', 'png');
}
}