Skip to main content
AmigoFish

What's new in p5.js 2!

From The Coding Train Β· Β· 23 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.

If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.

Watch on YouTube

Not rated yet

Description

This video tackles one of the bigger changes in p5.js 2: loading data with async and await! Fear not, I'll cover how to transition from preload and callbacks in p5.js 1.0 to using promises with async/await in 2.0. Code: https://thecodingtrain.com/tracks/p5js-2.0/p5js-2.0/async-await

πŸš€ Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-p5js-20-async-and-await

p5.js Web Editor Sketches: πŸ•ΉοΈ p5.js 2 - async and await: https://editor.p5js.org/codingtrain/sketches/Q6S38g0rS πŸ•ΉοΈ p5.js 2 - loading animation: https://editor.p5js.org/codingtrain/sketches/JLIxyHrkn πŸ•ΉοΈ p5.js 2 - loading in a sequence: https://editor.p5js.org/codingtrain/sketches/lQxT7PTKC

πŸŽ₯ Next: https://youtu.be/1KqQeqZ3R9Y

References: πŸ“– p5.js 2.0 Beta: https://beta.p5js.org/ πŸ“– p5.js 2.0: https://github.com/processing/p5.js/issues/7488 πŸ“– p5.js 2.0: You Are Here & How to Contribute!: https://discourse.processing.org/t/dev-updates-p5-js-2-0-you-are-here-how-to-contribute/46130 🎨 Dog API: https://dog.ceo/dog-api/

Videos: πŸš‚ https://youtu.be/QO4NXhWo_NM πŸš‚ https://youtu.be/AwyoVjVXnLk

Timestamps: 0:00:00 p5.js 2.0! 0:03:00 Switching versions in the web editor 0:05:02 Loading with p5.js 1 0:06:11 Synchronous vs Asynchronous Code 0:08:37 Promises! 0:11:29 switching from preload to async setup() 0:13:57 Loading with callbacks in p5.js 1.0 0:17:15 Sequencing loading data in p5.js 1.0 0:19:26 Sequencing with async and await in p5.js 2.0 0:20:09 Creating a custom Async Function 0:22:13 Thank you for watching!

Music from Epidemic Sound

πŸš‚ Website: https://thecodingtrain.com/ πŸ‘Ύ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide 🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box πŸ’‘ GitHub: https://github.com/CodingTrain πŸ’¬ Discord: https://thecodingtrain.com/discord πŸ’– Membership: http://youtube.com/thecodingtrain/join πŸ›’ Store: https://standard.tv/codingtrain πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH πŸŽ₯ https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org πŸ”— p5.js Web Editor: https://editor.p5js.org/ πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#asyncawait #promises #p5js2 #preload #callbacks #p5js #javascript

Back to The Coding Train Β· Report a problem

What's new in p5.js 2! | The Coding Train | AmigoFish