sending arguments with buttons

Hi all, first post!

I'm using Buttons from the p5.dom library, but have run into a problem - how do I send arguments with my button presses?

At the moment I have

myButton.mouseClicked(doStuff);

so, pressing myButton calls the doStuff function.

How do I send an argument/parameter to doStuff function? I want to do something like:

myButton.mouseClicked(doStuff(foo))

Thanks in advance :)

** edit **

i'm trying real hard to not use global variables

** edit 2 **

i've put doStuff() inside setup(), so now have access to setup's variables - but is there a better way

Answers

Sign In or Register to comment.