public final class Spritesheet
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
static java.util.Collection<Spritesheet> |
find(java.util.function.Predicate<Spritesheet> pred) |
static Spritesheet |
find(java.lang.String path)
Finds Spritesheets that were previously loaded by any load method or by the
sprites.info file.
|
int |
getColumns()
Gets the sprites per row.
|
static int[] |
getCustomKeyFrameDurations(Spritesheet sprite) |
static int[] |
getCustomKeyFrameDurations(java.lang.String name) |
java.awt.image.BufferedImage |
getImage() |
ImageFormat |
getImageFormat() |
java.lang.String |
getName()
The unique name of this spritesheet.
|
java.awt.image.BufferedImage |
getPreview(int dimension) |
int |
getRows() |
java.awt.image.BufferedImage |
getSprite(int index) |
java.awt.image.BufferedImage |
getSprite(int index,
int margin,
int spacing) |
int |
getSpriteHeight()
Gets the sprite height.
|
static java.util.Collection<Spritesheet> |
getSpritesheets() |
int |
getSpriteWidth()
Gets the sprite width.
|
int |
getTotalNumberOfSprites()
Gets the total sprites.
|
int |
hashCode() |
boolean |
isLoaded() |
static Spritesheet |
load(java.awt.image.BufferedImage image,
java.lang.String path,
int spriteWidth,
int spriteHeight) |
static Spritesheet |
load(ITileset tileset) |
static Spritesheet |
load(SpritesheetInfo info) |
static java.util.List<Spritesheet> |
load(java.lang.String spriteInfoFile)
The sprite info file must be located under the
GameInfo#getSpritesDirectory() directory.
|
static Spritesheet |
load(java.lang.String path,
int spriteWidth,
int spriteHeight) |
static Spritesheet |
remove(java.lang.String path) |
void |
setSpriteHeight(int spriteHeight) |
void |
setSpriteWidth(int spriteWidth) |
static void |
update(SpritesheetInfo info) |
public static java.util.Collection<Spritesheet> getSpritesheets()
public static Spritesheet find(java.lang.String path)
path - The path of the spritesheet.Spritesheet assotiated with the path or null if not
loaded yetpublic static java.util.Collection<Spritesheet> find(java.util.function.Predicate<Spritesheet> pred)
public static int[] getCustomKeyFrameDurations(java.lang.String name)
public static int[] getCustomKeyFrameDurations(Spritesheet sprite)
public static Spritesheet load(java.awt.image.BufferedImage image, java.lang.String path, int spriteWidth, int spriteHeight)
public static Spritesheet load(ITileset tileset)
public static Spritesheet load(SpritesheetInfo info)
public static java.util.List<Spritesheet> load(java.lang.String spriteInfoFile)
spriteInfoFile - The path to the sprite info file.public static Spritesheet load(java.lang.String path, int spriteWidth, int spriteHeight)
public static Spritesheet remove(java.lang.String path)
public static void update(SpritesheetInfo info)
public int getColumns()
public java.awt.image.BufferedImage getPreview(int dimension)
public java.awt.image.BufferedImage getImage()
public ImageFormat getImageFormat()
public java.lang.String getName()
public int getRows()
public java.awt.image.BufferedImage getSprite(int index)
public java.awt.image.BufferedImage getSprite(int index,
int margin,
int spacing)
public int getSpriteHeight()
public int getSpriteWidth()
public int getTotalNumberOfSprites()
public boolean isLoaded()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic void setSpriteHeight(int spriteHeight)
public void setSpriteWidth(int spriteWidth)