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 * 0.01 + i * 2) - 0.5);
let x = points[i].x;
let y = points[i].y + moveIt;
// dividing makes it invert it's action, sort of
let shapeshift = 2000 / dist(x, y, mouseX, mouseY);
shapeshift = constrain(shapeshift, 10, 70);
rect(x, y, shapeshift, shapeshift);
}
}