◆ Map() [1/2]
tson::Map::Map |
( |
tson::ParseStatus |
status, |
|
|
std::string |
description |
|
) |
| |
|
inline |
When errors have happened before the map starts parsing, just keep the statuses
- Parameters
-
status | The status |
description | Description of the status |
◆ Map() [2/2]
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.
◆ createTilesetData()
bool tson::Map::createTilesetData |
( |
IJson & |
json | ) |
|
|
inlineprivate |
◆ 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
◆ getClass()
T I L E S O N F O R W A R D D E C L A R A T I O N S
Due to cross-references we have forward declarations that cannot be resolved during the implementation, thus the implementations must be done later when the class definition itself is known.
All those forward declarations can be found below.
◆ 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
◆ getHexsideLength()
int tson::Map::getHexsideLength |
( |
| ) |
const |
|
inline |
'hexsidelength': Length of the side of a hex tile in pixels
- Returns
◆ 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
◆ getParallaxOrigin()
Declared in tileson_forward.hpp
New in Tiled v1.8 Gets the parallax origin in pixels. Defaults to 0.
- Returns
- A vector with the x and y values of the parallax origin.
◆ 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
◆ 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.
◆ processData()
void tson::Map::processData |
( |
| ) |
|
|
inlineprivate |
Processes the parsed data and uses the data to create helpful objects, like tile maps.
◆ m_class
'class': The class of this map (since 1.9, defaults to “”).
◆ m_classType
std::string tson::Map::m_classType {} |
|
private |
◆ m_compressionLevel
int tson::Map::m_compressionLevel {-1} |
|
private |
◆ m_decompressors
'compressionlevel': The compression level to use for tile layer data (defaults to -1, which means to use the algorithm default) Introduced in Tiled 1.3
◆ m_hexsideLength
int tson::Map::m_hexsideLength {} |
|
private |
'width' and 'height' of a Tiled map
◆ m_isInfinite
bool tson::Map::m_isInfinite {} |
|
private |
'hexsidelength': Length of the side of a hex tile in pixels
◆ m_layers
'infinite': Whether the map has infinite dimensions
◆ m_nextLayerId
int tson::Map::m_nextLayerId {} |
|
private |
'layers': Array of layers. group on
◆ m_nextObjectId
int tson::Map::m_nextObjectId {} |
|
private |
'nextlayerid': Auto-increments for each layer
◆ m_orientation
std::string tson::Map::m_orientation |
|
private |
'nextobjectid': Auto-increments for each placed object
◆ m_parallaxOrigin
◆ m_properties
'orientation': orthogonal, isometric, staggered or hexagonal
◆ m_renderOrder
std::string tson::Map::m_renderOrder |
|
private |
'properties': A list of properties (name, value, type).
◆ m_size
'backgroundcolor': Hex-formatted color (#RRGGBB or #AARRGGBB) (optional)
◆ m_staggerAxis
std::string tson::Map::m_staggerAxis |
|
private |
'renderorder': Rendering direction (orthogonal maps only)
◆ m_staggerIndex
std::string tson::Map::m_staggerIndex |
|
private |
'staggeraxis': x or y (staggered / hexagonal maps only)
◆ m_status
ParseStatus tson::Map::m_status {ParseStatus::OK} |
|
private |
Tiled v1.8: parallax origin in pixels. Defaults to 0.
◆ m_tiledVersion
std::string tson::Map::m_tiledVersion |
|
private |
'staggerindex': odd or even (staggered / hexagonal maps only)
◆ m_tilesets
'tilewidth': and 'tileheight' of a map
◆ m_tileSize
'tiledversion': The Tiled version used to save the file
◆ m_type
std::string tson::Map::m_type |
|
private |
'tilesets': Array of Tilesets
The documentation for this class was generated from the following file: