Files
FreeJ/scripts/processing/topics/savefile2.pde
Jaromil ae7b1ad056 progresses on processing script
processing-js 0.4 has been merged in some relevant parts
basic and topic scripts added for test
color handling fixed, more scripts show up now
2010-02-12 18:36:54 +01:00

26 lines
538 B
Plaintext

PrintWriter output;
void setup()
{
size(200, 200);
// Create a new file in the sketch directory
output = createWriter("positions.txt");
frameRate(12);
}
void draw()
{
if (mousePressed) {
point(mouseX, mouseY);
// Write the coordinate to a file with a
// "\t" (TAB character) between each entry
output.println(mouseX + "\t" + mouseY);
}
}
void keyPressed() { // Press a key to save the data
output.flush(); // Write the remaining data
output.close(); // Finish the file
exit(); // Stop the program
}