public class ImageTilesetSource extends TilesetSource
TilesetSource referenced by image directly in a TMX file| Constructor and Description |
|---|
ImageTilesetSource(int width,
int height,
int tileWidth,
int tileHeight,
int spacing,
int margin) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsProperty(java.lang.String propertyName)
Returns if the tileset contains the specified property
|
void |
dispose() |
void |
drawTile(Graphics g,
int tileId,
int firstGid,
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 |
com.badlogic.gdx.utils.Array<com.badlogic.gdx.assets.AssetDescriptor> |
getDependencies(com.badlogic.gdx.files.FileHandle tmxPath)
Returns the dependencies of this source
|
int |
getHeight()
Returns the height of this tileset in pixels
|
int |
getHeightInTiles()
Returns the height of this source in tiles
|
int |
getMargin()
Returns the margin at the borders of the tileset
|
java.lang.String |
getName() |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Returns the properties
Map of this Tileset |
java.lang.String |
getProperty(java.lang.String propertyName)
Returns the value of a specified property
|
int |
getSpacing()
Returns the internal spacing between each tile
|
Tile |
getTile(int tileId,
int firstGid)
Returns the
Tile for a given tile id |
Tile |
getTileByPosition(int x,
int y)
Returns the
Tile for a given x/y coordinate with the tileset
source |
int |
getTileHeight()
Returns the height of each tile in pixels
|
Sprite |
getTileImage(int tileId)
Returns the
Sprite for a given tile |
java.lang.String |
getTilesetImagePath() |
int |
getTileWidth()
Returns the width of each tile in pixels
|
java.lang.String |
getTransparentColorValue() |
int |
getWidth()
Returns the width of this tileset in pixels
|
int |
getWidthInTiles()
Returns the width of this source in tiles
|
boolean |
isTextureLoaded()
Returns if the tileset texture image is loaded
|
void |
loadTexture(com.badlogic.gdx.assets.AssetManager assetManager,
com.badlogic.gdx.files.FileHandle tmxPath)
Loads the tileset's texture image
|
void |
loadTexture(com.badlogic.gdx.files.FileHandle tmxPath)
Loads the tileset's texture image
|
void |
setName(java.lang.String name) |
void |
setProperty(java.lang.String propertyName,
java.lang.String value)
Sets the value of a specified property
|
void |
setTilesetImagePath(java.lang.String tilesetImagePath) |
void |
setTransparentColorValue(java.lang.String transparentColorValue) |
contains, getTileId, getTileImage, getTileX, getTileYpublic ImageTilesetSource(int width,
int height,
int tileWidth,
int tileHeight,
int spacing,
int margin)
public com.badlogic.gdx.utils.Array<com.badlogic.gdx.assets.AssetDescriptor> getDependencies(com.badlogic.gdx.files.FileHandle tmxPath)
TilesetSourcegetDependencies in class TilesetSourcetmxPath - The path of the TMX filepublic void loadTexture(com.badlogic.gdx.files.FileHandle tmxPath)
TilesetSourceloadTexture in class TilesetSourcetmxPath - The path of the TMX filepublic void loadTexture(com.badlogic.gdx.assets.AssetManager assetManager,
com.badlogic.gdx.files.FileHandle tmxPath)
TilesetSourceloadTexture in class TilesetSourceassetManager - The AssetManager to usetmxPath - The path of the TMX filepublic boolean isTextureLoaded()
TilesetSourceisTextureLoaded in class TilesetSourcepublic Sprite getTileImage(int tileId)
TilesetSourceSprite for a given tilegetTileImage in class TilesetSourcetileId - The tile id to retrieveSprite or null if that textures haven't been loadedpublic int getWidthInTiles()
TilesetSourcegetWidthInTiles in class TilesetSourcepublic int getHeightInTiles()
TilesetSourcegetHeightInTiles in class TilesetSourcepublic Tile getTileByPosition(int x, int y)
TilesetSourceTile for a given x/y coordinate with the tileset
sourcegetTileByPosition in class TilesetSourcex - The x coordinate of the tile within the tileset (in tiles)y - The y coordinate of the tile within the tileset (in tiles)Tilepublic Tile getTile(int tileId, int firstGid)
TilesetSourceTile for a given tile idgetTile in class TilesetSourcetileId - The tile id to look upfirstGid - The first gid for the tilesetTilepublic void drawTile(Graphics g, int tileId, int firstGid, int renderX, int renderY)
TilesetSourceGraphics contextdrawTile in class TilesetSourceg - The Graphics context available for renderingtileId - The tile id to renderfirstGid - The first gid of the parent tilesetrenderX - The X coordinate to render atrenderY - The Y coordinate to render atpublic void drawTileset(Graphics g, int renderX, int renderY)
TilesetSourceGraphics contextdrawTileset in class TilesetSourceg - The Graphics context available for renderingrenderX - The X coordinate to render atrenderY - The Y coordinate to render atpublic boolean containsProperty(java.lang.String propertyName)
TilesetSourcecontainsProperty in class TilesetSourcepropertyName - The property name to search forpublic java.lang.String getProperty(java.lang.String propertyName)
TilesetSourcegetProperty in class TilesetSourcepropertyName - The property name to search forpublic void setProperty(java.lang.String propertyName,
java.lang.String value)
TilesetSourcesetProperty in class TilesetSourcepropertyName - The property name to set the value forvalue - The value of the property to setpublic java.util.Map<java.lang.String,java.lang.String> getProperties()
TilesetSourceMap of this TilesetgetProperties in class TilesetSourcepublic int getWidth()
TilesetSourcegetWidth in class TilesetSourcepublic int getHeight()
TilesetSourcegetHeight in class TilesetSourcepublic int getTileWidth()
TilesetSourcegetTileWidth in class TilesetSourcepublic int getTileHeight()
TilesetSourcegetTileHeight in class TilesetSourcepublic int getSpacing()
TilesetSourcegetSpacing in class TilesetSourcepublic int getMargin()
TilesetSourcegetMargin in class TilesetSourcepublic java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getTilesetImagePath()
public void setTilesetImagePath(java.lang.String tilesetImagePath)
public java.lang.String getTransparentColorValue()
public void setTransparentColorValue(java.lang.String transparentColorValue)
public void dispose()