void setup()
{
size(600,400);
background(255,255,255);
fill(255,0,0);
rect(0,0,50,50);
fill(0,0,0);
rect(0,50,50,50);
fill(190,80,30);
rect(0,100,50,50);
fill(200,177,120);
rect(0,150,50,50);
fill(240,217,160);
rect(0,200,50,50);
fill(255,255,255);
rect(550,0,50,50);
fill(255,255,255);
ellipse(575, 25, 2,2);
fill(255,255,255);
rect(550,50,50,50);
ellipse(575, 75, 6, 6);
rect(550,100,50,50);
ellipse(575, 125, 10,10);
rect(0,250,50,50);
rect(550,150,50,50);
ellipse(575, 175, 20,20);
rect(0,250,50,50);
stroke(255,0,0);
strokeWeight(1);
}
void draw()
{
if(mouseX>550 && mouseX<600 && mouseY>0 && mouseY<50 && mousePressed)
{
strokeWeight(3);
}
else if(mouseX>550 && mouseX<600 && mouseY>50 && mouseY<100 && mousePressed)
{
strokeWeight(6);
}
else if(mouseX>550 && mouseX<600 && mouseY>100 && mouseY<150 && mousePressed)
{
strokeWeight(10);
}
else if(mouseX>550 && mouseX<600 && mouseY>150 && mouseY<200 && mousePressed)
{
strokeWeight(20);
}
else if(mouseX < 50 && mouseY<50 && mousePressed)
{
stroke(255,0,0);
}
else if(mouseX < 50 && mouseY<100 && mousePressed)
{
stroke(0,0,0);
}
else if(mouseX < 50 && mouseY<150 && mousePressed)
{
stroke(190,80,30);
}
else if(mouseX < 50 && mouseY<200 && mousePressed)
{
stroke(200,177,120);
}
else if(mouseX < 50 && mouseY<250 && mousePressed)
{
stroke(240,217,160);
}
else if(mouseX < 50 && mouseY<300 && mousePressed)
{
stroke(255,255,255);
}
else if(mousePressed)
{
line(mouseX,mouseY,pmouseX,pmouseY);
}
}
processing真的可以做好多事情 令人十分吃驚。小畫家耶,都能做了,還有啥事不能做的??
100
回覆刪除