xxxxxxxxxx
37
let font;
let points;
let string = "SHAMA";
function preload(){
font = loadFont("AvenirNextLTPro-Demi.otf");
}
function setup() {
createCanvas(600, 400);
background(0);
points = font.textToPoints('S H A M A', 60, 220, 100)
}
function draw() {
background(0);
for (let i =0; i<points.length; i++){
fill(random(256),random(256),random(256));
let moveIt = (noise(frameCount * (30 + cos(i) * 0.2)));
let x = points[i].x;
let y = points[i].y + moveIt;
// dividing makes it invert it's action, sort of
let shapeshift = 3000 / dist(x, y, mouseX, mouseY);
shapeshift = constrain(shapeshift, 8, 60);
rect(x, y, shapeshift, shapeshift);
}
}