|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.tiled.TileSet
public class TileSet
A holder for tileset information
Field Summary | |
---|---|
int |
firstGID
The first global tile id in the set |
int |
index
The index of the tile set |
int |
lastGID
The local global tile id in the set |
java.lang.String |
name
The name of the tile set |
int |
tileHeight
The height of the tiles |
protected int |
tileMargin
The margin of the tileset |
SpriteSheet |
tiles
The image containing the tiles |
int |
tilesAcross
The number of tiles across the sprite sheet |
int |
tilesDown
The number of tiles down the sprite sheet |
protected int |
tileSpacing
The padding of the tiles |
int |
tileWidth
The width of the tiles |
Constructor Summary | |
---|---|
TileSet(TiledMap map,
org.w3c.dom.Element element,
boolean loadImage)
Create a tile set based on an XML definition |
Method Summary | |
---|---|
boolean |
contains(int gid)
Check if this tileset contains a particular tile |
java.util.Properties |
getProperties(int globalID)
Get the properties for a specific tile in this tileset |
int |
getTileHeight()
Get the height of each tile in this set |
int |
getTileMargin()
Get the margin around tiles in this set |
int |
getTileSpacing()
Get the spacing between tiles in this set |
int |
getTileWidth()
Get the width of each tile in this set |
int |
getTileX(int id)
Get the x position of a tile on this sheet |
int |
getTileY(int id)
Get the y position of a tile on this sheet |
void |
setLimit(int limit)
Set the limit of the tiles in this set |
void |
setTileSetImage(Image image)
Set the image to use for this sprite sheet image to use for this tileset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int index
public java.lang.String name
public int firstGID
public int lastGID
public int tileWidth
public int tileHeight
public SpriteSheet tiles
public int tilesAcross
public int tilesDown
protected int tileSpacing
protected int tileMargin
Constructor Detail |
---|
public TileSet(TiledMap map, org.w3c.dom.Element element, boolean loadImage) throws SlickException
element
- The XML describing the tilesetmap
- The map this tileset was loaded from (gives context to paths)loadImage
- True if we should load the image (useful in headless mode)
SlickException
- Indicates a failure to parse the tilesetMethod Detail |
---|
public int getTileWidth()
public int getTileHeight()
public int getTileSpacing()
public int getTileMargin()
public void setTileSetImage(Image image)
image
- The image to use for this tilesetpublic java.util.Properties getProperties(int globalID)
globalID
- The global ID of the tile whose properties should be retrieved
public int getTileX(int id)
id
- The tileset specific ID (i.e. not the global one)
public int getTileY(int id)
id
- The tileset specific ID (i.e. not the global one)
public void setLimit(int limit)
limit
- The limit of the tiles in this setpublic boolean contains(int gid)
gid
- The global id to seach for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |