Class ImagePool

java.lang.Object
dev.prozilla.pine.common.asset.pool.AssetPool<Image>
dev.prozilla.pine.common.asset.pool.ImagePool
All Implemented Interfaces:
Destructible

public final class ImagePool extends AssetPool<Image>
  • Constructor Details

    • ImagePool

      public ImagePool()
  • Method Details

    • load

      public Image load(String path)
      Description copied from class: AssetPool
      Loads an asset from a path or retrieves it from the pool if it has already been loaded once.

      This method is protected because some subclasses may require additional parameters to load an asset.

      Overrides:
      load in class AssetPool<Image>
      Parameters:
      path - The path of the asset
      Returns:
      The asset, or null if it failed to load.
    • createAsset

      protected Image createAsset(String path)
      Description copied from class: AssetPool
      Creates a new asset from a normalized path.
      Specified by:
      createAsset in class AssetPool<Image>
      Parameters:
      path - The normalized path
      Returns:
      The new asset, or null if the asset creation failed.
    • printInfo

      public void printInfo(Logger logger)
      Logs the amount of images in the resource pool per resolution.
      Overrides:
      printInfo in class AssetPool<Image>