Sha256: 0b9b57d0af66f17f30ed8f83f1c9065896894f627ccc67946d949d632a658cda

Contents?: true

Size: 504 Bytes

Versions: 10

Compression:

Stored size: 504 Bytes

Contents

# Many Pages. 
# 
# Saves a new page into a PDF file each loop through draw().
# Pressing the mouse finishes writing the file and exits the program.
#

load_library 'pdf'
include_package 'processing.pdf'

attr_reader :pdf

def setup
  size(600, 600)
  frame_rate(4)
  @pdf = begin_record(PDF, "Lines.pdf")
  begin_record(pdf)
end

def draw
  background(255) 
  stroke(0, 20)
  stroke_weight(20.0)
  line(mouse_x, 0, width - mouse_y, height)
  pdf.nextPage
end

def mouse_pressed
  end_record
  exit
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.6.2 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.6.1 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.6.0 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.5.1 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.5.0 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.4.4 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.4.3 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.4.2 samples/processing_app/library/pdf/many_pages.rb
ruby-processing-2.4.1 samples/processing_app/library/pdf/many_pages.rb