Processing.js for Processing Devs: Difference between revisions

Line 233: Line 233:


Portions of the code above are from the Processing.js project's '''init.js''' file, see http://github.com/annasob/processing-js/blob/0.9.8/examples/init.js.  This file will likely be going away in the future, and happen automatically as part of Processing.js initialization.
Portions of the code above are from the Processing.js project's '''init.js''' file, see http://github.com/annasob/processing-js/blob/0.9.8/examples/init.js.  This file will likely be going away in the future, and happen automatically as part of Processing.js initialization.
===Whatever you can do with the web, you can do with Processing.js===
Now that your sketch is working, and you have a basic web page, you'll probably start getting ideas about how to make this look more beautiful, how to better integrate your sketch with the surrounding web page or site, and how to mix data from various web services and APIs.  Is it possible to mix images on Flickr and a Processing.js sketch? Yes.  Is it possible to link Twitter to Processing.js?  Yes.  Anything the web can do, your Processing.js sketch can do.
This is an important idea, and is worth restating: Processing.js turned your once Java-based code into JavaScript, and your graphics into <canvas>.  As a result, anything you read on the web about dynamic web programming, AJAX, other JavaScript libraries or APIs, all of it applies to your sketch now.  You aren't running code in a box, cut-off from the rest of the web.  Your code is a first-class member of the web, even though you didn't write it that way.
If you're feeling adventurous and want to go learn more about how to do other thing with HTML, JavaScript, CSS, etc. remember that everything they say applies to you and your sketches.
Confirmed users
656

edits