1+ import processing.core.*;
2+ import processing.data.*;
3+ import processing.event.*;
4+ import processing.opengl.*;
5+
6+ import java.util.HashMap;
7+ import java.util.ArrayList;
8+ import java.io.File;
9+ import java.io.BufferedReader;
10+ import java.io.PrintWriter;
11+ import java.io.InputStream;
12+ import java.io.OutputStream;
13+ import java.io.IOException;
14+
15+ public class staticannotations extends PApplet {
16+
17+ public void setup() {
18+
19+ class Button {
20+
21+ int x, y, radius;
22+
23+ public Button (int x, int y, int radius) {
24+ this.x = x;
25+ this.y = y;
26+ this.radius = radius;
27+ }
28+
29+ boolean over() {
30+ return dist(mouseX, mouseY, this.x, this.y) < this.radius;
31+ }
32+
33+ void draw() {
34+ ellipse(this.x, this.y, this.radius * 2, this.radius * 2);
35+ }
36+
37+ @Deprecated
38+ void old() {
39+ ellipse(this.x, this.y, this.radius, this.radius);
40+ }
41+
42+ }
43+
44+
45+ class ButtonOther extends Button {
46+
47+ @Override
48+ boolean over() {
49+ return dist(mouseX, mouseY, this.x, this.y) < this.radius / 2;
50+ }
51+
52+ }
53+
54+ noLoop();
55+ }
56+
57+ static public void main(String[] passedArgs) {
58+ String[] appletArgs = new String[] { "staticannotations" };
59+ if (passedArgs != null) {
60+ PApplet.main(concat(appletArgs, passedArgs));
61+ } else {
62+ PApplet.main(appletArgs);
63+ }
64+ }
65+ }
0 commit comments