2021年11月15日 星期一

Bunny

 

step1
size(600,600);
fill(235,0,0);
textSize(80);
text("Hello",50,50);


step2

void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  text("Hello",50,100);
}

step3

void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  background(255);//白
  text("Time:"+frameCount,50,100);
}//每秒60frame,過了幾個frame
step4
void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  background(255);//白
  text("Time:"+frameCount/60,50,100);//不準
  text("millis():"+millis()/1000,50,200);//準
}//每秒60frame,過了幾個frame
step5
void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  background(255);//白
  text(hour()+":"+minute()+":"+second(),50,100);
  text("millis():"+millis()/1000,50,200);
}//每秒60frame,過了幾個frame
step6
void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  background(255);//白
  text(hour()+":"+minute()+":"+second(),50,100);
  text("中文:"+millis()/1000,50,200);
}//每秒60frame,過了幾個frame
step7
PFont myFont;
void setup(){
  size(500,500);
  myFont=createFont("標楷體",100);
  textFont(myFont);
  text("中文",100,100);
}
step8
PFont font1,font2;
void setup(){
  size(500,500);
  font1=createFont("標楷體",100);
  textFont(font1);
  font2=createFont("微軟正黑體 Bold",100);
}
void draw(){
  background(0);
  text("中文",100,100);
  if(mousePressed) textFont(font2);
  else textFont(font1);

step9
void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  background(255);//白
  String hh=nf(hour(),2);
  String mm=nf(minute(),2);
  String ss=nf(second(),2);
  text(hh+":"+mm+":"+ss,50,100);
}
step10
void setup(){
  size(600,600);
  fill(235,0,0);
  textSize(80);
}
void draw(){
  background(#1A6FFF);//白
  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);
}





沒有留言:

張貼留言