LiquidFun with p5.js?

I am familiar with using Box2D with p5.js, but what I am unsure about is how to use LiquidFun (which is a modification of Box2D) with p5.js. There are Javascript libraries for LiquidFun which are easy to find, but the demos do not use p5.js. Has anyone used the LiquidFun javascript libraries with p5.js? Could someone share an example?

Answers

    • p5.js sketches have an HTMLCanvasElement as its main canvas.
    • If some library you wanna use together w/ p5.js also has its own canvas, probably you may wish for them to share the same canvas.
    • In order to do that, you're gonna need to find a way to configure the external library to accept the p5.js' canvas.
    • BtW, p5.js' canvas is stored in a "secret" global variable called canvas. ;;)
  • We agree that in principle it should be possible to include LiquidFun as an extra library. The devil is in the details.

    Here is a working LiquidFun javascript implementation: http://jsfiddle.net/joshcomley/hyess09f/

    Any advice on merging it with p5.js? I tried here:

    http://alpha.editor.p5js.org/ChrisOrban/sketches/SkgLffPez

    But it fails on the world.CreateParticleSystem and I don't see an obvious reason why.

  • edited November 2017

    Problem is, I dunno any of those libraries. ~:>
    You're gonna need to find out their online documentation in order to know how their API works.

Sign In or Register to comment.