TA: Tim Wang
twang01@risd.edu
Office Hours: Wednesday 1pm - 3pm
Room: CIT 4th floor, windows
|
|
|
|
|
1: Basic Drawing
2: Setup/Draw, Scope
3: Mouse Interaction
4: Keyboard Interaction
5: For Loops
6: Conditionals (if) and Logic Operators
7: Drawing Web Images
(some image links may not work)
8: Drawing Text
- Example 8-1 - render text and set font, fill/stroke, size, style
- Example 8-2 - render text using a Google Font
9: Motion
10: Transforms
11 : Map, constrain, distance
12: Functions
13: Arrays
14: Pixels
These examples require a server to run, for security reasons
15: Touch Interaction
Try these on a touch-enabled device such as a smartphone or tablet!
- Example 15-1 - detecting a single touch's location
- Example 15-2 - finger paint! (touch start, move and end events)
- Example 15-3 - multi-finger paint! (touch start, move and end events for multiple touches at a time)
- Example 15-4 - finger or mouse paint! (hooking behaviors up to both mouse and touch)
16: Classes and Objects
17: Processing to p5.js
18: HTML manipulation with p5.dom.js
- Example 18-1 - creating other HTML elements
- Example 18-2 - creating other HTML elements, with link
- Example 18-3 - creating HTML images
- Example 18-4 - using element specific mouse listeners: mouseOver and mouseOut (try mousing over and out of canvas)
- Example 18-5 - using element specific mouse listeners: mousePressed (try clicking image then pressing key)
- Example 18-6 - adding CSS style to HTML elements
19: Third-party JS Libraries: Buzz
Check the Creative Coding JS Libraries in the Resources page for links to some creative coding JS libraries
A good JS library is easy to download and has good documentation.
To use a third-party JS library:
- Find a library with proper download links and documentation
- Download the library .js file and put in your sketch folder
- Include the library at the top of your .html file
- Use the code in your setup() function or event handler functions
How to use the Buzz audio library:
20: Asynchronous loading and JSON
To run these examples locally on your machine, you must install a local server.
Instructions on how to install/run a local server.
- Example 20-1 - Preloading large media files
- Example 20-2 - Basic JSON objects, accessing key/value pairs
- Example 20-3 - Loading JSON objects from an external, local file
- Example 20-4 - Loading JSON objects from an external, remote file on another server
- Example 20-5 - Loading strings from an external file