今天是互動技術的第一堂課
🔸size(600,400);//視窗大小
🔹background(#2C90D1);//顏色:背景色、畫的顏色
🔸ellipse(200,300, 30,30);//圓🔹ellipse(200,300, 30,30);//圓
🔸stroke(204,102,0);//可以改變框框顏色
🔹
fill(247,187,9);//填色
ellipse(300,400,200,80);//嘴唇
line(200,400,400,400);//嘴
fill(54,54,54);//填色
🔸strokeWeight(5);//邊框厚度
🔹size(600,600);//視窗大小
background(#2C90D1);//顏色:背景色、畫的顏色
fill(255);
noStroke();//邊框
rect(100,100, 400,400);//外框
stroke(128);
strokeWeight(5);//邊框厚度
ellipse(200,300, 30,30);//左眼
ellipse(400,300, 30,30);//右眼
noStroke();
fill(247,187,9);//填色
ellipse(300,400,200,80);//嘴唇
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
ellipse(mouseX,mouseY, 30,30);//左眼
沒有留言:
張貼留言