Permalink
Browse files

add wip

  • Loading branch information...
1 parent e6f400e commit 9fc3613c3c506908346c93215a8b58d4f0af6bc9 @neophob committed Feb 9, 2012
Showing with 49 additions and 0 deletions.
  1. +41 −0 processingApp/kalikut/Letter.pde
  2. +8 −0 processingApp/kalikut/kalikut.pde
View
41 processingApp/kalikut/Letter.pde
@@ -0,0 +1,41 @@
+
+public void initLetter() {
+ String letters = "KALIKUTn";
+ int totalWidth = 0;
+ //init array
+ letterWidth = new int[letters.length()];
+
+ //get width of each char
+ for (int i=0; i<letters.length(); i++) {
+ String s = ""+letters.charAt(i);
+ if (s.equals("n")) {
+ s = "now";
+ }
+
+ int w = int(textWidth(s));
+ println(s+" width: "+w);
+ letterWidth[i] = w;
+ totalWidth += w;
+ }
+
+ PGraphics pg;
+ pg=createGraphics(totalWidth, 200, JAVA2D);
+
+ pg.beginDraw();
+ pg.background(color(255,255,0));
+ pg.fill(color(0,0,255));
+ pg.text("KALIKUT now",50 ,20);
+ pg.textFont(fontA, 120);
+ pg.textSize(140);
+
+ pg.endDraw();
+ logoImg = pg;
+// logoImg = createImage(totalWidth, 200, RGB);
+// logoImg.text("KALIKUT now");
+}
+
+
+
+public void drawLetter() {
+ image(logoImg, 30, 120);
+}
View
8 processingApp/kalikut/kalikut.pde
@@ -47,6 +47,11 @@ private boolean initialized;
//OSC
private OscP5 oscP5;
+//output
+private int[] letterWidth;
+PImage logoImg;
+
+
void setup() {
size(800, 400);
background(0);
@@ -67,6 +72,7 @@ void setup() {
initAudio();
initGenerator();
//initSerial();
+ initLetter();
/* start oscP5, listening for incoming messages at port 12000 */
oscP5 = new OscP5(this, OSC_PORT);
@@ -87,9 +93,11 @@ void draw() {
//display some audio stuff
drawBeatStatus();
+ //drawLetter();
//show simulation
String wrote="";
int sw = 0;
+
for (int i=0; i<strKali.length(); i++) {
fill(colorArray[i]);

0 comments on commit 9fc3613

Please sign in to comment.