時計


void setup() {
size(200, 100);
textFont(createFont("x", 15)); // 日本語を表示用。バージョンアップで不要?
// frameRate(10); // 1秒間に10回 draw()実行
}
void draw() {
int h = hour();
int m = minute();
int s = second();

String time = "時刻:"+nf(h, 2)+":"+nf(m, 2)+":"+nf(s, 2);
// println(time);

textSize(14); // 文字サイズ
background(200); // 背景を指定色で塗りつぶす
fill(0, 0, 255); // 文字色 RGB
text(time, 10, height/2);
}

Leave a Reply

Your email address will not be published. Required fields are marked *