Posted on March 16, 2010 - by dirtymitten
Processing notes 3.16.10
Mmmm, Processing.js
http://processingjs.org/
for Javascript integration in the browser. Better than Flash
Processing is a Java-based wrapping development environment that allows for quick and easy coding for graphical and user-interface designs.
// It's a convention to declare variables at the top,
// and variables must be declared outside of the setup
// and draw functions? classes?
int j = 0;
int c = 0;
int cx = (255-c);
void setup(){
size(800,600);
frameRate(120);
background(255, 11);
}
void draw(){
if(mousePressed) {
stroke(mouseX % 255);
strokeWeight(abs(pmouseX-mouseX));
line(pmouseX, pmouseY, mouseX, mouseY);
}
// if (keyPressed == true) save("filename" +j+".png");
}
void keyReleased(){
if (key == 's') {
++j;
save("filename"+j+".jpg");
}
// the ' ' indicates (maps) the spacebar to this event
if (key == ' '){
fill(c);
c = round(random(0-255));
println(c);
cx = (255-c);
println(cx);
noStroke();
rect(0,0,width, height);
stroke(cx);
}
}
void drawGreenRect() {
fill(0,255,0);
noStroke();
rect(30,30, width-60, height);
stroke(0);
}
//void mouseReleased(){
// ++j;
// save("filename"+j+".png");
//}
This entry was posted on Tuesday, March 16th, 2010 at 5:40 pm and is filed under Snoop Bloggy-Blogg. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
