Skip to content
Newer
Older
100644 62 lines (51 sloc) 1.26 KB
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 15, 2012
1 class Greetz extends Routine {
2 int FONT_SIZE = 16;
3 PFont font;
1fccc96 @potatono Shitty fire. Better greetz.
potatono authored May 19, 2012
4 PImage imgCopy;
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
5 String messages[] = new String[] {
1fccc96 @potatono Shitty fire. Better greetz.
potatono authored May 19, 2012
6 "N Y C R"//,
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
7 // "KOSTUME KULT",
8 // "BLACK LIGHT BALL"
9 // "COUNTRY CLUB"
10 };
1fccc96 @potatono Shitty fire. Better greetz.
potatono authored May 19, 2012
11 String message = "N Y C R";
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
12
15268ec @potatono New routines, Gamma.
potatono authored Jun 3, 2012
13 public Greetz() {
14 }
15
16 public Greetz(String[] messages) {
17 this.messages = messages;
18 this.message = messages[0];
19 }
20
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
21 void setup(PApplet parent) {
22 super.setup(parent);
23 font = loadFont("Disorient-" + FONT_SIZE + ".vlw");
24 textFont(font, FONT_SIZE);
25 textMode(MODEL);
26 }
27
28 void draw() {
29 background(0);
30 fill(255);
31
32 if (w == 0) {
15268ec @potatono New routines, Gamma.
potatono authored Jun 3, 2012
33 w = -int((message.length()-1) * (FONT_SIZE*1.25) + WIDTH);
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
34 }
35
36 fill(255,128,64);
1fccc96 @potatono Shitty fire. Better greetz.
potatono authored May 19, 2012
37 text(message, x, FONT_SIZE);
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
38
1fccc96 @potatono Shitty fire. Better greetz.
potatono authored May 19, 2012
39 if (height/2 > FONT_SIZE) {
40
41 image(get(0,0,width,FONT_SIZE),0,20,width,height/2);
42 fill(0);
43 rect(0,0,width,FONT_SIZE);
44 //copy(0,0,width,FONT_SIZE,0,FONT_SIZE,width,FONT_SIZE/2);
45 //imgCopy = copy(0,0,width,FONT_SIZE);
46 //image(imgCopy,0,0,width,height);
47 }
48
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
49 if (frameCount % 2 == 0) {
50 x = x - 1;
51 }
52
53 if (x<w) {
54 x = HEIGHT;
55 message = messages[int(random(messages.length))];
56 w = 0;
15268ec @potatono New routines, Gamma.
potatono authored Jun 3, 2012
57 println("Signalling newMode");
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored May 16, 2012
58 newMode();
59 }
60 }
61 }
Something went wrong with that request. Please try again.