public final class Spritesheets extends ResourcesContainer<Spritesheet>
| Modifier and Type | Method and Description |
|---|---|
Spritesheet |
get(java.lang.String path)
Finds Spritesheets that were previously loaded by any load method or by the
sprites.info file.
|
Spritesheet |
get(java.lang.String resourceName,
boolean forceLoad)
Gets the resource with the specified name.
|
int[] |
getCustomKeyFrameDurations(Spritesheet sprite) |
int[] |
getCustomKeyFrameDurations(java.lang.String name) |
Spritesheet |
load(java.awt.image.BufferedImage image,
java.lang.String path,
int spriteWidth,
int spriteHeight) |
Spritesheet |
load(ITileset tileset) |
Spritesheet |
load(SpritesheetInfo info) |
protected Spritesheet |
load(java.lang.String resourceName) |
Spritesheet |
load(java.lang.String path,
int spriteWidth,
int spriteHeight) |
java.util.List<Spritesheet> |
loadFrom(java.lang.String spriteInfoFile)
The sprite info file must be located under the
GameInfo#getSpritesDirectory() directory.
|
Spritesheet |
remove(java.lang.String path)
Removes the resource with the specified name from this container.
|
void |
update(SpritesheetInfo info) |
add, addClearedListener, addContainerListener, clear, contains, contains, count, get, get, getAlias, getAll, getResources, removeClearedListener, removeContainerListener, tryGetpublic Spritesheet get(java.lang.String path)
get in class ResourcesContainer<Spritesheet>path - The path of the spritesheet.Spritesheet assotiated with the path or null if not
loaded yetpublic Spritesheet get(java.lang.String resourceName, boolean forceLoad)
ResourcesContainerIf not previously loaded, this method attempts to load the resource on the fly otherwise it will be retrieved from the cache.
get in class ResourcesContainer<Spritesheet>resourceName - The name of the game resource.forceLoad - If set to true, cached resource (if existing) will be discarded and the resource will be freshly loaded.public int[] getCustomKeyFrameDurations(java.lang.String name)
public int[] getCustomKeyFrameDurations(Spritesheet sprite)
public Spritesheet load(java.awt.image.BufferedImage image, java.lang.String path, int spriteWidth, int spriteHeight)
public Spritesheet load(ITileset tileset)
public Spritesheet load(SpritesheetInfo info)
public java.util.List<Spritesheet> loadFrom(java.lang.String spriteInfoFile)
spriteInfoFile - The path to the sprite info file.public Spritesheet load(java.lang.String path, int spriteWidth, int spriteHeight)
public Spritesheet remove(java.lang.String path)
ResourcesContainerremove in class ResourcesContainer<Spritesheet>path - The name of the resource that should be removed.public void update(SpritesheetInfo info)
protected Spritesheet load(java.lang.String resourceName)
load in class ResourcesContainer<Spritesheet>