public interface SpriteTiled extends Sprite
Example:
// Load final SpriteTiled tilesheet = Drawable.loadSpriteTiled(Media.get("tilesheet.png"), 16, 16); tilesheet.load(false); // Render tilesheet.render(g, 1, 300, 300); tilesheet.render(g, 350, 300);
Modifier and Type | Method and Description |
---|---|
ImageBuffer |
getTile(int tile)
Get a tile (store it on a new buffered image, no reference, can be slow).
|
int |
getTileHeight()
Get current tile height.
|
int |
getTileHeightOriginal()
Get original tile height.
|
int |
getTilesHorizontal()
Get the number of horizontal tiles.
|
int |
getTilesNumber()
Get the number of tiles.
|
int |
getTilesVertical()
Get the number of vertical tiles.
|
int |
getTileWidth()
Get current tile width.
|
int |
getTileWidthOriginal()
Get original tile width.
|
void |
render(Graphic g,
int tile,
int x,
int y)
Render a tile to the specified coordinates.
|
filter, flipHorizontal, flipVertical, getHeightOriginal, getSurface, getWidthOriginal, load, render, rotate, scale, setAlpha, setTransparency, stretch
getHeight, getWidth
void render(Graphic g, int tile, int x, int y)
g
- The graphic output.tile
- The tile to render (>= 0).x
- The horizontal location..y
- The vertical location.int getTilesHorizontal()
int getTilesVertical()
int getTilesNumber()
int getTileWidth()
int getTileHeight()
int getTileWidthOriginal()
int getTileHeightOriginal()
ImageBuffer getTile(int tile)
tile
- The desired tile.