com.b3dgs.lionengine.drawable
Interface TiledSprite

All Superinterfaces:
Image, Renderable, Sprite

public interface TiledSprite
extends Sprite

Tiled sprite are mainly used for tile based levels. It works by loading an image, and split it into differents images.


Method Summary
 int getHorizontalTiles()
          Get the number of horizontal tiles.
 java.awt.image.BufferedImage 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 getTileOriginalHeight()
          Get original tile height.
 int getTileOriginalWidth()
          Get original tile width.
 java.awt.image.BufferedImage getTileReference(int tile)
          Get a tile (as reference, faster).
 int getTilesNumber()
          Get the number of tiles.
 int getTileWidth()
          Get current tile width.
 int getVerticalTiles()
          Get the number of vertical tiles.
 TiledSprite instanciate()
          Get instancied version of current tiled sprite (shares the same surface).
 void render(java.awt.Graphics2D g, int tile, int x, int y)
          Render a tile to the specified coordinates.
 
Methods inherited from interface com.b3dgs.lionengine.drawable.Sprite
filter, flipHorizontal, flipVertical, getHeightOriginal, getSurface, getWidthOriginal, load, rotate, scale, setAlpha, setTransparency, stretch
 
Methods inherited from interface com.b3dgs.lionengine.drawable.Renderable
getHeight, getWidth, render
 

Method Detail

render

void render(java.awt.Graphics2D g,
            int tile,
            int x,
            int y)
Render a tile to the specified coordinates.

Parameters:
g - graphic output.
tile - tile to render.
x - abscissa.
y - ordinate.

getHorizontalTiles

int getHorizontalTiles()
Get the number of horizontal tiles.

Returns:
number of horizontal tiles.

getVerticalTiles

int getVerticalTiles()
Get the number of vertical tiles.

Returns:
number of vertical tiles.

getTilesNumber

int getTilesNumber()
Get the number of tiles.

Returns:
number of tiles.

getTileWidth

int getTileWidth()
Get current tile width.

Returns:
tile width.

getTileHeight

int getTileHeight()
Get current tile height.

Returns:
tile height.

getTileOriginalWidth

int getTileOriginalWidth()
Get original tile width.

Returns:
tile width.

getTileOriginalHeight

int getTileOriginalHeight()
Get original tile height.

Returns:
tile height.

getTile

java.awt.image.BufferedImage getTile(int tile)
Get a tile (store it on a new buffered image, no reference, can be slow !).

Parameters:
tile - desired tile.
Returns:
tile's surface.

getTileReference

java.awt.image.BufferedImage getTileReference(int tile)
Get a tile (as reference, faster).

Parameters:
tile - desired tile.
Returns:
tile's surface.

instanciate

TiledSprite instanciate()
Get instancied version of current tiled sprite (shares the same surface).

Specified by:
instanciate in interface Image
Specified by:
instanciate in interface Sprite
Returns:
cloned tiledsprite.