Skip to content

Commit

Permalink
add wip
Browse files Browse the repository at this point in the history
  • Loading branch information
neophob committed Feb 9, 2012
1 parent e6f400e commit 9fc3613
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
41 changes: 41 additions & 0 deletions 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);
}
8 changes: 8 additions & 0 deletions processingApp/kalikut/kalikut.pde
Expand Up @@ -47,6 +47,11 @@ private boolean initialized;
//OSC
private OscP5 oscP5;

//output
private int[] letterWidth;
PImage logoImg;


void setup() {
size(800, 400);
background(0);
Expand All @@ -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);
Expand All @@ -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]);
Expand Down

0 comments on commit 9fc3613

Please sign in to comment.