Sha256: 9f2ef5767f611b7b4b84f9864b3573b216c0abb86e0ba387509d3f90eeec0c96

Contents?: true

Size: 523 Bytes

Versions: 4

Compression:

Stored size: 523 Bytes

Contents

require 'ruby-processing'

class MouseXAndMouseY < Processing::App

  def setup

  end
  
  def draw
    # Try moving background to setup and see the difference!
    background 255
    
    # Body
    stroke 0
    fill 175
    rect_mode CENTER
    
    # mouse_x is a keyword that the sketch replaces with the 
    # horizontal position of the mouse.
    # mouse_y gets the vertical position.
    rect mouse_x, mouse_y, 50, 50
  end
  
end

MouseXAndMouseY.new :title => "Mouse X And Mouse Y", :width => 200, :height => 200

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-processing-1.0.1 samples/learning_processing/chapter_03/2_mouse_x_and_mouse_y.rb
ruby-processing-1.0.2 samples/learning_processing/chapter_03/2_mouse_x_and_mouse_y.rb
ruby-processing-1.0.3 samples/learning_processing/chapter_03/2_mouse_x_and_mouse_y.rb
ruby-processing-1.0.4 samples/learning_processing/chapter_03/2_mouse_x_and_mouse_y.rb