#include <Map.hpp>
◆ Map() [1/3]
◆ Map() [2/3]
When errors have happened before the map starts parsing, just keep the statuses
- Parameters
-
status | The status |
description | Description of the status |
◆ Map() [3/3]
Parses a json of a Tiled map.
- Parameters
-
json | A json object with the format of Map |
- Returns
- true if all mandatory fields was found. false otherwise.
◆ get()
template<typename T >
T tson::Map::get |
( |
const std::string & |
name | ) |
|
|
inline |
A shortcut for getting a property. Alternative to getProperties().getValue<T>("<name>")
- Template Parameters
-
- Parameters
-
- Returns
- The actual value, if it exists. Otherwise: The default value of the type.
◆ getBackgroundColor()
const tson::Colori & tson::Map::getBackgroundColor |
( |
| ) |
const |
|
inline |
'backgroundcolor': Color created from a hex-formatted color string (#RRGGBB or #AARRGGBB) (optional)
- Returns
- string as color
◆ getCompressionLevel()
int tson::Map::getCompressionLevel |
( |
| ) |
const |
|
inline |
'compressionlevel': The compression level to use for tile layer data (defaults to -1, which means to use the algorithm default)
- Returns
- The compression level
◆ getDecompressors()
◆ getHexsideLength()
int tson::Map::getHexsideLength |
( |
| ) |
const |
|
inline |
'hexsidelength': Length of the side of a hex tile in pixels
- Returns
◆ getLayer()
tson::Layer * tson::Map::getLayer |
( |
const std::string & |
name | ) |
|
|
inline |
◆ getLayers()
'version': The JSON format version
- Returns
'layers': Array of layers. group on
- Returns
◆ getNextLayerId()
int tson::Map::getNextLayerId |
( |
| ) |
const |
|
inline |
'nextlayerid': Auto-increments for each layer
- Returns
◆ getNextObjectId()
int tson::Map::getNextObjectId |
( |
| ) |
const |
|
inline |
'nextobjectid': Auto-increments for each placed object
- Returns
◆ getOrientation()
const std::string & tson::Map::getOrientation |
( |
| ) |
const |
|
inline |
'orientation': orthogonal, isometric, staggered or hexagonal
- Returns
◆ getProp()
Shortcut for getting a property object. Alternative to getProperties().getProperty("<name>");
- Parameters
-
- Returns
◆ getProperties()
'properties': A list of properties (name, value, type).
- Returns
◆ getRenderOrder()
const std::string & tson::Map::getRenderOrder |
( |
| ) |
const |
|
inline |
'renderorder': Rendering direction (orthogonal maps only)
- Returns
◆ getSize()
'width' and 'height' of a Tiled map
- Returns
◆ getStaggerAxis()
const std::string & tson::Map::getStaggerAxis |
( |
| ) |
const |
|
inline |
'staggeraxis': x or y (staggered / hexagonal maps only)
- Returns
◆ getStaggerIndex()
const std::string & tson::Map::getStaggerIndex |
( |
| ) |
const |
|
inline |
'staggerindex': odd or even (staggered / hexagonal maps only)
- Returns
◆ getStatus()
◆ getStatusMessage()
const std::string & tson::Map::getStatusMessage |
( |
| ) |
const |
|
inline |
◆ getTiledVersion()
const std::string & tson::Map::getTiledVersion |
( |
| ) |
const |
|
inline |
'tiledversion': The Tiled version used to save the file
- Returns
◆ getTileMap()
const std::map< uint32_t, tson::Tile * > & tson::Map::getTileMap |
( |
| ) |
const |
|
inline |
Get a tile map with pointers to every existing tile.
- Returns
◆ getTileset()
tson::Tileset * tson::Map::getTileset |
( |
const std::string & |
name | ) |
|
|
inline |
Gets a tileset by name
- Parameters
-
- Returns
- tileset with the matching name
◆ getTilesetByGid()
Gets a tileset by gid (graphical ID of a tile). These are always unique, no matter how many tilesets you have
- Parameters
-
gid | Graphical ID of a tile |
- Returns
- tileset related to the actual gid
◆ getTilesets()
'tilesets': Array of Tilesets
- Returns
◆ getTileSize()
'tilewidth': and 'tileheight' of a map
- Returns
◆ getType()
const std::string & tson::Map::getType |
( |
| ) |
const |
|
inline |
'type': map (since 1.0)
- Returns
◆ isInfinite()
bool tson::Map::isInfinite |
( |
| ) |
const |
|
inline |
'infinite': Whether the map has infinite dimensions
- Returns
◆ parse()
Parses a json of a Tiled map.
- Parameters
-
json | A json object with the format of Map |
- Returns
- true if all mandatory fields was found. false otherwise.
The documentation for this class was generated from the following file:
- /home/robin/git/c++/tileson/include/tiled/Map.hpp