topical media & game development
graphic-processing-learning-04-example-4-5-example-4-5.pde / pde
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// Example 4-5: Using system variables
void setup() {
size(200,200);
smooth();
}
void draw() {
background(100);
stroke(255);
// frameCount is used to color a rectangle.
fill(frameCount / 2);
rectMode(CENTER);
// The rectangle will always be in the middle of the window
// if it is located at (width/2, height/2).
rect(width/2,height/2,mouseX+10,mouseY+10);
}
void keyPressed() {
println(key);
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.