-
Notifications
You must be signed in to change notification settings - Fork 10
/
Greetz.pde
61 lines (51 loc) · 1.26 KB
/
Greetz.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
class Greetz extends Routine {
int FONT_SIZE = 16;
PFont font;
PImage imgCopy;
String messages[] = new String[] {
"N Y C R"//,
// "KOSTUME KULT",
// "BLACK LIGHT BALL"
// "COUNTRY CLUB"
};
String message = "N Y C R";
public Greetz() {
}
public Greetz(String[] messages) {
this.messages = messages;
this.message = messages[0];
}
void setup(PApplet parent) {
super.setup(parent);
font = loadFont("Disorient-" + FONT_SIZE + ".vlw");
textFont(font, FONT_SIZE);
textMode(MODEL);
}
void draw() {
background(0);
fill(255);
if (w == 0) {
w = -int((message.length()-1) * (FONT_SIZE*1.25) + WIDTH);
}
fill(255,128,64);
text(message, x, FONT_SIZE);
if (height/2 > FONT_SIZE) {
image(get(0,0,width,FONT_SIZE),0,20,width,height/2);
fill(0);
rect(0,0,width,FONT_SIZE);
//copy(0,0,width,FONT_SIZE,0,FONT_SIZE,width,FONT_SIZE/2);
//imgCopy = copy(0,0,width,FONT_SIZE);
//image(imgCopy,0,0,width,height);
}
if (frameCount % 2 == 0) {
x = x - 1;
}
if (x<w) {
x = HEIGHT;
message = messages[int(random(messages.length))];
w = 0;
println("Signalling newMode");
newMode();
}
}
}