2021年11月15日 星期一

week 06 時間滴答滴答的走

 

(日常 慵懶的天 果然還是在家最舒服:))雙下巴)


好~開始我們的今日份processing吧


void setup(){
    size(600,600);///視窗大小
    fill(255,0,0);///字顏色
    textSize(80);///字大小
}
void draw(){
    text("Hello",50,100);///在畫布中寫出來的字
}

計時開始~~~



void setup(){
    size(600,600);
    fill(255,0,0);
    textSize(80);
}
void draw(){
    background(255);
    text("Time:"+frameCount,50,100);
}

完成碼表




void setup(){
    size(600,600);
    fill(255,0,0);
    textSize(80);
}
void draw(){
    background(255);
    text("Time:"+frameCount/60,50,100);///
    text("millis()"+millis()/1000,50,200);///毫秒
}




void setup(){
    size(600,600);
    fill(255,0,0);
    textSize(80);
}
void draw(){
    background(255);
    text(hour()+":"+minute()+":"+second(),50,100);
    text("millis()"+millis()/1000,50,200);
}


計算剩餘的時間

void setup(){
  size(500,500);
  fill(255);//填充顏色
  textSize(80);//文字大小
}
void draw(){
  background(#075BB2);
  String hh=nf(hour(),2);
  String mm=nf(minute(),2);
  String ss=nf(second(),2);
  text(hh+":"+mm+":"+ss,50,100);
  text("15:40:00",50,200);
  
  int now=hour()*60*60+minute()*60+second();
  int next=15*60*60+40*60+0;
  int remain=next-now;
  text(remain,50,300);
}


沒有留言:

張貼留言