-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added possibility to handle progress during load #143
Conversation
src/animate/load.ts
Outdated
* @return instance of PIXI resource loader | ||
*/ | ||
export function load(scene: AnimateAsset, complete?: Complete): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function signature should remain unchanged - your implementation only handles it in a LoadOptions object (which I agree with doing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/animate/load.ts
Outdated
if (!loadedAsset) | ||
{ | ||
return; // not sure if this can evet happen | ||
return; // not sure if this can event happen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are fixing typos, the typo here was that it should be even
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/animate/load.ts
Outdated
{ | ||
if (optionsOrComplete && typeof optionsOrComplete !== 'function') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple suggestions here:
- Save a local variable like
complete
up above. - Since we already have a callback for each asset, instead of making a new function for each asset to pass to Assets, just do our progress calculation where you are doing
loadedAssets++
(which will also ensure that the math is correct).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
#142