Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixes
  • Loading branch information
perminder-17 authored Apr 6, 2025
commit 0aa030cd1313f597a5a31676fa0b7354b475c805
6 changes: 1 addition & 5 deletions src/io/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ function files(p5, fn){
*
* async function setup() {
* createCanvas(200, 200);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might have to add noLoop(), otherwise the background(220) in draw will clear the image call in the next frame.

Copy link
Collaborator Author

@perminder-17 perminder-17 Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I have fixed that. I have moved background(220) to setup(). Is that's going to be a good approach instead of noLoop()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that works!

*
* background(220);
* try {
* // 1. Load an image file as a Blob.
* myBlob = await loadBlob('assets/flower-1.png');
Expand All @@ -823,10 +823,6 @@ function files(p5, fn){
* console.error('Error loading blob:', err);
* }
* }
*
* function draw() {
* background(220);
* }
* </code>
* </div>
*/
Expand Down