xxxxxxxxxx
51
let odin;
let fontSize;
let points = [];
let yPos = 1.7;
let ang = 0;
function preload() {
odin = loadFont("./odin.otf");
}
function setup() {
createCanvas(windowWidth, windowHeight);
textFont(odin);
fontSize = width / 3;
textSize(fontSize);
points = odin.textToPoints("Jump", width / 8, height / 1.7, fontSize, {
sampleFactor: 0.3,
simplifyThreshold: 0,
});
}
function draw() {
background(0);
points = odin.textToPoints("Jump", width / 8, height / yPos, fontSize, {
sampleFactor: 0.3,
simplifyThreshold: 0,
});
for (let p of points) {
noFill();
strokeWeight(random(0, 0.5));
stroke(160, 0, 180, 100);
line(p.x, p.y, 0, 0);
line(p.x, p.y, width, 0);
line(p.x, p.y, 0, height);
line(p.x, p.y, width, height);
stroke(0);
if (random() > 0.8) {
fill("hotpink");
}
rect(p.x, p.y, 10);
}
yPos = sin(ang)+2;
ang += 0.09;
}