Building Software Systems I & II
&
Computer Fundamentals
By Thakdanai Khunsaen
OS : Ubuntu GNOME 17.04 64-bit
วันอังคารที่ 1 กันยายน พ.ศ. 2558
Lab2-Digital Clock
void setup(){
size(500,200);
}
void draw(){
background(#DD0000);
digitalClock(width/2,height/2,50);
}
void digitalClock(int posX,int posY,int textsize){
int sec = second();
int min = minute();
int hr = hour();
int space = 150;
fill(255);
textSize(textsize);
textAlign(CENTER,CENTER);
text(hr+"hr",posX-space,posY);
text(min+"min ",posX,posY);
text(sec+"sec",posX+space,posY);
}
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น