WenheLI / p5.gif

P5.js gif helper
MIT License
38 stars 4 forks source link

Add contextual p5 support #14

Open infusion opened 5 years ago

infusion commented 5 years ago

Hello,

I typically run p5 myself and avoid adding p5 methods to the window object. That being said, p5.gif should have the option to use custom p5 contexts, such as:

new p5(function(p5) {
  p.setup = function() {
    recorder = p5Gif.capture({
      p5: p5
    });
  };
  p.draw = function() {
    recorder.addFrame();
  };

}, 'cont');

Thanks Robert

WenheLI commented 5 years ago

@infusion I will add this support later. Since it may require some changes on the API, I need some time to figure it out.

infusion commented 5 years ago

No worries! Thanks a lot for your fast response on the issues