public class TiledTileset extends TiledResource implements TiledCustomizable
A TiledTileset represents a tileset. It corresponds to a <tileset> tag in a Tiled XML file.
Modifier and Type | Class and Description |
---|---|
static class |
TiledTileset.GridOrientation
Represents an orientation that a tileset's tile grid can have.
|
static class |
TiledTileset.ObjectAlignment
Represents an alignment that tile objects using a tileset's tiles can
have.
|
Modifier and Type | Method and Description |
---|---|
int |
getGridHeight()
Returns the height in pixels of the cells in this tileset's tile grid (by
default, equal to getTileHeight()).
|
TiledTileset.GridOrientation |
getGridOrientation()
Returns the orientation of this tileset's tile grid
(
TiledTileset.GridOrientation.ORTHOGONAL by default). |
int |
getGridWidth()
Returns the width in pixels of the cells in this tileset's tile grid (by
default, equal to getTileWidth()).
|
int |
getHeight()
Returns this tileset's height in tiles, or -1 if this tileset is an image
collection tileset.
|
TiledImage |
getImage()
Returns this tileset's image if it is a single-image tileset, or null if
it is an image collection tileset.
|
int |
getMargin()
Returns the margin in pixels around this tileset's tiles in the tileset's
image (0 by default).
|
String |
getName()
Returns this tileset's name.
|
TiledTileset.ObjectAlignment |
getObjectAlignment()
Returns the alignment type of tile objects using this tileset's tiles
(
TiledTileset.ObjectAlignment.UNSPECIFIED by default). |
Map<String,Object> |
getProperties()
Returns an unmodifiable Map view of this entity's custom properties.
|
Object |
getProperty(String name)
Returns the value of this entity's custom property with the specified
name, or null if no such property was specified.
|
int |
getSpacing()
Returns the spacing in pixels between this tileset's tiles in the
tileset's image (0 by default).
|
List<TiledTerrainType> |
getTerrainTypes()
Returns an unmodifiable List view of this tileset's terrain types.
|
TiledTile |
getTile(int id)
Returns the tile in this tileset with the specified local ID, or null if
there is none.
|
TiledTile |
getTile(int x,
int y)
Returns the tile at the specified location in this tileset, if this
tileset is a single-image tileset.
|
int |
getTileHeight()
Returns the height in pixels of each of this tileset's tiles.
|
int |
getTileOffsetX()
Returns the horizontal rendering offset in pixels of this tileset's tiles
(0 by default).
|
int |
getTileOffsetY()
Returns the vertical rendering offset in pixels of this tileset's tiles
(0 by default).
|
Collection<TiledTile> |
getTiles()
Returns an unmodifiable Collection view of this tileset's tiles.
|
int |
getTileWidth()
Returns the width in pixels of each of this tileset's tiles.
|
List<TiledWangSet> |
getWangSets()
Returns an unmodifiable List view of this tileset's Wang sets.
|
int |
getWidth()
Returns this tileset's width in tiles, or -1 if this tileset is an image
collection tileset.
|
getPath, getReader
public final String getName()
public final int getTileWidth()
public final int getTileHeight()
public final int getSpacing()
public final int getMargin()
public final Collection<TiledTile> getTiles()
public final TiledTile getTile(int id)
id
- The local ID of the tile to returnpublic final int getWidth()
public final int getHeight()
public final TiledTile getTile(int x, int y)
x
- The x-coordinate in tiles of the location. x-coordinates range
from 0 to getWidth() - 1, increasing from left to right.y
- The y-coordinate in tiles of the location. y-coordinates range
from 0 to getHeight() - 1, increasing from top to bottom.UnsupportedOperationException
- if this tileset is an image
collection tilesetIndexOutOfBoundsException
- if the location is out of this
tileset's boundspublic final int getTileOffsetX()
public final int getTileOffsetY()
public final TiledTileset.ObjectAlignment getObjectAlignment()
TiledTileset.ObjectAlignment.UNSPECIFIED
by default).public final TiledTileset.GridOrientation getGridOrientation()
TiledTileset.GridOrientation.ORTHOGONAL
by default).public final int getGridWidth()
public final int getGridHeight()
public final TiledImage getImage()
public final List<TiledTerrainType> getTerrainTypes()
public final List<TiledWangSet> getWangSets()
public final Map<String,Object> getProperties()
TiledCustomizable
java.awt.Color
for a color, TiledFile for a file, and TiledObject for an object (unless
the object property is unset, in which case the value is null).getProperties
in interface TiledCustomizable
public final Object getProperty(String name)
TiledCustomizable
java.awt.Color
for a color, TiledFile for a file, and
TiledObject for an object (unless the object property is unset, in which
case the value is null).getProperty
in interface TiledCustomizable
name
- The name of the property whose value is to be returnedCopyright © 2020. All rights reserved.