I am not sure how I can do this. I have tried all the style() properties that I know, but none of them are able to change the font on a button. Example code I am trying to write:
let drawButton;
let circle = false;
function setup() {
txt = loadFont('assets/font.ttf');
createCanvas(800, 800);
drawButton = createButton('Draw');
drawButton.position(230, 650);
drawButton.size(350, 100);
drawButton.mousePressed(yes);
drawButton.style('background-color', 'black');
drawButton.style('font-size', '44px');
drawButton.style('color', 'white');
//this code doesn't work the way I want it to
drawButton.style('font-type', txt);
}
function yes() {
circle = true
}
function draw() {
background(220);
if (circle === true) {
ellipse(400, 400, 100, 100);
}
}