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

Pre-load project data & objects before execution instead of "on demand"? #133

Open
towerofnix opened this issue Jul 18, 2022 · 3 comments
Open
Labels
discussion Looking for feedback and input

Comments

@towerofnix
Copy link
Member

For now labelled as "discussion" as this may be a significant change from Leopard currently works! See discussion in #119 (comment):

@adroitwhiz wrote:
I wrote up a summary of this a while back, over in LLK/scratch-render#550. There's an associated PR that fixes it in LLK/scratch-render#594.

I can't remember what it has to do with costume loading--in general, I'm not really happy with the whole "costumes pop into existence when they're loaded" way things currently work in Leopard. I'd prefer if there was some sort of "preload" function that you called before running a project that loaded all the costumes and sounds.

@towerofnix wrote:
I'm not as experienced with Leopard or Scratch or the differences between them, but I definitely got the same feeling while reviewing your code. Maybe you could open an issue suggesting a "preload" mechanic? I feel like proper support for that (alongside a "progress bar" for asset loading etc) would be pretty reasonable/good.

And thanks for the links!

@PullJosh
Copy link
Collaborator

I think whatever we build should give the user considerable control over the loading screen. Ideally Leopard would provide a built-in loading screen that is simple and effective, and customizable to a degree (colors/text/etc). And perhaps also an escape hatch that allows rendering anything you want to the canvas based on the current loading state.

@PullJosh
Copy link
Collaborator

PullJosh commented Jul 18, 2022

Should users be allowed to register new costumes/sounds to a sprite on the fly? Like this:

*whenGreenFlagClicked() {
  this.costumes.push(new Costume("costume2", "./Sprite1/costumes/costume2.svg", { x: 0, y: 0 }));
  this.costume = "costume2";
}

If so, we'll have to think about how to handle that. If not, we probably need to freeze the costumes/sounds arrays after initialization.

@adroitwhiz
Copy link
Collaborator

I think a Costume.load / Sound.load API that returns a Promise<Costume | Sound> could work. If we need more granular loading progress, we could emit progress events from Costume/Sound?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Looking for feedback and input
Projects
None yet
Development

No branches or pull requests

3 participants