Change the way PaperScripts are executed in Node.js

Requiring a PaperScript returns an initialize method which receives the Canvas argument.
This commit is contained in:
Jürg Lehni 2013-12-29 16:36:23 +01:00
parent 976b24b34c
commit f97056e4b7
3 changed files with 18 additions and 14 deletions
examples/Node.js

View file

@ -1,7 +1,7 @@
require('paper');
var paper = require('./Tadpoles.pjs');
var paper = require('paper');
var scope = require('./Tadpoles.pjs')(new paper.Canvas(1024, 768));
paper.view.exportFrames({
scope.view.exportFrames({
amount: 400,
directory: __dirname,
onComplete: function() {

View file

@ -1,5 +1,3 @@
paper.setup(new Canvas(1024, 768));
// Adapted from Flocking Processing example by Daniel Schiffman:
// http://processing.org/learning/topics/flocking.html