-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu_and_Hover_Boolean.pde
48 lines (40 loc) · 1011 Bytes
/
Menu_and_Hover_Boolean.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// interactive interface, highlight effects
// menu function, draws menu
void menu() {
fill (255);
isHovering(bx, by);
rect (bx, by, rectSizex, rectSizey, r);
fill(178, 102, 255);
textFont(f);
text(fields[0], bx, by, rectSizex, rectSizey);
fill (255);
isHovering(bx, by+165);
rect (bx, by+165, rectSizex, rectSizey, r);
fill(178, 102, 255);
textFont(f);
text(fields[1], bx, by+165, rectSizex, rectSizey);
fill (255);
isHovering(bx, by+165*2);
rect (bx, by+165*2, rectSizex, rectSizey, r);
fill(178, 102, 255);
textFont(f);
text(fields[2], bx, by+165*2, rectSizex, rectSizey);
calculateButton();
}
// menu effect
boolean isHovering(int hx, int hy) {
if (mouseX > hx-rectSizex && mouseX < hx+rectSizex &&
mouseY > hy-rectSizey && mouseY < hy+rectSizey) {
overBox = true;
if (!locked) {
strokeWeight(2);
stroke(0, 255, 128);
fill(255);
}
} else {
stroke(255);
fill(255);
overBox = false;
}
return overBox;
}