Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
How can I change the color and action of my button in JS (p5)?

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');
} 
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!