getAssetDescriptor

inline fun <T> getAssetDescriptor(path: String, parameters: AssetLoaderParameters<T>? = null, fileHandle: FileHandle? = null): AssetDescriptor<T>

Creates a new AssetDescriptor for the selected asset.

T is type of the loaded asset. path to the file should be consistent with fileResolver asset type. Loading parameters are optional and passed to the associated AssetLoader. Returns a new instance of AssetDescriptor with a resolved FileHandle.

If the asset requires a FileHandle incompatible with the storage fileResolver, use the fileHandle parameter to set it.

Top-level (static) alternatives can be found in ktx-assets. See ktx.assets.assetDescriptor.