FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   conv datatype & text problem
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: conv datatype & text problem  (Read 276 times)
pinksalmon


conv datatype & text problem
« on: Jan 31st, 2003, 1:31pm »

I want to make a row of numbers from 0-9 displayed as text. I want to do this via a for-loop with int i from 0-9 and convert int i to char num and then display num as text.
But it's not displaying anything at all. But when I print num it is being print. Can anybody tell me what I'm doing wrong on this one...
 
Code:
 
void setup(){
size(200, 200);
background(0);
stroke(0);
fontA = loadFont("fonts/OCR-B.vlw.gz");
setFont(fontA, 12);
hint(SMOOTH_IMAGES);
}
 
BFont fontA;
int x = 30;
int y = 180;
 
void loop(){
for(int i=0 ; i<10 ; i++){
char num = char(i);
println(num);
fill(#FF0000);
text( num , 30 , y-i*5);
}
}
 
fry


WWW
Re: conv datatype & text problem
« Reply #1 on: Jan 31st, 2003, 2:53pm »

the problem is probably that it can't find your font.. move OCR-B.vlw.gz to the 'data' folder of your sketch, and then use loadFont("OCR-B.vlw.gz");
 
sorry the font support is so hokey at this time..
 
Pages: 1 

« Previous topic | Next topic »