2021年9月27日 星期一

week01

 


//第一個程式
//size(500,500);

size(600,600);///(1)大小
background(#C323F5);
//(2)顏色:背景色、畫的顏色
顏色編號:工具/顏色選擇器
rect(100,100, 400,400);///(3)方塊
         位置        大小
ellipse(200,300, 30,30);//(4)圓


//第一個程式
//size(500,500);
size(600,600);///(1)大小
background(#C323F5);
//(2)顏色:背景色、畫的顏色
rect(100,100, 400,400);///(3)方塊
                      長、寬
ellipse(200,300, 30,30);//(4)圓
ellipse(400,300, 30,30);
  rect(200,350, 200,100);
       左上角頂點
ellipse(300,400, 200,100);
              圓心
///橢圓和長方形的差別


stroke();///筆觸色
fill();///填滿色

size(600,600);
background(128);

fill(255);
noStroke();///臉
rect(100,100,400,400);

stroke(128);
strokeWeight(5);///雙眼
ellipse(200,300,30,30);
ellipse(400,300,30,30);

noStroke();
fill(#CC6600);
ellipse(300,400,200,100);

stroke(255);
line(200,400,400,400);


void setup(){
size(600,600);
}
void draw(){
  background(128);
  fill(255);
  noStroke();///臉
  rect(100,100,400,400);
  stroke(128);
  strokeWeight(5);///雙眼
  ellipse(200,300,30,30);
  ellipse(400,300,30,30);
  noStroke();
  fill(#CC6600);///嘴巴
  ellipse(300,400,200,100);
  stroke(255);///嘴巴直線
  line(200,400,400,400);
}  


加入mouseX mouseY 可以讓物件移動
void setup(){///Unity void Start(){...}
size(600,600);///設定的函式,只做一次
}
void draw(){///Unity void Update(){...}
  background(128);
  fill(255);
  noStroke();///臉
  rect(100,100,400,400);
  stroke(128);///=============
  strokeWeight(5);///雙眼
  ellipse(mouseX,mouseY,30,30);
  ellipse(400,300,30,30);
  noStroke();///============
  fill(#CC6600);///嘴巴
  ellipse(300,400,200,100);
  stroke(255);///嘴巴直線
  line(200,400,400,400);
}  

沒有留言:

張貼留言