void setup(){
int space=75
size(500,500);
background(0,0,0);
strokeWeight(5);
stroke(255,255,255);
rect(150,80,200,380);//ตัวแบตเตอร์รีี่
rect(190,20,40,60);//ขั้วแบต
rect(270,20,40,60);//ขั้วแบต
fill(0,255,0);
rect(152,85,195,70);//ขีดแบตก่อนที่1
rect(152,85+space,195,70);//ขีดแบตก่อนที่2
rect(152,85+space*2,195,70);//ขีดแบตก่อนที่3
rect(152,85+space*3,195,70);//ขีดแบตก่อนที่4
rect(152,85+space*4,195,70);//ขีดแบตก่อนที่5
fill(255,255,255);
textSize(20);
text("Battery",225,485);//word " Battery "
fill(255,0,0);
textSize(30);
text("100%",270,130);// 100 %
fill(255,0,0);
textSize(30);
text("80%",285,130+space);// 80%
fill(255,0,0);
textSize(30);
text("40%",285,130+space*2);//40 %
fill(255,0,0);
textSize(30);
text("20%",285,130+space*3);//20 %
fill(255,0,0);
textSize(30);
text("0%",285,130+space*4);// 0 %
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น