-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptGridImage.pde
More file actions
45 lines (39 loc) · 840 Bytes
/
ScriptGridImage.pde
File metadata and controls
45 lines (39 loc) · 840 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
42
43
44
45
import processing.svg.*;
boolean bSave = false;
SimpleGrid simpleGrid = new SimpleGrid();
GridWithText gridWithText = new GridWithText();
GridWithColor gridWithColor = new GridWithColor();
CustomGrid customGrid = new CustomGrid();
PFont font;
// The font must be located in the sketch's
// "data" directory to load successfully
void setup(){
size(1024, 1024);
font = createFont("SansSerif", 32);
textFont(font);
}
void draw(){
if(bSave){
println("begin save");
beginRecord(SVG, "grid.svg");
}
//simpleGrid.draw(8, 8);
//gridWithText.draw(8, 8);
//gridWithColor.draw(8, 8);
customGrid.draw(8, 8);
if(bSave){
endRecord();
println("end save");
bSave = false;
exit();
}
}
void keyPressed(){
switch(key){
case 's':
bSave = true;
break;
default:
break;
}
}