xxxxxxxxxx
43
let font;
let cols; let rows; let size = 10; let offset = 2/5*size;
let arrows = [];
let img;
let points = [];
function preload() {
font = loadFont("fonts/Roboto-Black.ttf");
}
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
cols = width/size;
rows = height/size;
points = font.textToPoints("T", 80, 350, 400);
for (let i=0; i<cols; i++) {
arrows[i] = [];
for (let j=0; j<rows; j++) {
arrows[i][j] = new Arrow(size/2 + i*size, size/2 + j*size, i*size + j*size, size-offset);
}
}
}
function draw() {
background(0);
for (let i=0; i<cols; i++) {
for (let j=0; j<rows; j++) {
arrows[i][j].move();
arrows[i][j].display();
}
}
for (let i=0; i<points.length; i++) {
ellipse(points[i].x, points[i].y, 10, 10);
print(points[i].x, points[i].y);
}
}