toAssetDescriptor

fun toAssetDescriptor(parameters: AssetLoaderParameters<T>? = null, fileHandle: FileHandle? = null): AssetDescriptor<T>

Converts this Identifier to an AssetDescriptor that describes the asset and its loading data.

If the returned AssetDescriptor is used to load an asset, and the asset requires specific loading instructions, make sure to pass the loading parameters to set AssetDescriptor.parameters. Similarly, if the asset requires a custom FileHandle incompatible with AssetStorage.fileResolver, pass the fileHandle parameter to set it as AssetDescriptor.file.

If the AssetDescriptor is used to simply identify an asset similarly to an Identifier, parameters and fileHandle are not required. You can retrieve a loaded asset from the AssetStorage with either its Identifier or an AssetDescriptor without loading data - the parameters and file are only used when calling AssetStorage.load.