Sha256: ece335c1352d59feb1e4c498a568e35a2c58df1ab7553befa5f3a284796885bd

Contents?: true

Size: 637 Bytes

Versions: 9

Compression:

Stored size: 637 Bytes

Contents

require 'ruby-processing'

# The basic shape primitive functions are triangle, rect, 
# quad, and ellipse. Squares are made with rect and circles 
# are made with ellipse. Each of these functions requires a number
# of parameters to determine the shape's position and size.


class ShapePrimitives < Processing::App

  def setup
	smooth   
	background 0 
	no_stroke
	fill 226 
	triangle 10, 10, 10, 200, 45, 200 
	rect 45, 45, 35, 35 
	quad 105, 10, 120, 10, 120, 200, 80, 200 
	ellipse 140, 80, 40, 40 
	triangle 160, 10, 195, 200, 160, 200  
  end
  
end

ShapePrimitives.new :title => "Shape Primitives", :width => 200, :height => 200

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruby-processing-1.0.11 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.10.1 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.9 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.4 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.3 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.5 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.6 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.7 samples/processing_app/basics/form/shape_primitives.rb
ruby-processing-1.0.8 samples/processing_app/basics/form/shape_primitives.rb