Question

I'm using the "b-g" Processing build system for Sublime Text 2 (link) which works perfectly fine.

It's using the following command to initiate the build via the processing-java executable (I'm on Windows btw):

"cmd": ["processing-java", "--sketch=$file_path", "--output=$file_path/build-tmp", "--run", "--force"]

This will open the Processing application in a Java Environment.

Since I am targeting mobile devices I'd like to use JavaScript Mode though (the Processing IDE will fire up a server listening to some strange port serving a web page that you can access using any browser when exporting a sketch that way).

As I would like to avoid having to use the Processing Editor (usage of "foreign" editors has apparently been disabled in v2) I was wondering if I could trigger that behavior via my build system / the CLI?

Unfortunately I cannot find any information on that at all on the web and $ processing-java --help doesn't mention export modes as well.

Was it helpful?

Solution

No, but you can concatenate your .pde files into one source file, and then run that through the "processing-helper" for processing.js. If you clone the Processing.js repo (links on https://github.com/processing-js/processing-js) then you can load the ./tools/processing-helper.html in a browser (ideally from localhost, not file), and then just paste in your code, hit "convert", and out comes the compiled JS source.

That said, there's not all that much benefit to precompiling, since Processing.js is a browser technology. It's not "an editor", a sketch running using Processing.js is just a webpage, and all mobile devices support web pages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top