Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (44 loc) · 1.23 KB

File metadata and controls

53 lines (44 loc) · 1.23 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import processing.core.PApplet;
import processing.core.PVector;
public class Rectangle extends PApplet {
PApplet app;
private static int DEFAULT_WIDTH = 10;
private static int DEFAULT_HEIGHT = 10;
static final int DEFAULT_COLOR = 200;
private int x, y;
private int width, height;
public PVector pos = new PVector();
public Rectangle(PApplet app, int x, int y) {
this.app = app;
this.x = x;
this.y = y;
this.width = DEFAULT_WIDTH;
this.height = DEFAULT_HEIGHT;
}
public Rectangle(PApplet app, int x, int y, int width, int height) {
this.app = app;
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public void draw() {
app.stroke(DEFAULT_COLOR);
app.fill(DEFAULT_COLOR);
app.rect(this.x, this.y, this.width, this.height);
}
public static void increaseSize() {
DEFAULT_HEIGHT++;
DEFAULT_WIDTH++;
}
public static void decreaseSize() {
DEFAULT_HEIGHT--;
DEFAULT_WIDTH--;
}
public static int getDefaultWidth() {
return DEFAULT_WIDTH;
}
public static int getDefaultHeight() {
return DEFAULT_HEIGHT;
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.