PImage img = loadImage("http://www.yardleyluk.com/wp-content/uploads/2010/08/666be68ag8e446a4ba049690.jpg");//網址
image(img, 0,0,600,800);
//先save as 資料夾(不能用數字)
PImage img;
void setup() {
size(1000, 1000);
img = loadImage("2.jpg");
imageMode(CENTER);
}
void draw() {
background(255, 255, 255);
image(img, mouseX, mouseY, 600, 600);
}
PImage img,imgBG;
void setup() {
size(800, 600);
img = loadImage("5.png");
imgBG = loadImage("background.jpg");
imgBG.resize(800,600);
imageMode(CENTER);
}
void draw() {
background(imgBG);
image(img, mouseX, mouseY, 200, 200);
}
float eggX=600, eggY=400, eggVX,eggVY, flying=0;
void setup() {
size(800, 600);
img = loadImage("5.png");
imgBG = loadImage("background.jpg");
imgBG.resize(800,600);
imageMode(CENTER);
}
void draw() {
background(imgBG);
image(img, mouseX, mouseY, 200, 200);
if (flying>0){
ellipse(eggX,eggY,30,30);
eggX+=eggVX;eggY+=eggVY; flying--;
}
}
void mousePressed(){
eggX=600;eggY=400;flying=50;
eggVX=(mouseX-eggX)/flying;
eggVY=(mouseY-eggY)/flying;
}




沒有留言:
張貼留言