鼠标响应事件的基本结构为
void setup() {
}
void draw() {
}
void mousePressed() {
}
void mouseMoved() {
}
void mouseDragged() {
}
mousePressed() 函数用在鼠标被按下的响应事件中,如
void setup() {
sieze(300,300);
smooth();
background(100);
}
void draw() {
}
void mousePressed() {
stroke(0);
fill(255,255,0);
ellipse(mouseX,mouseY,25,25);
}