LoadingProgress

Tracks the loading progress of the AssetStorage.

Counts the total, loaded and failed assets.

percent allows to see current loading progress in range of 0, 1.

The values stored by the LoadingProgress are eventually consistent. The progress can go slightly out of sync of the actual amounts of loaded assets, as it is not protected by the AssetStorage.lock.

Due to the asynchronous nature of AssetStorage, some assets that will eventually be scheduled by coroutines might not be counted by LoadingProgress yet. Calling AssetStorage.load or AssetStorage.loadAsync is not guaranteed to immediately update the total number of assets.

Use the LoadingProgress for display only and base your actual application logic on AssetStorage API instead.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val failed: Int

Total number of assets that failed to load.

Link copied to clipboard

True if there are any failed assets.

Link copied to clipboard

True if all registered assets are loaded or failed to load.

Link copied to clipboard
val loaded: Int

Total number of successfully loaded assets.

Link copied to clipboard

Current asset loading percent. Does not take failed assets into account.

Link copied to clipboard
val total: Int

Total number of scheduled assets.