马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- //import gifAnimation.*;
- //GifMaker gifExport;
- int len = 20;
- float[] x = new float[len];
- float[] y = new float[len];
- //
- void setup(){
- colorMode(HSB,360,100,100);
- size(500,500);
- background(255);
- // gifExport = new GifMaker(this,"aa.gif");
- // gifExport.setRepeat(0);
- }
- void draw(){
- background(#FFFFFF);
- noStroke();
- if(mousePressed){
- addPosition();
- for(int i=x.length-1;i>=0;i--){
- if(x[i]!=0){
- fill(198,100-100/len*i,98);
- ellipse(x[i],y[i],50-50/len*i,50-50/len*i);
- }
- }
- }else{
- x = new float[len];
- y = new float[len];
- }
- // gifExport.setDelay(1000/30);
- // gifExport.addFrame();
- }
- void addPosition(){
- println(x);
- for(int i=x.length-1;i>0;i--){
- x[i] = x[i-1];
- y[i] = y[i-1];
- x[0] = mouseX;
- y[0] = mouseY;
- }
- }
复制代码
|