Text with charAt and nested iteration
in
Programming Questions
•
1 year ago
I want to create a text where all letters are touching, like a net, the letterSize should increase from top to bottom 4point per line
this is how far I got, can you help?
It is probably simply "not understanding Java" that is in my way
PFont font;
String atext ="aaaahhh";
void setup(){
size(1000, 1000);
font = loadFont ("Arial.vlw");
textFont(font);
fill(0);
}
void draw(){
background(255);
for (int counter=0; counter < atext.length(); counter++){
for (int fontSize = 10; fontSize< 100; fontSize = fontSize + 4){
x= x+ textWidth(atext);
y= y+ fontSize;
text(atext.charAt(counter),x,y );
if (counter > atext.length()-1) counter = 0;
}
}
}
Thank you!!
this is how far I got, can you help?
It is probably simply "not understanding Java" that is in my way
PFont font;
String atext ="aaaahhh";
void setup(){
size(1000, 1000);
font = loadFont ("Arial.vlw");
textFont(font);
fill(0);
}
void draw(){
background(255);
for (int counter=0; counter < atext.length(); counter++){
for (int fontSize = 10; fontSize< 100; fontSize = fontSize + 4){
x= x+ textWidth(atext);
y= y+ fontSize;
text(atext.charAt(counter),x,y );
if (counter > atext.length()-1) counter = 0;
}
}
}
Thank you!!
1