xxxxxxxxxx
let allsets = [];
let index = 0;
PImage = maskPhoto;
â
function setup() {
createCanvas(windowWidth, windowHeight);
textAlign(CENTER, CENTER);
maskPhoto = loadImage("mask.png")
allsets = [set1, set2,concat(set1, set2)];
emojis = allsets[2];
drawCrowd();
}
â
function drawCrowd() {
background(0);
let y = 30;
let ys = 15;
while (y <= height) {
let x = 0;
while (x <= width + ys) {
push();
translate(x, y);
if (x > windowWidth/2){ // test cond prior to draw
textSize(ys * random(0.9, 1.1));
rotate(random(-PI / 12, PI / 12));
text(random(emojis), 0, 0);
}
x += ys;
pop();
}
ys *= 1.25;
y += ys * 0.65;
}
}
â
function mouseClicked() {
// index = (index + 1) % allsets.length;
// emojis = allsets[index];
emojis = allsets[2];
drawCrowd();
}