Formatted examples
MODIFY
examples.py/Library/PDF Export/ManyPDFs.pyde
examples.py/Library/PDF Export/ManyPDFs.pyde
@@ -10,10 +10,12 @@ add_library('pdf')
savePDF = False
+
def setup():
size(600, 600)
frameRate(24)
+
def draw():
if savePDF:
beginRecord(PDF, "lines%d.pdf" % (frameCount))
@@ -26,10 +28,12 @@ def draw():
if savePDF:
endRecord()
+
def mousePressed():
global savePDF
savePDF = True
+
def mouseReleased():
global savePDF
savePDF = False

MODIFY
examples.py/Library/PDF Export/ManyPages.pyde
examples.py/Library/PDF Export/ManyPages.pyde
@@ -8,12 +8,14 @@ Pressing the mouse finishes writing the file and exits the program.
add_library('pdf')
+
def setup():
global pdf
size(600, 600)
frameRate(4)
pdf = beginRecord(PDF, "Lines.pdf")
+
def draw():
background(255)
stroke(0, 20)
@@ -21,6 +23,7 @@ def draw():
line(mouseX, 0, width - mouseY, height)
pdf.nextPage()
+
def mousePressed():
endRecord()
exit()

MODIFY
examples.py/Library/PDF Export/MousePress.pyde
examples.py/Library/PDF Export/MousePress.pyde
@@ -10,10 +10,12 @@ add_library('pdf')
saveOneFrame = False
+
def setup():
size(600, 600)
frameRate(24)
+
def draw():
global saveOneFrame
if saveOneFrame:
@@ -28,6 +30,7 @@ def draw():
endRecord()
saveOneFrame = False
+
def mousePressed():
global saveOneFrame
saveOneFrame = True

Formatted examples