1. 檔案/偏好設定/改字型大小
2.
size(500,500); //開500*500的視窗
background(#C0EBD7); //改背景顏色
3.
void setup(){ //設定
size(500,500);
}
void draw(){ //執行程式
if(mousePressed) background(#F98D74);
else background(#C0EBD7);
}
4.
void setup(){
size(500,500);
background(#C0EBD7);
}
void draw(){
if(mousePressed) line(mouseX,mouseY,pmouseX,pmouseY);
}
5.void setup(){
size(500,500);
background(#C0EBD7);
}
void draw(){
if(mousePressed) line(mouseX,mouseY,pmouseX,pmouseY);
}
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);
7.
size(600,400);
background(#C0EBD7);
rect(100,100,400,200);
//在100*100的地方做400*200的長方形(座標X,座標Y,長,寬)
8.background(#C0EBD7);
rect(100,100,400,200);
fill(#F98D74);
ellipse(300,200,100,100);
9.
size(400,400);
background(#C0EBD7);
fill(#F98D74);
noStroke(); //不要邊線
arc(50,50,100,100,0+1,PI*2-1,PIE); //畫弧度
//(X座標,Y座標,寬,高,開始,結束,蘋果派的方法畫(?))
10.size(400,400);
background(#C0EBD7);
fill(#F98D74);
noStroke();
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);
}
}
ctrl+T 自動排版
ctrl+N 開新文件
沒有留言:
張貼留言