Help needed with menu (noob)
in
Programming Questions
•
6 months ago
Hey all,
Im new to processing and im trying to write a program that will change menus when you click on the rectangle.
Here is the code I have now:
- void setup() {
- size(480,800);
- }
- void draw() {
- mainmen();
- }
- void mainmen() {
- background(255,255,255); //Set BG to white
- //Draw first button
- fill(255,255,255);
- stroke(0,0,0);
- rect(20,20,200,200);
- if(mouseX > 20 && mouseX < 220 && mouseY > 20 && mouseY < 220 && mouseClicked() == true) {
- fill(0,0,0);
- stroke(0,0,0);
- rect(20,20,200,200);
- fanmen();
- }
- }
The code goes on with a function for fanmen but thats the thing, fanmen only appears as long as the mouse is being pressed, How can I have it switch to the function completely, even when the mouse is released?
Thanks for the help,
Hamish
1