public final class Spritesheet
extends java.lang.Object
| Constructor and Description |
|---|
Spritesheet(java.awt.image.BufferedImage image,
java.lang.String path,
int spriteWidth,
int spriteHeight)
Instantiates a new spritesheet.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColumns()
Gets the sprites per row.
|
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.
|
int |
getSpriteWidth()
Gets the sprite width.
|
int |
getTotalNumberOfSprites()
Gets the total sprites.
|
boolean |
isLoaded() |
void |
setSpriteHeight(int spriteHeight) |
void |
setSpriteWidth(int spriteWidth) |
public Spritesheet(java.awt.image.BufferedImage image,
java.lang.String path,
int spriteWidth,
int spriteHeight)
spriteWidth and spriteHeight, the sub-images will be cropped
from the spritesheet image when accessing individual sprites.image - the spritesheet imagepath - the path (or name) of the spritesheet imagespriteWidth - the width in pixels of each sprite in the spritesheet.spriteHeight - the height in pixels of each sprite in the spritesheet.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 void setSpriteHeight(int spriteHeight)
public void setSpriteWidth(int spriteWidth)