forked from hackrockcity/domeTransmitter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
VerticalGreetz.pde
executable file
·58 lines (48 loc) · 1.17 KB
/
VerticalGreetz.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
class VerticalGreetz extends Routine {
int FONT_SIZE = 16;
PFont font;
String messages[] = new String[] {
"DISORIENT"//,
// "KOSTUME KULT",
// "BLACK LIGHT BALL"
// "COUNTRY CLUB"
};
String message = "DISORIENT";
PGraphics buffer;
int bufferWidth;
int bufferHeight;
int w;
void setup(PApplet parent) {
super.setup(parent);
w = bufferWidth = displayHeight;
bufferHeight = displayWidth;
buffer = createGraphics(bufferWidth, bufferHeight, JAVA2D);
font = loadFont("Disorient-" + FONT_SIZE + ".vlw");
buffer.textFont(font, FONT_SIZE);
buffer.textMode(MODEL);
}
void draw() {
buffer.beginDraw();
buffer.background(0);
if (w == 0) {
w = -int((message.length()-1) * (FONT_SIZE*1.35) + displayWidth);
}
buffer.fill(255, 128, 64);
buffer.text(message, x, FONT_SIZE+5);
buffer.endDraw();
pushMatrix();
rotate(-HALF_PI);
translate(0, -displayWidth);
image(buffer, 0, 0);
popMatrix();
if (frameCount % 2 == 0) {
x = x - 1;
}
if (x<w) {
x = bufferWidth;
message = messages[int(random(messages.length))];
w = 0;
newMode();
}
}
}