Class AssetManager

java.lang.Object
buildengine.utils.AssetManager

public class AssetManager extends Object
This class allows you to load assets and automatically saves it in cache.
Author:
Kai van Maurik
  • Method Details

    • getImage

      public static BufferedImage getImage(String path)
      Gets an image, either from cache by name, or from disk by path.
      Parameters:
      path - The name of the pre-loaded image, or the path to the newly loaded image.
    • getAudio

      public static AudioClip getAudio(String path)
      Gets an audio clip, either from cache by name, or from disk by path.
      Parameters:
      path - The name of the pre-loaded audio clip, or the path to the newly loaded audio clip.
    • loadAnimation

      public static Animation loadAnimation(String pathOrName, int speed, Dimension frameDimension, int startRow, int frameCount)
      Load an animation from a 1-row sprite sheet
      Parameters:
      pathOrName - The pathOrName to the sprite sheet
      speed - The time in ms to the next frame
      frameDimension - The dimension of one frame
      startRow - The start row (0 if you have just one row)
      Returns:
      Get the animation object from a sprite sheet
    • loadAnimation

      public static Animation loadAnimation(String path, int speed, Dimension frameDimension)
    • loadSoundEffect

      public static SoundEffect loadSoundEffect(String... names)