processing.js multiple js pages

39 views Asked by At

Here, the processing website explains two ways to set up the processing library. I'm trying to use the first way. My code:

<html>
    <head>
        <title>PATHOGEN</title>
    </head>
    <body>
        <script src="processing.min.js"/>
        <canvas data-processing-sources="main.pde"/>
    </body>
</html>

It works, but what if I don't want all my code on one page? main.pde is gonna get crowded. I've tried writing this:

<script src="processing.min.js"></script>
<script src="blobby.js"></script>
<canvas data-processing-sources="main.pde"></canvas>

But it just gives me a grey canvas.

1

There are 1 answers

0
Caleb Bertrand On

For all you other people trying to use processing.js for the first time, and if you want to include multiple pages, just write this for your canvas:

<canvas data-processing-sources="blobby.pde main.pde"></canvas>

Just make all your pages end in .pde. For some reason it doesn't want to work for Chrome, (which is really a bummer) but it does work on Safari.