Skip to content

Instantly share code, notes, and snippets.

@sgallese
Created October 28, 2009 21:46
Show Gist options
  • Save sgallese/220881 to your computer and use it in GitHub Desktop.
Save sgallese/220881 to your computer and use it in GitHub Desktop.
PImage b;
void setup(){
size(448, 448);
// Images must be in the "data" directory to load correctly
b = loadImage("square.gif");
image(b, 0, 0);
System.out.println("@points = [");
}
void draw(){
}
void mouseClicked() {
float mX = mouseX;
float mY = mouseY;
float caveX = ((mX/width)*8.0)-4.0;
float caveY = -1*(((mY/height)*8.0)-4.0);
System.out.println("["+caveX+","+caveY+"],");
fill(255, 0, 0);
ellipse(mouseX, mouseY, 5, 5);
}
void keyPressed(){
if (key == 'd'){
System.out.println("]");
}
if (key == 'x'){
System.out.println("DELETEABOVE");
}
}
class points {
void points(){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment