◆ Tile() [1/2]
Used in cases where you have a tile without any property
- Parameters
-
◆ Tile() [2/2]
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()
Declared in tileson_forward.hpp
'animation': Array of Frames
- Returns
◆ getClass()
◆ getClassType()
const std::string & tson::Tile::getClassType |
( |
| ) |
const |
|
inline |
'class': String assigned to class field in editor (optional) This was renamed from 'type' to 'class' in Tiled v1.9
- 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()
tson::TileFlipFlags tson::Tile::getFlipFlags |
( |
| ) |
const |
|
inline |
Declared in tileson_forward.hpp
◆ 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()
'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
◆ getSubRectangle()
const tson::Rect & tson::Tile::getSubRectangle |
( |
| ) |
const |
|
inline |
Tiled 1.9: Contains the newly added sub-rectangle variables: 'x', 'y', 'width' and 'height'
- Returns
- A tson::Rect with the 'x', 'y', 'width' and 'height' values
◆ getTerrain()
const std::vector< int > & tson::Tile::getTerrain |
( |
| ) |
const |
|
inline |
'terrain': Index of terrain for each corner of tile
- Returns
◆ getTileset()
◆ getTileSize()
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) This was renamed to 'class' in Tiled v1.9
- Returns
◆ hasFlipFlags()
bool tson::Tile::hasFlipFlags |
( |
tson::TileFlipFlags |
flags | ) |
|
|
inline |
- Parameters
-
flags | Which flags to check for. Several flags can be checked at once using the bitwise or operator. Example: hasFlipFlags(TileFlipFlags::Vertically | TileFlipFlags::Horizontally) |
- Returns
- true if the flag(s) specified are set
◆ manageFlipFlagsByIdThenRemoveFlags()
void tson::Tile::manageFlipFlagsByIdThenRemoveFlags |
( |
uint32_t & |
id | ) |
|
|
inlineprivate |
Declared in tileson_forward.hpp - Calculate all the values used in the tile class.
◆ 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
◆ performDataCalculations()
void tson::Tile::performDataCalculations |
( |
| ) |
|
|
inlineprivate |
◆ m_drawingRect
A pointer to the map where this tile is contained
◆ m_flipFlags
tson::TileFlipFlags tson::Tile::m_flipFlags = TileFlipFlags::None |
|
private |
Tiled 1.9: Contains the newly added sub-rectangle variables: 'x', 'y', 'width' and 'height'
◆ m_gid
uint32_t tson::Tile::m_gid {} |
|
private |
'type': The type of the tile (optional)
◆ m_id
uint32_t tson::Tile::m_id {} |
|
private |
'animation': Array of Frames
◆ m_image
fs::path tson::Tile::m_image |
|
private |
'id': Local ID of the tile
◆ m_imageSize
'image': Image representing this tile (optional)
◆ m_map
A pointer to the tileset where this Tile comes from
◆ m_objectgroup
x = 'imagewidth' and y = 'imageheight': in pixels
◆ m_properties
'objectgroup': Layer with type objectgroup (optional)
◆ m_subRect
A rect that shows which part of the tileset that is used for this tile
◆ m_terrain
std::vector<int> tson::Tile::m_terrain |
|
private |
'properties': A list of properties (name, value, type).
◆ m_tileset
◆ m_type
std::string tson::Tile::m_type |
|
private |
'terrain': Index of terrain for each corner of tile
The documentation for this class was generated from the following file: