Skip to content

Commit

Permalink
Clarify the onProgress limitations in documentation (#8962)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Dec 12, 2022
1 parent 81a9ef5 commit e1ea3a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/assets/src/Assets.ts
Expand Up @@ -506,9 +506,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 @@ -100,7 +100,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(
assetsToLoadIn: string | string[] | LoadAsset | LoadAsset[],
Expand Down

0 comments on commit e1ea3a7

Please sign in to comment.