Processing2P5JS is a search and replace based porting tool, to help the porting of Processing apps to P5.js. This is a tool that I created for me and my students, and is provided to the rest of the world as is. It is by no means a complete porting tool.
It can primarily be used in three ways.
How it works
If we have the following example in Processing:
I choose Tools/Processing2p5js
- Most Processing 2d graphics
- 1-3d arrays
What does not work
To declare more than one variable per line in classes.
API:s that exists in Processing but not in P5.js
Classes in Processing2P5js
Processing2P5js tries to convert Processing classes to ES6 classes. ES6 classes is support in all modern browsers (not in IE). It seems to work for most cases. But you must declare each member variable on a new line. The access control keywords private, public and protected is not supported.
beginShape … endShape
One special thing is beginShape/endShape. It works in the non-object oriented way for example:
In a more object oriented way when used with createShape() it does not work.