TextAssetLoader
class TextAssetLoader(fileResolver: FileHandleResolver = InternalFileHandleResolver(), charset: String = "UTF-8") : AsynchronousAssetLoader<String, TextAssetLoader.TextAssetLoaderParameters>
Allows reading text files with an AssetManager. Must be registered via setLoader.
Note that loadAsync must be called before loadSync, as usual in case of AsynchronousAssetLoader implementations. Similarly to standard libGDX loaders, this loader is not considered thread-safe and assumes that a single file is loaded at a time.
Parameters
fileResolver
not used, required by the superclass.
charset
name of the charset used to read text. Can be overridden with TextAssetLoader.TextAssetLoaderParameters. Should match text files encoding. Defaults to UTF-8.
Constructors
Link copied to clipboard
constructor(fileResolver: FileHandleResolver = InternalFileHandleResolver(), charset: String = "UTF-8")
Functions
Link copied to clipboard
open override fun getDependencies(fileName: String?, file: FileHandle?, parameter: TextAssetLoader.TextAssetLoaderParameters?): Array<AssetDescriptor<Any>>?
Link copied to clipboard
open override fun loadAsync(assetManager: AssetManager?, fileName: String?, file: FileHandle, parameter: TextAssetLoader.TextAssetLoaderParameters?)
Link copied to clipboard
open override fun loadSync(assetManager: AssetManager?, fileName: String?, file: FileHandle, parameter: TextAssetLoader.TextAssetLoaderParameters?): String
Link copied to clipboard
open fun unloadAsync(p0: AssetManager, p1: String, p2: FileHandle, p3: TextAssetLoader.TextAssetLoaderParameters)