Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to load external assets including images, JSON files, and API data into p5.js 2.0 sketches through this comprehensive 18-minute tutorial. Master the fundamentals of asynchronous operations in p5.js using Promises with async/await syntax, starting with basic image loading techniques and progressing to more advanced concepts. Discover how to avoid common mistakes when working with asynchronous code, implement sequential loading of multiple items, and create custom loading animations to enhance user experience. Explore faster parallel loading techniques using Promise.all() for improved performance when handling multiple assets simultaneously. Practice with hands-on examples including loading single images, working with live APIs like the Dog API, and implementing loading animations with placeholders. Access interactive code examples through the p5.js Web Editor to experiment with different loading strategies and apply the concepts in your own creative coding projects.
Syllabus
0:00:00 Hello!
0:00:54 How to Load an Image in p5.js
0:02:16 Asynchronous Code: promises, async, and await
0:04:10 Common Mistakes to Avoid
0:05:51 Loading Data from a Live API
0:08:21 Loading Multiple Items in a Sequence
0:09:12 Creating a Custom Loading Animation
0:13:39 Faster Parallel Loading with Promise.all
0:16:48 Challenge for you!
Taught by
The Coding Train