Chapter 7. Media
p5.js is capable of drawing more than simple lines and shapes. It’s time to learn how to create images and text in our programs to extend the visual possibilities to photography, detailed diagrams, and diverse typefaces.
Before we do that, we first need to talk a little bit about servers. Up to this point, we’ve just been viewing the index.html file directly in the browser. This works fine for things like running simple animations. However, if you want to do things like load an external image file into your sketch, you might find that your browser doesn’t allow this. If you look in the console, you may see an error containing the term cross-origin. For loading external files, you will need to run a server. A server is a program ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access