Week01-1
size(500,500);
background(255,255,0);
void setup(){
size(500,500); //大小
}
void draw(){
if(mousePressed) background(255,0,0); //紅色
else background(0,255,0); //綠色
}
#按滑鼠變紅色Week01-2void setup(){ size(500,500); //大小
}
void draw(){
if(mousePressed) line(mouseX,mouseY,pmouseX,pmouseY);
}快速鍵Ctrl-C,Ctrl-V 複製,貼上Ctrl-Z 還原Ctrl-T 自動排版Ctrl-N 新文件Ctrl-S 存檔Savevoid keyPressed(){ if(key=='1') strokeWeight(1); if(key=='2') strokeWeight(5); if(key=='3') strokeWeight(10);
}
void keyPressed(){ if(key=='1') strokeWeight(1); if(key=='2') strokeWeight(5); if(key=='3') strokeWeight(10); if(key=='4') stroke(255,0,0); if(key=='5') stroke(255,255,0); if(key=='6') stroke(0,255,0); if(key=='7') stroke(0,0,255); if(key=='8') stroke(255,0,255);}
size(600,400);background(#FFFFA2); ///色碼rect(100,100, 400,200);fill(#FFFFA2); ///填充色ellipse(300,200,100,100);
Week01-3size(400,400);fill(#FFFFA2); ///填充色noStroke(); //不要有邊線的筆觸//ellipse(50,50,100,100);arc(50,50,100,100,1,PI*2-1,PIE); //畫弧
size(400,400);fill(#FFFFA2); ///填充色for(int x=0;x<400;x+=100){ for(int y=0;y<400;y+=100){ arc(x+50,y+50,100,100,0+0.5,PI*2-0.5,PIE); //畫弧 }}
沒有留言:
張貼留言