TiledMap

Undocumented in source.

Constructors

this
this(string filename, bool compress)

CTor

Members

Functions

_readTileMap
void _readTileMap()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From TileMap

_readTileMap
void _readTileMap()

The read method must be overriden by any specialized TileMap.

_loadTileset
void _loadTileset()
Undocumented in source.
_loadTexCoords
void _loadTexCoords(ShortRect[ushort] used)
Undocumented in source. Be warned that the author may not have intended to support it.
_applyViewport
void _applyViewport()
Undocumented in source. Be warned that the author may not have intended to support it.
_render
void _render()
Undocumented in source.
_view
ShortRect _view;
Undocumented in source.
_tmi
TileMapInfo _tmi;
Undocumented in source.
_tex
Texture _tex;
Undocumented in source.
_tiles
Tile[] _tiles;
Undocumented in source.
_filename
string _filename;
Undocumented in source.
_doCompress
bool _doCompress;
Undocumented in source.
_vbo
VertexBufferObject _vbo;
Undocumented in source.
calculateCenter
const(Vector2s) calculateCenter()

Calculate, store and return the center point.

fetchView
inout(ShortRect*) fetchView()

Fetch the viewport pointer so that it can modified outside.

setView
void setView(short x, short y, short w, short h)

Set a new view.

setView
void setView(ShortRect view)

Set a new view.

setView
void setView(ShortRect view)

Rvalue version.

resetView
void resetView()

Reset the viewport.

adjustView
void adjustView()

Adjust the viewport. The position is shifted about <code>view.x * -1</code> and <code>view.y - 1</code> so that the left upper corner of the current view is in the left upper corner of the Window.

load
void load(string filename, bool compress)

Load a new TileMap

doCompress
bool doCompress [@property getter]

If compress is true, only the needed Tiles are stored (which means that are new tileset is created which contains only the needed tiles) otherwise the whole tileset is taken.

convertCoords
Vector2s convertCoords(float cx, float cy)

Convert from pixel coordinates to tile coordinates.

convertCoords
Vector2s convertCoords(Vector2f vec)

Convert from pixel coordinates to tile coordinates.

reconvertCoords
Vector2s reconvertCoords(float cx, float cy)

Convert from tile coordinates to pixel coordinates.

reconvertCoords
Vector2s reconvertCoords(Vector2f vec)

Convert from tile coordinates to pixel coordinates.

adjustCoords
Vector2s adjustCoords(float cx, float cy)

Adjusted pixel coordinates so that they lie on valid pixel coordinates based on tile coordinates.

adjustCoords
Vector2s adjustCoords(Vector2f vec)

Adjusted pixel coordinates so that they lie on valid pixel coordinates based on tile coordinates.

reload
void reload(Vector2s[] coords, Vector2s[] newCoords)

Reload multiple tiles. The length of coords must be equal to the length of newCoords.

reload
void reload(Vector2s[] coords, Vector2s newCoord)

Replace multiple tiles with another.

reload
void reload(Vector2s[] coords, Vector2s newCoord)

Rvalue version

reload
void reload(Vector2s coord, Vector2s newCoord)

Reload one tile, which means that the tile on the coordinates coord is replaced with the tile (and the tile surface) on the coordinates newCoord

reload
void reload(Vector2s coord, Vector2s newCoord)

Rvalue version

exchangeTileset
void exchangeTileset(Texture tex)

Exchange the tileset

getTiles
inout(Tile[]) getTiles()

Returns all containing tiles

isTileAt
bool isTileAt(Vector2s vec, uint* idx)

Check whether a tile exist on the given Coordinates. If idx isn't null, the calculated index of the Tile at the given position is stored there.

isTileAt
bool isTileAt(short x, short y, uint* idx)

Check whether a tile exist on the given Coordinates. If idx isn't null, the calculated index of the Tile at the given position is stored there.

replaceTileAt
void replaceTileAt(Vector2s vec, Tile newTile, Tile* oldTile)

Replace the tile at the given position with the given new Tile. If oldtile is not null, the former Tile is stored there.

replaceTileAt
void replaceTileAt(short x, short y, Tile newTile, Tile* oldTile)

Replace the tile at the given position with the given new Tile. If oldtile is not null, the former Tile is stored there.

getTileAt
Tile getTileAt(Vector2s vec)

Returns the tile at the given position, or throw an Exception Note: The position must be in tile coordinates, not pixel coordinates.

getTileAt
Tile getTileAt(short x, short y)

Returns the tile at the given position, or throw an Exception Note: The position must be in tile coordinates, not pixel coordinates.

getInfo
const(TileMapInfo) getInfo()

Returns the information structure of this tilemap

getFilename
string getFilename()

Returns the .xml filename of this tilemap

Meta