-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoading_URLs.cpp
More file actions
52 lines (40 loc) · 749 Bytes
/
Copy pathLoading_URLs.cpp
File metadata and controls
52 lines (40 loc) · 749 Bytes
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
48
49
50
51
52
/**
* Loading URLs.
*
* Click on the button to open a URL in a browser.
*/
bool overButton = false;
void setup() {
size(640, 360);
}
void draw() {
background(204);
if (overButton == true) {
fill(255);
} else {
noFill();
}
rect(105, 60, 75, 75);
line(135, 105, 155, 85);
line(140, 85, 155, 85);
line(155, 85, 155, 100);
}
void mousePressed() {
if (overButton) {
link("http://www.processing.org");
}
}
void mouseMoved() {
checkButtons();
}
void mouseDragged() {
checkButtons();
}
void checkButtons() {
if (mouseX > 105 && mouseX < 180 &&
mouseY > 60 && mouseY < 135) {
overButton = true;
} else {
overButton = false;
}
}