Interface AssetLoadingFragment
- All Superinterfaces:
Fragment
A fragment that loads assets using the provided AssetManager. This is like the
AsyncAssetLoadingFragment
but it is called from the main thread.
It is easier to use than the AsyncAssetLoadingFragment
for simple asset loading tasks but risks
blocking the main thread if the asset loading takes too long.-
Method Summary
Modifier and TypeMethodDescriptionvoid
loadAssets
(ComponentManager mng, AssetManager assetManager, DataStore assetCache, Consumer<Object> preload) Load assets using the provided AssetManager.
-
Method Details
-
loadAssets
void loadAssets(ComponentManager mng, AssetManager assetManager, DataStore assetCache, Consumer<Object> preload) Load assets using the provided AssetManager. The reference to the AssetManager can be stored and used later in the component logic.- Parameters:
mng
- the ComponentManager instanceassetManager
- the AssetManager instanceassetCache
- the DataStore to use for caching assetspreload
- a consumer that can be called for each assets to preload. It will start uploading the asset to the gpu as soon as possible.
-