public class I18NBundleLoader extends AsynchronousAssetLoader<I18NBundle,I18NBundleLoader.I18NBundleParameter>
AssetLoader for I18NBundle instances. The I18NBundle is loaded asynchronously.
Notice that you can't load two bundles with the same base name and different locale or encoding using the same AssetManager.
For example, if you try to load the 2 bundles below
manager.load("i18n/message", I18NBundle.class, new I18NBundleParameter(Locale.ITALIAN));
manager.load("i18n/message", I18NBundle.class, new I18NBundleParameter(Locale.ENGLISH));
the English bundle won't be loaded because the asset manager thinks they are the same bundle since they have the same name.
There are 2 use cases:
| Modifier and Type | Class and Description |
|---|---|
static class |
I18NBundleLoader.I18NBundleParameter |
| Constructor and Description |
|---|
I18NBundleLoader(FileHandleResolver resolver) |
| Modifier and Type | Method and Description |
|---|---|
Array<AssetDescriptor> |
getDependencies(java.lang.String fileName,
FileHandle file,
I18NBundleLoader.I18NBundleParameter parameter)
Returns the assets this asset requires to be loaded first.
|
void |
loadAsync(AssetManager manager,
java.lang.String fileName,
FileHandle file,
I18NBundleLoader.I18NBundleParameter parameter)
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.
|
I18NBundle |
loadSync(AssetManager manager,
java.lang.String fileName,
FileHandle file,
I18NBundleLoader.I18NBundleParameter parameter)
Loads the OpenGL part of the asset.
|
resolvepublic I18NBundleLoader(FileHandleResolver resolver)
public void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, I18NBundleLoader.I18NBundleParameter parameter)
AsynchronousAssetLoaderloadAsync in class AsynchronousAssetLoader<I18NBundle,I18NBundleLoader.I18NBundleParameter>fileName - the name of the asset to loadfile - the resolved file to loadparameter - the parameters to use for loading the assetpublic I18NBundle loadSync(AssetManager manager, java.lang.String fileName, FileHandle file, I18NBundleLoader.I18NBundleParameter parameter)
AsynchronousAssetLoaderloadSync in class AsynchronousAssetLoader<I18NBundle,I18NBundleLoader.I18NBundleParameter>file - the resolved file to loadpublic Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle file, I18NBundleLoader.I18NBundleParameter parameter)
AssetLoadergetDependencies in class AssetLoader<I18NBundle,I18NBundleLoader.I18NBundleParameter>fileName - name of the asset to loadfile - the resolved file to loadparameter - parameters for loading the asset