Tag:

processing

Using the background function of Processing.js with images

“Background image must be the same dimensions as the canvas.”

In case you are looking for a workaround for Processing.js background function that forces you to scale your background image, try this trick to make your browser do the scaling for you.

Set the CSS background for the canvas element to your image, and use “cover” or R… Read more

Fonts in Processing.js

Since the documentation at http://processing.js is still tailored for processing code, I’ll post an example of how to port font usage to JS (assuming you have an “inArray” function like jQuery’s).  It shows how you can store all the fonts you need in an associative array for easy reference afterward:

var fonts = {};

processing.
Read more