Sha256: 3064be12244a9ed043ad31877328bdfe8f3c4ec9f57fe41820badba0e6d3c443

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

# Scale Shape.  
# Illustration by George Brower. 
# 
# Move the mouse left and right to zoom the SVG file.
# This shows how, unlike an imported image, the lines
# remain smooth at any size.

class ScaleShape < Processing::App

  def setup
    
    size 640, 360
    
    smooth
    
    @bot = load_shape "bot1.svg"
  end
  
  def draw
  
  	background 102
  	
  	translate width/2, height/2
  	
  	zoom = map( mouse_x, 0, width, 0.1, 4.5 )
  	scale zoom
  	
  	shape @bot, -140, -140
  end
  
end

ScaleShape.new :title => "Scale Shape"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-processing-1.0.11 samples/processing_app/basics/shape/scale_shape.rb
ruby-processing-1.0.10.1 samples/processing_app/basics/shape/scale_shape.rb