Constructor and Description |
---|
Tileset() |
Modifier and Type | Method and Description |
---|---|
void |
calculateLastGid() |
boolean |
contains(int tileId)
Returns true if this tileset contains the tile with the given id
|
void |
drawTile(Graphics g,
int tileId,
int renderX,
int renderY)
Draws a tile to the
Graphics context |
void |
drawTileset(Graphics g,
int renderX,
int renderY)
Draws the whole tileset to the
Graphics context |
int |
getFirstGid()
Returns the first GID https://github.com/bjorn/tiled/wiki/TMX-Map-Format
|
int |
getHeight()
Returns the height of this tileset in pixels
|
int |
getHeightInTiles()
Returns the height of this tileset in tiles
|
int |
getMargin()
Returns the margin at the borders of the tileset
|
String |
getName()
Returns the name of this tileset
|
int |
getSpacing()
Returns the internal spacing between each tile
|
int |
getTileHeight()
Returns the height of each tile in pixels
|
com.badlogic.gdx.graphics.g2d.TextureRegion |
getTileImage(int tileId)
Returns the
TextureRegion for a given tile id |
String |
getTilesetImagePath()
Returns the relative path of the tileset image
|
int |
getTileWidth()
Returns the width of each tile in pixels
|
int |
getTileX(int tileId)
Returns the x coordinate of a tile within this tileset
|
int |
getTileY(int tileId)
Returns the y coordinate of a tile within this tileset
|
String |
getTransparentColorValue() |
int |
getWidth()
Returns the width of this tileset in pixels
|
int |
getWidthInTiles()
Returns the width of this tileset in tiles
|
boolean |
isTextureLoaded()
Returns if the tileset image has been loaded
|
void |
loadTexture(com.badlogic.gdx.files.FileHandle tmxDirectory)
Loads the tileset image
|
void |
setFirstGid(int firstGid)
Sets the first GID https://github.com/bjorn/tiled/wiki/TMX-Map-Format
|
void |
setHeight(int height)
Sets the height of this tileset in pixels
|
void |
setMargin(int margin)
Sets the margin at the borders of the tileset
|
void |
setName(String name)
Sets the name of this tileset
|
void |
setSpacing(int spacing)
Sets the internal spacing between each tile
|
void |
setTileHeight(int tileHeight)
Sets the height of each tile in pixels
|
void |
setTilesetImagePath(String tilesetImagePath)
Sets the relative path of the tileset image
|
void |
setTileWidth(int tileWidth)
Sets the width of each tile in pixels
|
void |
setTransparentColorValue(String transparentColorValue) |
void |
setWidth(int width)
Sets the width of this tileset in pixels
|
public void drawTile(Graphics g, int tileId, int renderX, int renderY)
Graphics
contextg
- The Graphics
context available for renderingtileId
- The tile id to renderrenderX
- The X coordinate to render atrenderY
- The Y coordinate to render atpublic void drawTileset(Graphics g, int renderX, int renderY)
Graphics
contextg
- The Graphics
context available for renderingrenderX
- The X coordinate to render atrenderY
- The Y coordinate to render atpublic com.badlogic.gdx.graphics.g2d.TextureRegion getTileImage(int tileId)
TextureRegion
for a given tile idtileId
- The tile id to look uppublic boolean isTextureLoaded()
public void loadTexture(com.badlogic.gdx.files.FileHandle tmxDirectory)
tmxDirectory
- The directory containing the TMX files for the
TiledMap
that has loaded this tilesetpublic void calculateLastGid()
public boolean contains(int tileId)
tileId
- The tile id to search forpublic int getTileX(int tileId)
tileId
- The tile id to get the x coordinate forpublic int getTileY(int tileId)
tileId
- The tile id to get the y coordinate forpublic int getWidthInTiles()
public int getHeightInTiles()
public String getName()
public void setName(String name)
name
- The name to setpublic int getWidth()
public void setWidth(int width)
width
- The width in pixelspublic int getHeight()
public void setHeight(int height)
height
- The height in pixelspublic int getTileWidth()
public void setTileWidth(int tileWidth)
tileWidth
- The width in pixelspublic int getTileHeight()
public void setTileHeight(int tileHeight)
tileHeight
- The height in pixelspublic int getSpacing()
public void setSpacing(int spacing)
spacing
- The spacing in pixelspublic int getMargin()
public void setMargin(int margin)
margin
- The margin in pixelspublic int getFirstGid()
public void setFirstGid(int firstGid)
firstGid
- public String getTilesetImagePath()
public void setTilesetImagePath(String tilesetImagePath)
tilesetImagePath
- public String getTransparentColorValue()
public void setTransparentColorValue(String transparentColorValue)
Copyright © 2014. All rights reserved.