public class ArrayTileLayer extends TiledTileLayer
An ArrayTileLayer is a type of TiledTileLayer that stores its tile data in a rectangular two-dimensional array. An ArrayTileLayer's memory usage, and the time needed to iterate through the set of its tile locations, are both proportional to the area in square tiles of the smallest rectangle that fits around all of the tiles in the tile layer it represents. A TiledReader automatically chooses whether to represent each tile layer it reads with an ArrayTileLayer or a HashTileLayer, based on an estimate of which would use less memory.
Modifier and Type | Method and Description |
---|---|
TiledTile |
getTile(int x,
int y)
Returns the tile at the specified location in this tile layer's grid, or
null if there is none.
|
boolean |
getTileDiagonalFlip(int x,
int y)
Returns whether the tile at the specified location in this tile layer's
grid is flipped diagonally, or false if there is no tile there.
|
boolean |
getTileHorizontalFlip(int x,
int y)
Returns whether the tile at the specified location in this tile layer's
grid is flipped horizontally, or false if there is no tile there.
|
Set<Point> |
getTileLocations()
Returns an unmodifiable Set view of the (x, y) locations in this tile
layer's grid where tiles are located.
|
boolean |
getTileVerticalFlip(int x,
int y)
Returns whether the tile at the specified location in this tile layer's
grid is flipped vertically, or false if there is no tile there.
|
int |
getX1()
Returns the lowest x-coordinate in tiles of any tile in this tile layer,
or 0 if this tile layer has no tiles.
|
int |
getX2()
Returns the highest x-coordinate in tiles of any tile in this tile layer,
or -1 if this tile layer has no tiles.
|
int |
getY1()
Returns the lowest y-coordinate in tiles of any tile in this tile layer,
or 0 if this tile layer has no tiles.
|
int |
getY2()
Returns the highest y-coordinate in tiles of any tile in this tile layer,
or -1 if this tile layer has no tiles.
|
getAbsOffsetX, getAbsOffsetY, getAbsOpacity, getAbsTintColor, getAbsVisible, getName, getParent, getProperties, getProperty, getRelOffsetX, getRelOffsetY, getRelOpacity, getRelTintColor, getRelVisible
public final Set<Point> getTileLocations()
TiledTileLayer
getTileLocations
in class TiledTileLayer
public final int getX1()
TiledTileLayer
getX1
in class TiledTileLayer
public final int getY1()
TiledTileLayer
getY1
in class TiledTileLayer
public final int getX2()
TiledTileLayer
getX2
in class TiledTileLayer
public final int getY2()
TiledTileLayer
getY2
in class TiledTileLayer
public final TiledTile getTile(int x, int y)
TiledTileLayer
getTile
in class TiledTileLayer
x
- The x-coordinate in tiles of the locationy
- The y-coordinate in tiles of the locationpublic final boolean getTileHorizontalFlip(int x, int y)
TiledTileLayer
getTileHorizontalFlip
in class TiledTileLayer
x
- The x-coordinate in tiles of the locationy
- The y-coordinate in tiles of the locationpublic final boolean getTileVerticalFlip(int x, int y)
TiledTileLayer
getTileVerticalFlip
in class TiledTileLayer
x
- The x-coordinate in tiles of the locationy
- The y-coordinate in tiles of the locationpublic final boolean getTileDiagonalFlip(int x, int y)
TiledTileLayer
getTileDiagonalFlip
in class TiledTileLayer
x
- The x-coordinate in tiles of the locationy
- The y-coordinate in tiles of the locationCopyright © 2020. All rights reserved.