#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 |
linkedFileParser | A callback function that must return a IJson object when a linked file is found in the 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
◆ 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.
◆ getClassType()
const std::string & tson::Map::getClassType |
( |
| ) |
const |
|
inline |
◆ 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
◆ 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.
◆ getProject()
◆ 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 |
linkedFileParser | A callback function that must return a IJson object when a linked file is found in the map |
- Returns
- true if all mandatory fields was found. false otherwise.
◆ Object
The documentation for this class was generated from the following files: