Constructor and Description |
---|
DerivedSprite(Sprite s,
int x,
int y,
int width,
int height) |
Modifier and Type | Method and Description |
---|---|
void |
drawTile(Graphics2D g,
int x,
int y,
int width,
int height)
Draws a tile of this sprite.
|
int |
getColumns()
Get the number of columns.
|
int |
getRows()
Get the number of rows.
|
Sprite |
getSubSprite(int x,
int y,
int width,
int height)
Get sub-sprite with given dimension.
|
BufferedImage |
getTile(int x,
int y)
Get a tile of this sprite.
|
int |
getTileCount()
Get the number of tiles in this sprite.
|
int |
getTileHeight()
Get the height of one tile
|
int |
getTileWidth()
Get the width of one tile
|
public DerivedSprite(Sprite s, int x, int y, int width, int height)
public void drawTile(Graphics2D g, int x, int y, int width, int height)
Bounds(0, 0,
width, height)
.public BufferedImage getTile(int x, int y)
Sprite
Sprite.drawTile(Graphics2D, int, int, int, int)
for faster action and less memory
usage.getTile
in interface Sprite
x
- X-Coordinate of the tiley
- Y-Coordinate of the tileBufferedImage
containing the tilepublic int getTileCount()
getTileCount
in interface Sprite
public int getColumns()
getColumns
in interface Sprite
public int getTileWidth()
getTileWidth
in interface Sprite
public int getTileHeight()
getTileHeight
in interface Sprite
public Sprite getSubSprite(int x, int y, int width, int height)
Sprite
DerivedSprite
is linked with this
sprite.getSubSprite
in interface Sprite
x
- X-Coordinate of first tiley
- Y-Coordinate of first tilewidth
- Width of the sub-spriteheight
- Height of the sub-spriteDerivedSprite
Copyright © 2017. All rights reserved.