We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to drag a pic from a side to another and drop it in that new location, I have this code, but it doesn't work
PImage sample;
void setup(){
size(1000, 600);
noStroke();
sample=loadImage("test.png");
}
void draw(){ background(255); image(sample,0,400,50,30); }
void mouseDragged() { image(sample,mouseX,mouseY,50,30); }
void mouseReleased() { image(sample,mouseX,mouseY,50,30); }
Answers
Please format your code. Edit your post, select code and hit ctrl+o.
You need to use global pos variables:
Kf
Hello Kfrajer
It was quite easy, but I didn't find out the answer, it worked fine for me. I will format code with Ctrl+o in future
Thanks a lot
Julio Dorado