1
edit
Changes
Created page with 'category: FSOSS 2010 PJS Examples <source lang="JavaScript"> →FSOSS 2010: void setup(){ size(500, 500); background(0); // Don't draw outlines around rectangles,…'
[[category: FSOSS 2010 PJS Examples]]
<source lang="JavaScript">
/*
FSOSS 2010
*/
void setup(){
size(500, 500);
background(0);
// Don't draw outlines around rectangles, ellipses, etc.
noStroke();
}
/*
Processing.js will call this every frame
*/
void draw(){
// If one of the mouse buttons are down
if(mousePressed){
// Set the fill style to black
fill(0);
}
else{
// Set the fill style to white
fill(255);
}
// ellipse( x, y, width, height)
ellipse(mouseX, mouseY, 40, 40);
}
</source>
[http://studio.sketchpad.cc/QWtQeIxei5 Run me]
<source lang="JavaScript">
/*
FSOSS 2010
*/
void setup(){
size(500, 500);
background(0);
// Don't draw outlines around rectangles, ellipses, etc.
noStroke();
}
/*
Processing.js will call this every frame
*/
void draw(){
// If one of the mouse buttons are down
if(mousePressed){
// Set the fill style to black
fill(0);
}
else{
// Set the fill style to white
fill(255);
}
// ellipse( x, y, width, height)
ellipse(mouseX, mouseY, 40, 40);
}
</source>
[http://studio.sketchpad.cc/QWtQeIxei5 Run me]