xxxxxxxxxx
22
//loads in font
let inconsolata;
function preload() {
inconsolata = loadFont('assets/inconsolata.otf');
}
// sets up canvas with font
function setup() {
createCanvas(100, 100, WEBGL);
textFont(inconsolata);
textSize(width / 3);
textAlign(CENTER, CENTER);
}
// writes text to the canvas and makes it spin
function draw() {
background(0);
let time = millis();
rotateX(time / 1000);
rotateZ(time / 1234);
text('p5.js', 0, 0);
}