xxxxxxxxxx
103
//music is not non-copyrighted,,, sorry
let points;
let bounds;
let font;
fr= 5;
function preload() {
font = loadFont("kaerukaeru.otf");
song = loadSound("GOAT.mp3");
}
function setup() {
createCanvas(windowWidth, windowHeight);
textFont(font);
const n = 'woahh';
const s = 200;
points = font.textToPoints(n, 0, 0, s, {
sampleFactor: 1,
simplifyThreshold: 0.0
});
bounds = font.textBounds(n, 0, 0, s);
console.log(bounds)
frameRate(fr);
song.play();
song.setVolume(0.3);
}
function draw() {
b = random(0,50);
background(b,b,b);
translate(width/2, height/2);
drawLetterShape();
}
function drawLetterShape() {
a = random(200,255);
d = random(1,90);
stroke(0,20);
push();
translate(-bounds.w/2, bounds.h/2);
let x = 0;
let y = 0;
let n = points.length;
let res = 2;
for (let i = 0; i < n; i += res) {
x = points[i].x + sin((frameCount + i) * 0.1) * 1;
y = points[i].y + tan((frameCount + i) * 0.2) * 30;
push();
translate(x, y);
fill(a,a+8,a+3);
rotate(d);
rect(-10, 0, 140, 1);
pop();
}
pop();
}