#include <Tile.hpp>
◆ Tile() [1/4]
◆ Tile() [2/4]
◆ Tile() [3/4]
Used in cases where you have a tile without any property
- Parameters
-
◆ Tile() [4/4]
tson::Tile::Tile |
( |
uint32_t |
id, |
|
|
tson::Map * |
map |
|
) |
| |
|
inline |
Used in cases where you have a FLIP FLAGGED tile
- Parameters
-
◆ addTilesetAndPerformCalculations()
void tson::Tile::addTilesetAndPerformCalculations |
( |
tson::Tileset * |
tileset | ) |
|
|
inline |
For flip flagged tiles, tilesets must be resolved later.
- Parameters
-
◆ get()
template<typename T >
T tson::Tile::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.
◆ getAnimation()
'animation': Array of Frames
- Returns
◆ getDrawingRect()
const tson::Rect & tson::Tile::getDrawingRect |
( |
| ) |
const |
|
inline |
Get the information needed to draw the Tile based on its current tileset
- Returns
- a tson::Rect containing the information needed to draw the tile.
◆ getFlipFlags()
◆ getGid()
uint32_t tson::Tile::getGid |
( |
| ) |
const |
|
inline |
◆ getId()
uint32_t tson::Tile::getId |
( |
| ) |
const |
|
inline |
'id': Local ID of the tile
- Returns
◆ getImage()
const fs::path & tson::Tile::getImage |
( |
| ) |
const |
|
inline |
'image': Image representing this tile (optional)
- Returns
◆ getImageSize()
x = 'imagewidth' and y = 'imageheight': in pixels
- Returns
◆ getMap()
Used for getting the tson::Map who is the parent of this Tile.
- Returns
- a pointer to the tson::Map where this tile is contained.
◆ getObjectgroup()
const tson::Layer & tson::Tile::getObjectgroup |
( |
| ) |
const |
|
inline |
'objectgroup': Layer with type objectgroup (optional)
- Returns
◆ getPosition()
const tson::Vector2f tson::Tile::getPosition |
( |
const std::tuple< int, int > & |
tileDataPos | ) |
|
|
inline |
Get the position of the tile in pixels based on the tile data position from the current layer.
- Returns
- The position of the tile in Pixels
◆ getPositionInTileUnits()
const tson::Vector2i tson::Tile::getPositionInTileUnits |
( |
const std::tuple< int, int > & |
tileDataPos | ) |
|
|
inline |
Helper function.
Get the position of the tile in tile units. The size of each unit is determined by the tile size property of the map. Example: If the tile size is 16x16 in the map, a tile unit of [2, 4] would be [32, 64] in pixels. If you want the position in pixels: use getPosition() instead.
- Returns
- Position of tile in tile units.
◆ getProp()
Shortcut for getting a property object. Alternative to getProperties().getProperty("<name>");
- Parameters
-
- Returns
◆ getProperties()
'properties': A list of properties (name, value, type).
- Returns
◆ getTerrain()
const std::vector< int > & tson::Tile::getTerrain |
( |
| ) |
const |
|
inline |
'terrain': Index of terrain for each corner of tile
- Returns
◆ getTileset()
◆ getTileSize()
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.
Really just a shortcut to retrieve the tile size from the map.
- Returns
- TileSize based on the map property for tile size.
◆ getType()
const std::string & tson::Tile::getType |
( |
| ) |
const |
|
inline |
'type': The type of the tile (optional)
- Returns
◆ hasFlipFlags()
- Parameters
-
- Returns
- true if the flag(s) specified are set
◆ parse()
Parses a tile from a Tiled json. id on tile is store as id + 1 to match the references in data containers.
- Parameters
-
- Returns
◆ parseId()
bool tson::Tile::parseId |
( |
IJson & |
json | ) |
|
|
inline |
◆ setProperties()
◆ Layer
The documentation for this class was generated from the following files: