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

Clarify the onProgress design limitations in docs #8962

Merged
merged 1 commit into from Dec 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/assets/src/Assets.ts
Expand Up @@ -498,9 +498,10 @@ export class AssetsClass
* // Load another bundle...
* gameScreenAssets = await Assets.loadBundle('game-screen');
* @param bundleIds - the bundle id or ids to load
* @param onProgress - optional function that is called when progress on asset loading is made.
* @param onProgress - Optional function that is called when progress on asset loading is made.
* The function is passed a single parameter, `progress`, which represents the percentage (0.0 - 1.0)
* of the assets loaded.
* of the assets loaded. Do not use this function to detect when assets are complete and available,
* instead use the Promise returned by this function.
* @returns all the bundles assets or a hash of assets for each bundle specified
*/
public async loadBundle(bundleIds: string | string[], onProgress?: ProgressCallback): Promise<any>
Expand Down
5 changes: 4 additions & 1 deletion packages/assets/src/loader/Loader.ts
Expand Up @@ -101,7 +101,10 @@ export class Loader
* const assets = await Loader.load(['cool.png', 'cooler.png']);
* console.log(assets);
* @param assetsToLoadIn - urls that you want to load, or a single one!
* @param onProgress - a function that gets called when the progress changes
* @param onProgress - For multiple asset loading only, an optional function that is called
* when progress on asset loading is made. The function is passed a single parameter, `progress`,
* which represents the percentage (0.0 - 1.0) of the assets loaded. Do not use this function
* to detect when assets are complete and available, instead use the Promise returned by this function.
*/
public async load<T = any>(
assetsToLoadIn: string | LoadAsset,
Expand Down