練習做一個電流急急棒
PImage imgMap;
void setup(){
size(400,400);
imgMap=loadImage("map.png");
imgMap.loadPixels();
}
void draw(){
background(imgMap);
if(imgMap.pixels[ mouseX+mouseY*400 ] == color(237,28,36) ){
background(255,0,0);
}
fill(imgMap.pixels[ mouseX+mouseY*400 ]);
rect(250,250,100,100);
}
void setup(){
size(400,400);
imgMap=loadImage("map.png");
imgMap.loadPixels();
}
void draw(){
background(imgMap);
if(imgMap.pixels[ mouseX+mouseY*400 ] == color(237,28,36) ){
background(255,0,0);
}
fill(imgMap.pixels[ mouseX+mouseY*400 ]);
rect(250,250,100,100);
}
沒有留言:
張貼留言