processing-p5-convert

source code translator that converts Processing Java code to p5.js Javascript code

Home Minimal_example Command_line Notes About Project

(tests) hello bounce grid bounce_with_class cat hello_font hello_sound explode bounce_vectors hello_3d

(live conversion tests) phyllotaxis dandelin dogfooding

(student project tests) cow_game cross_the_road dinosaur_game greenhouse_game

Minimal example

Try it yourself!

More info about local web servers

minimal
    - index.html
    - minimal.pde
    - p5.min.js
    - processing-p5-convert-bundle.js
    - processing-p5-convert-bootstrap.js

index.html:

<!DOCTYPE html>
<html>
    <head>
        <script src="p5.min.js"></script>
        <script src="processing-p5-convert-bundle.js"></script>
        <script src="processing-p5-convert-bootstrap.js"></script>
    </head>
    <body>
        <main id="ppconvert" src="minimal.pde"></main>
    </body>
</html>

minimal.pde:

//
// minimal
//


void setup()
{
    size(400, 400);
}

void draw()
{
    background(0);
    fill(#0000ff);
    ellipse(200, 200, 300, 100);
    fill(0);
    textAlign(CENTER, CENTER);
    textSize(30);
    text("Hello, world!", 200, 200);
}

home