C
- Tile collision type.T
- Tile type used.public interface MapTile<C extends java.lang.Enum<C>,T extends TileGame<C>>
TileGame
,
MapTileGame
Modifier and Type | Method and Description |
---|---|
void |
append(MapTile<C,T> map,
int offsetX,
int offsetY)
Append an existing map, starting at the specified offsets.
|
void |
clear()
Remove all tiles from map.
|
void |
create(int widthInTile,
int heightInTile)
Create and prepare map memory area.
|
int |
getHeightInTile()
Get number of vertical tiles.
|
int |
getNumberPatterns()
Get the number of used pattern.
|
int |
getNumberTiles()
Get number of active tiles (which are not
null ). |
T |
getTile(int tx,
int ty)
Get tile from specified map location (in tile index).
|
int |
getTileHeight()
Get height of a tile.
|
int |
getTileWidth()
Get width of a tile.
|
int |
getWidthInTile()
Get number of horizontal tiles.
|
void |
loadPatterns(com.b3dgs.lionengine.core.Media directory)
Load map patterns (tiles surfaces) from theme name.
|
void |
render(com.b3dgs.lionengine.Graphic g,
CameraGame camera)
Render map from camera viewpoint, showing a specified area.
|
void create(int widthInTile, int heightInTile)
widthInTile
- The map width in tile.heightInTile
- The map height in tile.void append(MapTile<C,T> map, int offsetX, int offsetY)
append(MapTile, int, int)
at (getWidthInTile()
, getHeightInTile()
) will add
the new map at the top-right.map
- The map to append.offsetX
- The horizontal offset in tile (>= 0).offsetY
- The vertical offset in tile (>= 0).void clear()
void loadPatterns(com.b3dgs.lionengine.core.Media directory)
Collisions are stored this way: #NAME# = {pattern|firstTile-lastTile}, and called with: getCollision(name).
Patterns number and name have to be written inside a file named 'count', else, all files as .png will be loaded.
directory
- The patterns directory.void render(com.b3dgs.lionengine.Graphic g, CameraGame camera)
g
- The graphic output.camera
- The camera viewpoint.T getTile(int tx, int ty)
null
, this
means that there is not tile at this location. It is not an error, just a way to avoid useless tile storage.tx
- The horizontal tile index location.ty
- The vertical tile index location.int getNumberPatterns()
int getNumberTiles()
null
).null
tile.int getTileWidth()
int getTileHeight()
int getWidthInTile()
int getHeightInTile()