Class TileLayer
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.Layer
de.gurkenlabs.litiengine.environment.tilemap.xml.TileLayer
- All Implemented Interfaces:
ICustomPropertyProvider, ILayer, ITileLayer
Represents a layer of tiles in the tile map. This class extends the
Layer class and implements the ITileLayer interface.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newTileLayerinstance.TileLayer(int width, int height) Creates an empty, editable tile layer with the specified dimensions.Instantiates a newTileLayerinstance with the specified data.Copy constructor for theTileLayerclass. -
Method Summary
Modifier and TypeMethodDescriptiongetData()Gets the list of tiles in this layer.intGets the height.protected TileDataGets the raw tile data for this layer.getTile(int x, int y) Gets the tile at the specified map grid location.getTileByLocation(Point2D location) Gets the tile by location.getTiles()Gets the tiles.intgetWidth()Gets the width.voidsetTile(int x, int y, int gid) Sets the id of the tile at the specified map grid location.voidSets the id of the tile at the specified map grid location.Methods inherited from class Layer
afterUnmarshal, getHorizontalParallaxFactor, getId, getMap, getName, getOffset, getOffsetX, getOffsetY, getOpacity, getRenderType, getSizeInTiles, getTintColor, getVerticalParallaxFactor, isVisible, setHeight, setMap, setName, setOpacity, setRenderType, setTintColor, setVisible, setWidthMethods inherited from class CustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ICustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueMethods inherited from interface ILayer
getHorizontalParallaxFactor, getId, getMap, getName, getOffset, getOffsetX, getOffsetY, getOpacity, getRenderType, getSizeInTiles, getTintColor, getVerticalParallaxFactor, isVisible, setHeight, setName, setOpacity, setRenderType, setTintColor, setVisible, setWidth
-
Constructor Details
-
TileLayer
public TileLayer()Instantiates a newTileLayerinstance. -
TileLayer
Instantiates a newTileLayerinstance with the specified data.- Parameters:
data- The tile data of this instance.
-
TileLayer
public TileLayer(int width, int height) Creates an empty, editable tile layer with the specified dimensions.- Parameters:
width- the layer width in tilesheight- the layer height in tiles
-
TileLayer
Copy constructor for theTileLayerclass. Creates a new instance of theTileLayerclass by copying the properties from the providedTileLayerobject.- Parameters:
original- The originalTileLayerobject to copy from.
-
-
Method Details
-
getTileByLocation
Description copied from interface:ITileLayerGets the tile by location.- Specified by:
getTileByLocationin interfaceITileLayer- Parameters:
location- the location- Returns:
- the tile by location
-
getTile
Description copied from interface:ITileLayerGets the tile at the specified map grid location.
To retrieve map grid coordinates from a location on the map, use the
MapUtilities#getTile(Point2D)method.- Specified by:
getTilein interfaceITileLayer- Parameters:
x- The x-coordinate (on the map grid) to retrieve the tile.y- The y-coordinate (on the map grid) to retrieve the tile.- Returns:
- The tile at the specified grid location.
- See Also:
-
setTile
Description copied from interface:ITileLayerSets the id of the tile at the specified map grid location.- Specified by:
setTilein interfaceITileLayer- Parameters:
x- The x-coordinate (on the map grid).y- The y-coordinate (on the map grid).tile- The tile that provides the tile id to be set on the tile at the specified location.- See Also:
-
setTile
public void setTile(int x, int y, int gid) Description copied from interface:ITileLayerSets the id of the tile at the specified map grid location.- Specified by:
setTilein interfaceITileLayer- Parameters:
x- The x-coordinate (on the map grid).y- The y-coordinate (on the map grid).gid- The id to be set on the tile at the specified location.
-
getTiles
Description copied from interface:ITileLayerGets the tiles.- Specified by:
getTilesin interfaceITileLayer- Returns:
- the tiles
-
getWidth
-
getHeight
-
getData
-
getRawTileData
-