Package arc.assets.loaders
Class I18NBundleLoader
java.lang.Object
arc.assets.loaders.AssetLoader<T,P>
arc.assets.loaders.AsynchronousAssetLoader<I18NBundle,I18NBundleLoader.I18NBundleParameter>
arc.assets.loaders.I18NBundleLoader
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:
- If you want to load the English bundle so to replace the Italian bundle you have to unload the Italian bundle first.
- If you want to load the English bundle without replacing the Italian bundle you should use another asset manager.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDependencies
(String fileName, Fi file, I18NBundleLoader.I18NBundleParameter parameter) Returns the assets this asset requires to be loaded first.void
loadAsync
(AssetManager manager, String fileName, Fi file, I18NBundleLoader.I18NBundleParameter parameter) Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.loadSync
(AssetManager manager, String fileName, Fi file, I18NBundleLoader.I18NBundleParameter parameter) Loads the OpenGL part of the asset.Methods inherited from class arc.assets.loaders.AssetLoader
resolve
-
Constructor Details
-
I18NBundleLoader
-
-
Method Details
-
loadAsync
public void loadAsync(AssetManager manager, String fileName, Fi file, I18NBundleLoader.I18NBundleParameter parameter) Description copied from class:AsynchronousAssetLoader
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.- Specified by:
loadAsync
in classAsynchronousAssetLoader<I18NBundle,
I18NBundleLoader.I18NBundleParameter> fileName
- the name of the asset to loadfile
- the resolved file to loadparameter
- the parameters to use for loading the asset
-
loadSync
public I18NBundle loadSync(AssetManager manager, String fileName, Fi file, I18NBundleLoader.I18NBundleParameter parameter) Description copied from class:AsynchronousAssetLoader
Loads the OpenGL part of the asset.- Specified by:
loadSync
in classAsynchronousAssetLoader<I18NBundle,
I18NBundleLoader.I18NBundleParameter> file
- the resolved file to load
-
getDependencies
public Seq<AssetDescriptor> getDependencies(String fileName, Fi file, I18NBundleLoader.I18NBundleParameter parameter) Description copied from class:AssetLoader
Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.- Specified by:
getDependencies
in classAssetLoader<I18NBundle,
I18NBundleLoader.I18NBundleParameter> - Parameters:
fileName
- name of the asset to loadfile
- the resolved file to loadparameter
- parameters for loading the asset- Returns:
- other assets that the asset depends on and need to be loaded first or null if there are no dependencies.
-