topical media & game development

talk show tell print

graphic-processing-learning-03-example-3-2-example-3-2.pde / pde



  // Learning Processing
  // Daniel Shiffman
  // http://www.learningprocessing.com
  
  // Example 3-2: mouseX and mouseY
  
  void setup() {
    size(200,200);
  }
  
  void draw() {
    // Try moving background() to setup() and see the difference!
    background(255);
  
    // Body
    stroke(0);
    fill(175);
    rectMode(CENTER);
    
    // mouseX is a keyword that the sketch replaces with the horizontal position of the mouse.
    // mouseY is a keyword that the sketch replaces with the vertical position of the mouse.
    rect(mouseX,mouseY,50,50);   
  }
  


(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.