Package com.badlogic.gdx.maps.tiled
Class TiledMapTileSet
- java.lang.Object
-
- com.badlogic.gdx.maps.tiled.TiledMapTileSet
-
- All Implemented Interfaces:
java.lang.Iterable<TiledMapTile>
public class TiledMapTileSet extends java.lang.Object implements java.lang.Iterable<TiledMapTile>
-
-
Constructor Summary
Constructors Constructor Description TiledMapTileSet()
Creates empty tileset
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
MapProperties
getProperties()
TiledMapTile
getTile(int id)
Gets theTiledMapTile
that has the given id.java.util.Iterator<TiledMapTile>
iterator()
void
putTile(int id, TiledMapTile tile)
Adds or replaces tile with that idvoid
removeTile(int id)
void
setName(java.lang.String name)
int
size()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- tileset's name
-
setName
public void setName(java.lang.String name)
- Parameters:
name
- new name for the tileset
-
getProperties
public MapProperties getProperties()
- Returns:
- tileset's properties set
-
getTile
public TiledMapTile getTile(int id)
Gets theTiledMapTile
that has the given id.- Parameters:
id
- the id of theTiledMapTile
to retrieve.- Returns:
- tile matching id, null if it doesn't exist
-
iterator
public java.util.Iterator<TiledMapTile> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<TiledMapTile>
- Returns:
- iterator to tiles in this tileset
-
putTile
public void putTile(int id, TiledMapTile tile)
Adds or replaces tile with that id- Parameters:
id
- the id of theTiledMapTile
to add or replace.tile
- theTiledMapTile
to add or replace.
-
removeTile
public void removeTile(int id)
- Parameters:
id
- tile's id to be removed
-
size
public int size()
- Returns:
- the size of this TiledMapTileSet.
-
-