Class FontPool

java.lang.Object
dev.prozilla.pine.common.asset.pool.AssetPool<Font>
dev.prozilla.pine.common.asset.pool.FontPool
All Implemented Interfaces:
MultiAssetLoader<Font>, Destructible

public final class FontPool extends AssetPool<Font> implements MultiAssetLoader<Font>
  • Constructor Details

    • FontPool

      public FontPool()
  • Method Details

    • load

      public Font load(String path, int size)
    • load

      public Font 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.

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

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

      public boolean remove(Font asset)
      Description copied from class: AssetPool
      Removes an asset from this pool.
      Overrides:
      remove in class AssetPool<Font>
      Parameters:
      asset - The asset to remove
      Returns:
      false if path does not match any asset in this pool.
    • prepareNext

      protected void prepareNext()
      Description copied from class: AssetPool
      Prepares this pool for the next asset.
      Overrides:
      prepareNext in class AssetPool<Font>
    • createKey

      protected String createKey(String path)
      Description copied from class: AssetPool
      Creates a key for the current asset.
      Overrides:
      createKey in class AssetPool<Font>
      Parameters:
      path - The normalized path of the asset
      Returns:
      The new key.
    • normalize

      protected String normalize(String path)
      Description copied from class: AssetPool
      Normalizes a path.
      Overrides:
      normalize in class AssetPool<Font>
      Parameters:
      path - The path
      Returns:
      The normalized path.