-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathButton.pde
103 lines (94 loc) · 2.03 KB
/
Button.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
class Button{
int w;
int h;
int x;
int y;
PFont fontType;
int showState;
boolean noticeMe;
String word;
void show(){
pushStyle();
colorMode(RGB, 255,255,255);
textAlign(CENTER, CENTER);
if(showState == ENABLED){
fill(#F7CF2A);
}else if(showState == UNCLICKABLE){
fill(150);
}else if(mouseCheck(x,y,w,h)){
fill(0,255,0);
}else{
if(noticeMe){
colorMode(HSB, 360, 100, 100);
fill(frameCount*8%360,30,100);
}else{
fill(255);
}
}
//strokeWeight(5);
//stroke(0);
noStroke();
rect(x,y,w,h);
fill(0);
noStroke();
textFont(fontType);
text(word,x+w/2,y+h/2);
popStyle();
}
Button(int x, int y, int w, int h, String word){
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.word = word;
this.fontType = font[2];
showState = 0;
}
Button(int x, int y, int w, int h, String word, PFont font){
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.word = word;
this.fontType = font;
showState = 0;
}
Button(int x, int y, int w, int h, String word, PFont font, int clickstate){
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.word = word;
this.fontType = font;
showState = clickstate;
}
Button(int x, int y, int w, int h, String word, int clickstate){
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.word = word;
this.fontType = font[2];
showState = clickstate;
}
Button(int x, int y, int w, int h, String word, int clickstate, boolean notice){
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.word = word;
this.fontType = font[2];
noticeMe = notice;
showState = clickstate;
}
Button(int x, int y, int w, int h, String word, PFont font, int clickstate, boolean notice){
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.word = word;
this.fontType = font;
noticeMe = notice;
showState = clickstate;
}
}