|
3m
楼主 |
发表于 2011-10-15 00:40:47
|
只看该作者
import android.view.MotionEvent;
float x1,y1,x2,y2,press1,press2;
int pointNum;
void setup() {
size(screenWidth, screenHeight);
stroke(0);
}
void draw() {
background(240);
fill(press1*200,0,0);
ellipse(x1,y1,press1*300,press1*300);
fill(0,press2*200,0);
ellipse(x2,y2,press2*300,press2*300);
}
boolean surfaceTouchEvent(MotionEvent event) {
x1=event.getX(0);x2=event.getX(1);
y1=event.getY(0);y2=event.getY(1);
press1=event.getSize(0);
press2=event.getSize(1);
return super.surfaceTouchEvent(event);
} |
|