APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.maps.tiled

public Class TiledMapTileLayer

extends MapLayer
Class Inheritance
Imports
com.badlogic.gdx.maps.MapLayer

@brief Layer for a TiledMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
TiledMapTileLayer.Cell

@brief represents a cell in a TiledLayer: TiledMapTile, flip and rotation properties.

Field Summary

Modifier and TypeField and Description
private TiledMapTileLayer.Cell[][]
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
TiledMapTileLayer(int
layer width in tiles
width
,
int
layer height in tiles
height
,
int
tile width in pixels
tileWidth
,
int
tile height in pixels
tileHeight
)

Creates TiledMap layer

Method Summary

Modifier and TypeMethod and Description
public TiledMapTileLayer.Cell
getCell(int
X coordinate
x
,
int
Y coordinate
y
)

Returns: Cell at (x, y)

public int
getHeight()

Returns: layer's height in tiles

public int
getTileHeight()

Returns: tiles' height in pixels

public int
getTileWidth()

Returns: tiles' width in pixels

public int
getWidth()

Returns: layer's width in tiles

public void
setCell(int
X coordinate
x
,
int
Y coordinate
y
,
TiledMapTileLayer.Cell
the Cell to set at the given coordinates.
cell
)

Sets the Cell at the given coordinates.

Inherited from com.badlogic.gdx.maps.MapLayer:
calculateRenderOffsetsgetCombinedTintColorgetNamegetObjectsgetOffsetXgetOffsetYgetOpacitygetParallaxXgetParallaxYgetParentgetPropertiesgetRenderOffsetXgetRenderOffsetYgetTintColorinvalidateRenderOffsetisVisiblesetNamesetOffsetXsetOffsetYsetOpacitysetParallaxXsetParallaxYsetParentsetTintColorsetVisible

Field Detail

cellsback to summary
private TiledMapTileLayer.Cell[][] cells
heightback to summary
private int height
tileHeightback to summary
private int tileHeight
tileWidthback to summary
private int tileWidth
widthback to summary
private int width

Constructor Detail

TiledMapTileLayerback to summary
public TiledMapTileLayer(int width, int height, int tileWidth, int tileHeight)

Creates TiledMap layer

Parameters
width:int

layer width in tiles

height:int

layer height in tiles

tileWidth:int

tile width in pixels

tileHeight:int

tile height in pixels

Method Detail

getCellback to summary
public TiledMapTileLayer.Cell getCell(int x, int y)
Parameters
x:int

X coordinate

y:int

Y coordinate

Returns:TiledMapTileLayer.Cell

Cell at (x, y)

getHeightback to summary
public int getHeight()
Returns:int

layer's height in tiles

getTileHeightback to summary
public int getTileHeight()
Returns:int

tiles' height in pixels

getTileWidthback to summary
public int getTileWidth()
Returns:int

tiles' width in pixels

getWidthback to summary
public int getWidth()
Returns:int

layer's width in tiles

setCellback to summary
public void setCell(int x, int y, TiledMapTileLayer.Cell cell)

Sets the Cell at the given coordinates.

Parameters
x:int

X coordinate

y:int

Y coordinate

cell:TiledMapTileLayer.Cell

the Cell to set at the given coordinates.

com.badlogic.gdx.maps.tiled back to summary

public Class TiledMapTileLayer.Cell

extends Object
Class Inheritance

@brief represents a cell in a TiledLayer: TiledMapTile, flip and rotation properties.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
public static final int
public static final int
public static final int
public static final int
private int
private TiledMapTile

Constructor Summary

AccessConstructor and Description
public
Cell()

Method Summary

Modifier and TypeMethod and Description
public boolean
getFlipHorizontally()

Returns: Whether the tile should be flipped horizontally.

public boolean
getFlipVertically()

Returns: Whether the tile should be flipped vertically.

public int
getRotation()

Returns: The rotation of this cell, in 90 degree increments.

public TiledMapTile
getTile()

Returns: The tile currently assigned to this cell.

public TiledMapTileLayer.Cell

Returns:

this, for method chaining
setFlipHorizontally
(boolean
whether or not to flip the tile horizontally.
flipHorizontally
)

Sets whether to flip the tile horizontally.

public TiledMapTileLayer.Cell

Returns:

this, for method chaining
setFlipVertically
(boolean
whether or not this tile should be flipped vertically.
flipVertically
)

Sets whether to flip the tile vertically.

public TiledMapTileLayer.Cell

Returns:

this, for method chaining
setRotation
(int
the rotation in 90 degree increments (see ints below).
rotation
)

Sets the rotation of this cell, in 90 degree increments.

public TiledMapTileLayer.Cell

Returns:

this, for method chaining
setTile
(TiledMapTile
the TiledMapTile to use for this cell.
tile
)

Sets the tile to be used for this cell.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

flipHorizontallyback to summary
private boolean flipHorizontally
flipVerticallyback to summary
private boolean flipVertically
ROTATE_0back to summary
public static final int ROTATE_0
ROTATE_180back to summary
public static final int ROTATE_180
ROTATE_270back to summary
public static final int ROTATE_270
ROTATE_90back to summary
public static final int ROTATE_90
rotationback to summary
private int rotation
tileback to summary
private TiledMapTile tile

Constructor Detail

Cellback to summary
public Cell()

Method Detail

getFlipHorizontallyback to summary
public boolean getFlipHorizontally()
Returns:boolean

Whether the tile should be flipped horizontally.

getFlipVerticallyback to summary
public boolean getFlipVertically()
Returns:boolean

Whether the tile should be flipped vertically.

getRotationback to summary
public int getRotation()
Returns:int

The rotation of this cell, in 90 degree increments.

getTileback to summary
public TiledMapTile getTile()
Returns:TiledMapTile

The tile currently assigned to this cell.

setFlipHorizontallyback to summary
public TiledMapTileLayer.Cell setFlipHorizontally(boolean flipHorizontally)

Sets whether to flip the tile horizontally.

Parameters
flipHorizontally:boolean

whether or not to flip the tile horizontally.

Returns:TiledMapTileLayer.Cell

this, for method chaining

setFlipVerticallyback to summary
public TiledMapTileLayer.Cell setFlipVertically(boolean flipVertically)

Sets whether to flip the tile vertically.

Parameters
flipVertically:boolean

whether or not this tile should be flipped vertically.

Returns:TiledMapTileLayer.Cell

this, for method chaining

setRotationback to summary
public TiledMapTileLayer.Cell setRotation(int rotation)

Sets the rotation of this cell, in 90 degree increments.

Parameters
rotation:int

the rotation in 90 degree increments (see ints below).

Returns:TiledMapTileLayer.Cell

this, for method chaining

setTileback to summary
public TiledMapTileLayer.Cell setTile(TiledMapTile tile)

Sets the tile to be used for this cell.

Parameters
tile:TiledMapTile

the TiledMapTile to use for this cell.

Returns:TiledMapTileLayer.Cell

this, for method chaining