O'Reilly logo

Make: Getting Started with p5.js by Ben Fry, Casey Reas, Lauren McCarthy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required