|
Author |
Topic: Re: dynamic text generation (Read 866 times) |
|
mKoser
|
Re: dynamic text generation
« Reply #1 on: Nov 5th, 2003, 11:19am » |
|
just looked through your code... you don't have to load the font every time you wanna use it... i have put the varibale "display" in the beginning, and the loadFont-stuff in setup, so your computer doesn't have to do this ALL the time. Code: BImage screen; BFont display; float x; float y; int i; int j; float[] spectrum; int n; void setup(){ liveInput.start(); size(1000,700); background(255); noFill(); display = loadFont("Univers66.vlw.gz"); // noCursor(); x = 10; y = 100; i+=10; j+=10; } void loop(){ float dB = float(liveInput.getLevel()); //line(width-100,0, (width-100)-dB*100, height); /*float xCam = x; float yCam = y; float zCam = dB; float theX = screenX(xCam, yCam, zCam);*/ //sagt, dass der screen gespeichert + der hintergrund wieder schwarz werden soll if(x > width-200 & y > height-200){ //println("servus"); //setzt den zähler auf x,y x=10; y=100; clear(); } //umbruch if(x > width-100){ x=10; y=y+100; } textFont(display, dB*300); text("["+dB+"]",x,(y-150)+dB*random(300)); x+=20*(dB*5);//geschwindigkeit durch setzen der x-variablen /*translate(x+sin(dB)*20,y,dB*100);//positionsbestimmung box(dB*100,dB*200,dB*100);//groessensteuerung*/ stroke(255-dB*200); strokeWeight(0.1); fill(0,dB*150,dB*300,50-dB*50); smooth(); } public void stop(){ BJSyn.stop(); super.stop(); } |
| + mikkel ps - since this is not a bug thread anymore, FRY, can you move somewhere else?
|
« Last Edit: Nov 5th, 2003, 11:20am by mKoser » |
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
|