วันอังคารที่ 16 กรกฎาคม พ.ศ. 2556




int startx = 0;
int starty = 200;

void setup() {
  size(200, 200);
  background(255);
}
void draw() {
  if (keyPressed==true) {
    startx=0;
    starty=200;
  }
}
void mousePressed() {  
  if (mouseY<starty) {  
    if (mouseX>startx) {
      strokeWeight(3);
      stroke(255, 0, 0);
      line(startx, starty, mouseX, mouseY);
      startx=mouseX;
      starty=mouseY;
    }
  }
}



ไม่มีความคิดเห็น:

แสดงความคิดเห็น