此程序打印文本。此字体大小增加5至250。当字体大小为250时,此字体大小减少250至5。然后,当字体大小为5时,此字体大小增加5至250。字体大小因5而异。下面的代码是我做的。但是,提高字母后我无法减小它们的大小。
PFont myFont;
int ts= 5;
int ts2 = 250;
float x, y;
void setup() {
size(500, 500);
x = width/2;
y = height/2;
myFont = loadFont("휴먼가는샘체-48.vlw");
textFont(myFont);
fill(255);
}
void draw() {
background(180);
textSize(ts);
textAlign(CENTER);
text("이재용", x, y);
ts+=5;
delay(100);
}
PFont myFont;
int ts= 5;
int step = 5;
int ts2 = 250;
float x, y;
void setup() {
size(500, 500);
x = width/2;
y = height/2;
myFont = createFont("Georgia", 32);
textFont(myFont);
fill(255);
}
void draw() {
background(180);
textSize(ts);
textAlign(CENTER);
text("gf", x, y);
if(ts>=250){
step = -5;
}else if(ts<=5){
step = 5;
}
ts+=step;
delay(100);
}