forked from mhenstell/acw
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Greetz.pde
56 lines (48 loc) · 1.27 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
class Greetz extends Routine {
int w;
int x;
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";
void setup(PApplet parent) {
super.setup(parent);
font = loadFont("Disorient-" + FONT_SIZE + ".vlw");
draw.textFont(font, FONT_SIZE);
draw.textMode(MODEL);
w=0;
x=0;
}
void draw() {
draw.background(0);
draw.fill(255);
if (w == 0) {
w = -int((message.length()-1) * (FONT_SIZE*1.35) + Config.WIDTH);
}
draw.fill(255,128,64);
draw.text(message, x, FONT_SIZE);
if (Config.HEIGHT/2 > FONT_SIZE) {
draw.image(draw.get(0,0,Config.WIDTH,FONT_SIZE),0,20,Config.WIDTH,Config.HEIGHT/2);
draw.fill(0);
draw.rect(0,0,Config.WIDTH,FONT_SIZE);
//copy(0,0,Config.WIDTH,FONT_SIZE,0,FONT_SIZE,Config.WIDTH,FONT_SIZE/2);
//imgCopy = copy(0,0,Config.WIDTH,FONT_SIZE);
//image(imgCopy,0,0,Config.WIDTH,Config.HEIGHT);
}
if (frameCount % 2 == 0) {
x = x - 1;
}
if (x<w) {
x = Config.HEIGHT;
message = messages[int(random(messages.length))];
w = 0;
newMode();
}
}
}