วันอาทิตย์ที่ 30 สิงหาคม พ.ศ. 2558

Lab 2 : My Clock

void setup(){
  size(500,300);

}

void draw(){
  draw_clock(100,100);
}

void draw_clock(int posX,int posY){
background(0);

  int s=second();
  int m=minute();
  int h=hour();
  int d=day();
  int mo=month();
  int y=year();

fill(255);
textSize(50);
text(nf(h,2)+" : "+nf(m,2)+" : "+nf(s,2),posX,posY+80);

fill(#FF0000);
textSize(30);
text(nf(d,2)+" / "+nf(mo,2)+" / "+y,posX+30,posY);

}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น