#include <Tileset.hpp>
◆ Tileset() [1/2]
tson::Tileset::Tileset |
( |
| ) |
|
|
inlinedefault |
◆ Tileset() [2/2]
◆ get()
template<typename T >
T tson::Tileset::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.
◆ getClass()
◆ getClassType()
const std::string & tson::Tileset::getClassType |
( |
| ) |
const |
|
inline |
◆ getColumns()
int tson::Tileset::getColumns |
( |
| ) |
const |
|
inline |
'columns': The number of tile columns in the tileset
- Returns
◆ getFillMode()
◆ getFirstgid()
int tson::Tileset::getFirstgid |
( |
| ) |
const |
|
inline |
'firstgid': GID corresponding to the first tile in the set
- Returns
◆ getGrid()
const tson::Grid & tson::Tileset::getGrid |
( |
| ) |
const |
|
inline |
'grid': This element is only used in case of isometric orientation, and determines how tile overlays for terrain and collision information are rendered.
- Returns
◆ getImage()
const fs::path & tson::Tileset::getImage |
( |
| ) |
const |
|
inline |
'image': Image used for tiles in this set
- Returns
◆ getImagePath()
const fs::path & tson::Tileset::getImagePath |
( |
| ) |
const |
|
inline |
'image': Image used for tiles in this set
- Returns
◆ getImageSize()
x = 'imagewidth' and y = 'imageheight': in pixels
- Returns
◆ getMap()
Used for getting the tson::Map who is the parent of this Tileset.
- Returns
- a pointer to the tson::Map where this tileset is contained.
◆ getMargin()
int tson::Tileset::getMargin |
( |
| ) |
const |
|
inline |
'margin': Buffer between image edge and first tile (pixels)
- Returns
◆ getMarginSpacingOffset()
Helper function to calculate the correct additional offset when margin and/or spacing is used in a tileset Created to solve issue #31.
- Parameters
-
posInTileUnits | Position of the current tile in tile units. |
- Returns
- Calculated additional offset in pixels.
◆ getName()
const std::string & tson::Tileset::getName |
( |
| ) |
const |
|
inline |
'name': Name given to this tileset
- Returns
◆ getObjectAlignment()
◆ getProp()
Shortcut for getting a property object. Alternative to getProperties().getProperty("<name>");
- Parameters
-
- Returns
◆ getProperties()
'properties': A list of properties (name, value, type).
- Returns
◆ getSpacing()
int tson::Tileset::getSpacing |
( |
| ) |
const |
|
inline |
'spacing': Spacing between adjacent tiles in image (pixels)
- Returns
◆ getTerrain()
tson::Terrain * tson::Tileset::getTerrain |
( |
const std::string & |
name | ) |
|
|
inline |
Get an existing Terrain object by name
- Parameters
-
- Returns
- A pointer to the Terrain if found. nullptr otherwise.
◆ getTerrains()
const std::vector< tson::Terrain > & tson::Tileset::getTerrains |
( |
| ) |
const |
|
inline |
'terrains': Array of Terrains (optional)
- Returns
◆ getTile()
tson::Tile * tson::Tileset::getTile |
( |
uint32_t |
id | ) |
|
|
inline |
Gets a tile by ID (Tiled ID + 1)
- Parameters
-
id | The ID of the tile stored in Tiled map + 1. Example: If ID was stored in Tiled map as 0, the corresponding value in Tileson is 1. This is to make sure the IDs of tiles matches their references in containers. |
- Returns
- A pointer to the Tile if found. nullptr otherwise.
◆ getTileCount()
int tson::Tileset::getTileCount |
( |
| ) |
const |
|
inline |
'tilecount': The number of tiles in this tileset
- Returns
◆ getTileOffset()
'x' and 'y': See <tileoffset> (optional)
- Returns
◆ getTileRenderSize()
◆ getTiles()
std::vector< tson::Tile > & tson::Tileset::getTiles |
( |
| ) |
|
|
inline |
◆ getTileSize()
x = 'tilewidth' and y = 'tileheight': Maximum size of tiles in this set
- Returns
◆ getTransformations()
New in Tiled v1.5 - This element is used to describe which transformations can be applied to the tiles (e.g. to extend a Wang set by transforming existing tiles).
- Returns
◆ getTransparentColor()
const tson::Colori & tson::Tileset::getTransparentColor |
( |
| ) |
const |
|
inline |
'transparentcolor': Color object created by hex-formatted color (#RRGGBB) (optional)
- Returns
◆ getType()
const std::string & tson::Tileset::getType |
( |
| ) |
const |
|
inline |
'type': tileset (for tileset files, since 1.0)
- Returns
◆ getWangset()
tson::WangSet * tson::Tileset::getWangset |
( |
const std::string & |
name | ) |
|
|
inline |
Get a wangset by name
- Parameters
-
- Returns
◆ getWangsets()
const std::vector< tson::WangSet > & tson::Tileset::getWangsets |
( |
| ) |
const |
|
inline |
'wangsets':Array of Wang sets (since Tiled 1.1.5)
- Returns
◆ parse()
◆ StringToAlignment()
- Parameters
-
str | The string you want to convert |
- Returns
- Alignment enum based on the string from the input.
The documentation for this class was generated from the following files: