loadAsync

inline fun <T> loadAsync(path: String, parameters: AssetLoaderParameters<T>? = null): Deferred<T>

Schedules asynchronous loading of a selected asset with T class. path must point to an existing file representing the asset, as it will be passed to the FileHandleResolver to obtain a file reference. Loader parameters are optional, and can be used to customize loading of the asset. If no parameters are given, they will be obtained with getDefaultParameters.

Returns a Deferred instance which will be completed with a reference to the loaded asset as soon as it is fully loaded, or with an exception if it occurs during loading of the asset or any of its dependencies. The possible exceptions include DependencyLoadingException if one of the asset's dependencies failed to load, or any exception thrown by the asset loader.


fun <T> loadAsync(assetDescriptor: AssetDescriptor<T>): Deferred<T>

Schedules asynchronous loading of a selected asset with T class specified by the assetDescriptor. If AssetDescriptor.params are not defined, they will be obtained with getDefaultParameters.

Returns a Deferred instance which will be completed with a reference to the loaded asset as soon as it is fully loaded, or with an exception if it occurs during loading of the asset or any of its dependencies. The possible exceptions include DependencyLoadingException if one of the asset's dependencies failed to load, or any exception thrown by the asset loader.