Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement for 'loading...' div element when preload is used #3625

Open
5 tasks done
Ajayneethikannan opened this issue Mar 20, 2019 · 6 comments
Open
5 tasks done

Comments

@Ajayneethikannan
Copy link
Contributor

Nature of issue?

  • Existing feature enhancement

appropriate sub-area of p5.js?

  • Core/Environment/Rendering

Which platform were you using when you encountered this?

  • Mobile/Tablet (touch devices)
  • Desktop/Laptop
  • Others (specify if possible) - Device independent

Details about the bug:

  • p5.js version: 0.7.3
  • Web browser and version: Browser independent
  • Operating System: OS independent
  • Steps to reproduce this:

https://editor.p5js.org/TheSkepticSniper/sketches/Hpintvgpy - This sketch can be used for reference

Feature enhancement details:

Currently , if any load method fails in preload function, the sketch does not proceed to setup and draw due to preload's blocking nature, but the text when preload is executing remains saying
'loading...'
It would be nice to improve the feature , by making the text box say
'some error has occurred'
when any method fails in the preload function.

Would love to hear suggestions on this,
Thanks!

@limzykenneth
Copy link
Member

Would be great if possible. I think the current challenge is to identify that a loading function call has failed and retaining capability for the user to handle the error themselves.

@meiamsome
Copy link
Member

meiamsome commented Mar 23, 2019

I am pro this in general, and agree with @limzykenneth that implementation is a bit problematic at the moment.

If/when we move to all-promise based preloads (#2698) this becomes much more plausible to implement, and would, indeed, be quite simple.

I could see a simple API being something like the following, with a default implementation of preloadFailed for when it is not manually specified:

function preload() {
  loadStrings('404.txt');
}

function preloadFailed() {
  // Allow the user to draw here maybe?
}

function draw() {
  // use the data from the loadStrings call
}

@Ajayneethikannan
Copy link
Contributor Author

@meiamsome I kind of had a feeling it's implementation would become easier with promises,
Thank you for the clarifications @limzykenneth , @meiamsome !
Would like to wait on it then 👍

@singhvisha
Copy link
Contributor

@limzykenneth ,can i work on this issue?

@devashish1099
Copy link

@limzykenneth can u guide me where to look for solving this issue

@limzykenneth
Copy link
Member

@singhvisha Are you still looking into this issue?

Hi @devashish1099, @singhvisha did asked to work on this first so I'll leave a few days for him to reply if he's still working on this issue. However, from the discussions above, there isn't a straightforward solution to this issue. If you want to have a crack at it anyway you can familiarize yourself with how preload and the loading functions work first, then if you come up with a solution, you can propose it here for us to discuss it.

@limzykenneth limzykenneth moved this to Proposal in p5.js 2.0 May 28, 2024
@limzykenneth limzykenneth moved this from Proposal to Out of Scope in p5.js 2.0 Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Out of Scope
Development

No branches or pull requests

7 participants