Open main menu

CDOT Wiki β

Changes

FSOSS 2010/processing.js/example6

102 bytes added, 10:26, 26 October 2010
no edit summary
Example of line, ArrayList, mousePressed, mouseReleased
*/
boolean drawingLine = false;
float lineX;
float lineY;
ArrayList lineCoords;
void setup(){
size(300, 300);
lineCoords = new ArrayList();
}
void draw(){
background(33, 66, 99);
}
}
/*
Function gets called once, as soon as the
lineY = (float) mouseY;
}
/*
Function gets called once, as soon as the
lineCoords.add((float) mouseX);
lineCoords.add((float) mouseY);
println("Coords: (" + (int)lineX + ", " + (int)lineY + ", " + mouseX + ", " + mouseY + ")");
}
</source>
[http://studio.sketchpad.cc/???? Run me]
1
edit