原始碼:
int lineSize = 200;
int wide = 4;
int hei = 8;
int fontSize = 16;
int shadow_shift = 0;
void setup(){
size(800,800);
PFont font = createFont("Geogreia",fontSize);
textFont(font);
background(0);
translate(width/2,height/2);
for(int i = 1 ; i <= 5000; i+=5){
int rand = (int)random(2);
int num = (int)random(2);
int shift = (int)random(8) * (i/lineSize >=1 ? -1:1);
int x = i%lineSize+i/100*wide + shift;
int y = (i/lineSize)*hei+ shift;
float trans = 160+95*(shift/7);
fill(255,trans);
rotate((rand == 0? -shift:shift));
text(String.valueOf(num), x , y);
fill(255,trans*0.5);
text(String.valueOf(num), x+shadow_shift,y+shadow_shift);
rotate((rand != 0? -shift:shift));
textFont(font,fontSize+(rand == 0 ? -shift:shift));
}
}
沒有留言:
張貼留言