0
當按下方向鍵(+, - )時同時按下T,框架的尺寸變大,整個框架變大(黑色邊框增加),而「圖片」變小。框架尺寸變大
color c=color(0);
int strokeW=1,flag=0;
void setup() {
size(600, 600);
background(255);
}
void draw() {
fill(c);
stroke(c);
strokeWeight(strokeW);
if(flag==1) line(mouseX, mouseY, pmouseX, pmouseY);
}
void mouseDragged() {
flag=1;
}
void mouseReleased(){
flag=0;
}
void keyPressed() {
if (keyCode == UP) strokeW++;
if (keyCode == DOWN) strokeW--;
if (key == 'c')
background(255);
if (key == 't') {
fill(255,10); // semi-transparent white
rect(0,0,width,height);
fill(0);
//line(mouseX, mouseY, , 100);
}
if (strokeW<0)strokeW=1;
if(key== 'b')
c = color(random(0,255),random(0,255),random(0,255));
}
我碰到你的計劃,我仍然不知道你在問什麼。 – 2014-12-04 17:55:56