void setup(){
size(800,300);
}
void draw(){
rect(mouseX,mouseY,50,20);
}
void setup(){
size(800,300);
for(int x=0;x<800;x+=16){
for(int y=0;y<300;y+=30){
rect(x,y,16,30);
}
}
}
void draw(){
int nowX=mouseX/16*16,nowY=mouseY/30*30;
fill(0);
rect(nowX,nowY,50,20);
}

void setup(){
size(800,300);
for(int x=0;x<800;x+=16){
for(int y=0;y<300;y+=30){
rect(x,y,16,30);
}
}
}
void draw(){
int nowX=mouseX/16*16,nowY=mouseY/30*30;
if(mousePressed && mouseButton==LEFT){
fill(0);
rect(nowX,nowY,16,30);
}
else if(mousePressed && mouseButton==RIGHT){
fill(255);
rect(nowX,nowY,16,30);
}
}

PImage img;
void setup(){
size(500,500);
img=loadImage("new.png");
}
void draw(){
image( img,mouseX,mouseY,100,100);
}
沒有留言:
張貼留言