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")

Types

Link copied to clipboard

Optional parameters used to load text files.

Properties

Link copied to clipboard

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 resolve(p0: String): FileHandle
Link copied to clipboard