-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPolyTrace.pde
61 lines (49 loc) · 1.1 KB
/
PolyTrace.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
void setup(){
size(1000, 1000,P2D);
stroke(255);
ShapeManager.init(this);
FileChooser.init(this);
GUI.init(this);
Image.init(this);
ExportImport.init(this);
KeyboardControls.init(this);
Runtime r=Runtime.getRuntime();
}
void draw(){
background(192, 65, 0);
pushMatrix();
translate(width/2,height/2);
float zoom=ZoomControl.getZoom();
scale(zoom,zoom);
translate(Camera.getX(), Camera.getY());
Image.draw();
ShapeManager.draw();
popMatrix();
GUI.draw();
}
void mouseDragged() {
int cx=Camera.getX();
int cy=Camera.getY();
boolean handled=ShapeManager.mouseDragged(mouseX-width/2,mouseY-height/2,pmouseX-width/2,pmouseY-height/2);
if (!handled) {
Camera.mouseDragged(mouseX,mouseY,pmouseX,pmouseY);
}
}
void mouseReleased() {
if (Camera.isDragging()) {
Camera.mouseReleased();
return;
}
if (GUI.clicked(mouseX,mouseY)) {
return;
}
ShapeManager.mouseReleased(mouseX-width/2,mouseY-height/2,pmouseX-width/2,pmouseY-height/2);
}
void keyPressed(){
KeyboardControls.keyPressed(keyCode);
}
void keyReleased(){
KeyboardControls.keyReleased(keyCode);
}
void mousePressed(){
}