Get 20% off all career paths from fullstack to AI
AI, Data Science & Cloud Certificates from Google, IBM & Meta
Overview
AI, Data Science & Cloud Certificates from Google, IBM & Meta — 40% Off
One plan covers every Professional Certificate on Coursera. 40% off Coursera Plus Annual.
Unlock All Certificates
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