Sha256: e24a02c2822b0f9627ad65a7c90ee3ed56566cb0093fc4b48b91d7667c1f75d8

Contents?: true

Size: 588 Bytes

Versions: 10

Compression:

Stored size: 588 Bytes

Contents

# Scale 
# by Denis Grutze. 
# 
# Paramenters for the scale() function are values specified 
# as decimal percentages. For example, the method call scale(2.0) 
# will increase the dimension of the shape by 200 percent. 
# Objects always scale from the origin. 

def setup    
  size 640, 360    
  no_stroke
  rect_mode CENTER    
  frame_rate 30    
  @a, @s = 0.0, 0.0
end

def draw    
  background 102  	
  @a += 0.04
  @s = cos(@a) * 2  	
  translate width/2, height/2
  scale @s  	
  fill 51
  rect 0, 0, 50, 50  	
  translate 75, 0  	
  fill 255
  scale @s
  rect 0, 0, 50, 50
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.6.2 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.6.1 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.6.0 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.5.1 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.5.0 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.4.4 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.4.3 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.4.2 samples/processing_app/basics/transform/scale.rb
ruby-processing-2.4.1 samples/processing_app/basics/transform/scale.rb