Interface AssetLoadingFragment

All Superinterfaces:
Fragment

public interface AssetLoadingFragment extends 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 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 instance
      assetManager - the AssetManager instance
      assetCache - the DataStore to use for caching assets
      preload - a consumer that can be called for each assets to preload. It will start uploading the asset to the gpu as soon as possible.