-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.pde
More file actions
41 lines (36 loc) · 910 Bytes
/
Copy pathButton.pde
File metadata and controls
41 lines (36 loc) · 910 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
abstract class Button {
float x;
float y;
float buttonWidth;
float buttonHeight;
String text;
color buttonColor;
Button(float _x, float _y) {
this.x = _x;
this.y = _y;
this.buttonWidth = 162;
this.buttonHeight = 100;
}
boolean isPushed() {
if((this.x <= mouseX&&mouseX <= this.x+buttonWidth)&&(this.y <= mouseY&&mouseY <= this.y+buttonHeight)) {
return true;
} else {
return false;
}
}
void display() {
fill(this.buttonColor);
rect(this.x, this.y, this.buttonWidth, this.buttonHeight);
fill(blue);
text(text, this.x, this.y);
}
}
abstract class GenerateButton extends Button {
GenerateButton(float _x, float _y) {
super(_x, _y);
}
void generate() {
Taiyaki tmp = new Taiyaki(random(width), random(height), taiyaki_filling_anko);
append(taiyakis, tmp);
}
}