I'm trying to not only change the color of my button, but also be able to call an onClick() function that links it to the next GUI. How do I do this? I'm using p5 as my IDE.
//Load the GUI
let img;
function preload() {
img = loadImage('assets/main_menu.PNG');
}
//Call the GUI
function setup() {
createCanvas(img.width, img.height);
img.resize(img.width, img.height)
image(img, 0, 0);
}
//Button 1
let button;
function draw() {
image(img, 0, 0);
button = createButton('Type Planet!');
button.position(100, 855);
button.size(200,50);
button.color('red');
}