Monday, August 17, 2015

Lab1 - Battery

 //Battery 100%
void setup(){
    int posX=50;
    int posY=100;
    int stretch=100;
    size(300, 300);
    background(#000000);
  
    //Battery
    stroke(#FFFFFF);
    strokeWeight(4);
    fill(86, 93, 119);
    rect(posX, posY, stretch*2.2, stretch, 7);
    rect(posX-(stretch*0.1), posY+(stretch*0.3), stretch*0.1, stretch*0.4);
  
    //Status
    noStroke();
    fill(76, 218 ,100);
    //Status NUM1
    rect(posX+(stretch*1.72), posY+(stretch*0.05), stretch*0.35, stretch*0.9, 7);
    //Status NUM2
    rect(posX+(stretch*1.32), posY+(stretch*0.05), stretch*0.35, stretch*0.9, 7);
    //Status NUM3
    rect(posX+(stretch*0.92), posY+(stretch*0.05), stretch*0.35, stretch*0.9, 7);
    //Status NUM4
    rect(posX+(stretch*0.52), posY+(stretch*0.05), stretch*0.35, stretch*0.9, 7);
    //Status NUM5
    rect(posX+(stretch*0.12), posY+(stretch*0.05), stretch*0.35, stretch*0.9, 7);
  
    //TEXT
    fill(#FFFFFF);
    textSize((stretch*0.2));
    text("100% Charged",posX+(stretch*0.42),posY+(stretch*1.5));
}

No comments:

Post a Comment