xxxxxxxxxx
46
let inconsolata;
let points;
function preload() {
inconsolata = loadFont("Inconsolata-Regular.ttf");
}
function setup() {
createCanvas(540, 540);
background(200);
// use this for testing placement
// textFont(inconsolata);
// textSize(300);
// text("1.0", 300, height - 160);
points = inconsolata.textToPoints('1.0', 25, height-165, 300, {
sampleFactor: 5,
simplifyThreshold: 0
});
// TODO this should be p5 pink but with alpha
// background(237,34,92, 100);
let from = color(255, 255, 255,100);
let to = color(237,34,92,150);
for (let i = 0; i < height; i +=1) {
let inter = lerpColor(from, to, i/height);
stroke(inter);
line(0, i, width, i);
}
// 🎉🎊🥳💖🌈✨
const emojis = ["🎉", "🎊", "🥳", "💖", "🌈"];
for (let i = 0; i < points.length; i += 1) {
const emoji = emojis[floor(random(0, emojis.length))];
textSize(random(10, 24))
text(emoji, points[i].x, points[i].y);
}
noLoop();
}
function draw() {
// text("🎉", width/2, height/2);
}