Package buildengine.utils
Class AssetManager
java.lang.Object
buildengine.utils.AssetManager
This class allows you to load assets and automatically saves it in cache.
- Author:
- Kai van Maurik
-
Method Summary
Modifier and TypeMethodDescriptionstatic AudioClipGets an audio clip, either from cache by name, or from disk by path.static BufferedImageGets an image, either from cache by name, or from disk by path.static AnimationloadAnimation(String path, int speed, Dimension frameDimension) static AnimationloadAnimation(String pathOrName, int speed, Dimension frameDimension, int startRow, int frameCount) Load an animation from a 1-row sprite sheetstatic SoundEffectloadSoundEffect(String... names)
-
Method Details
-
getImage
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
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 sheetspeed- The time in ms to the next frameframeDimension- The dimension of one framestartRow- The start row (0 if you have just one row)- Returns:
- Get the animation object from a sprite sheet
-
loadAnimation
-
loadSoundEffect
-