-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinput.pde
More file actions
37 lines (31 loc) · 803 Bytes
/
Copy pathinput.pde
File metadata and controls
37 lines (31 loc) · 803 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
void mouseDragged() {
if (mouseButton == RIGHT) { updateCam(); return; }
};
void mousePressed() {
if (mouseButton == RIGHT) { setCamOffsets(); return; }
if (mouseButton == LEFT) { setInsertStart(); return; }
};
void mouseReleased() {
if (mouseButton == LEFT) { insertSquare(); return; }
}
void mouseWheel(MouseEvent event) {
float e = event.getCount();
if (e < 0) {
tox -= dzoom * (mouseX - tox);
toy -= dzoom * (mouseY - toy);
tozoom *= dzoom + 1;
} else {
tox += dzoom / (dzoom + 1) * (mouseX - tox);
toy += dzoom / (dzoom + 1) * (mouseY - toy);
tozoom /= dzoom + 1;
}
};
void inputLoop() {
/*
if (mousePressed) {
if (mouseButton == LEFT && frameCount % everyInsert == 0) {
insertSquare(screenToSpace(mouseX, mouseY), 20f);
}
}
*/
}