Using Processing.js without the Processing editor
It's time to leave our beloved Processing editor and do something different. We'll take a look at how we can use Processing.js with a regular text editor. This helps you learn about the JavaScript version of Processing and gives you more control over what you do.
Getting ready
Download the latest version of Processing.js at http://processingjs.org/download/. You can use the Production version, which is a minified version of the full Development version. The size of this file is a lot smaller, so it is ideal to use on your website. The Processing.js
file should be placed in the js
folder. You also need the reset.css
file we've used in the Creating a custom HTML template recipe.
How to do it...
We'll start by creating an HTML file with links to the CSS files and will then include the Processing.js file with a <script>
tag. This is the full code for the HTML file. You need to save it in a new folder, as index.html
.
<!doctype html> <...