◆ generateMissingTiles()
void tson::Tileset::generateMissingTiles |
( |
| ) |
|
|
inlineprivate |
Tiled only has tiles with a property stored in the map. This function makes sure even the ones with no properties will exist.
◆ 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.
◆ getColumns()
int tson::Tileset::getColumns |
( |
| ) |
const |
|
inline |
'columns': The number of tile columns in the tileset
- Returns
◆ 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
◆ 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
◆ getTiles()
std::vector< tson::Tile > & tson::Tileset::getTiles |
( |
| ) |
|
|
inline |
Declared in tileson_forward.hpp
'tiles': Array of Tiles (optional)
- Returns
◆ 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
◆ StringToAlignment()
tson::ObjectAlignment tson::Tileset::StringToAlignment |
( |
std::string_view |
str | ) |
|
|
inlinestatic |
- Parameters
-
str | The string you want to convert |
- Returns
- Alignment enum based on the string from the input.
◆ m_class
'class': The class of this map (since 1.9, defaults to “”).
◆ m_classType
std::string tson::Tileset::m_classType {} |
|
private |
'fillmode': The fill mode to use when rendering tiles from this tileset. Valid values are 'stretch' (the default) and 'preserve-aspect-fit'. Only relevant when the tiles are not rendered at their native size, so this applies to resized tile objects or in combination with 'tilerendersize' set to 'grid'. (since 1.9)
◆ m_fillMode
FillMode tson::Tileset::m_fillMode {} |
|
private |
'tilerendersize': The size to use when rendering tiles from this tileset on a tile layer. Valid values are 'tile' (the default) and 'grid'. When set to 'grid', the tile is drawn at the tile grid size of the map. (since 1.9)
◆ m_firstgid
int tson::Tileset::m_firstgid {} |
|
private |
'columns': The number of tile columns in the tileset
◆ m_grid
'x' and 'y': See <tileoffset> (optional)
◆ m_image
fs::path tson::Tileset::m_image |
|
private |
'firstgid': GID corresponding to the first tile in the set
◆ m_imageSize
'image': Image used for tiles in this set
◆ m_map
'objectalignment': Alignment to use for tile objects. Tiled 1.4.
◆ m_margin
int tson::Tileset::m_margin {} |
|
private |
x = 'imagewidth' and y = 'imageheight': in pixels
◆ m_name
std::string tson::Tileset::m_name |
|
private |
'margin': Buffer between image edge and first tile (pixels)
◆ m_objectAlignment
tson::ObjectAlignment tson::Tileset::m_objectAlignment {tson::ObjectAlignment::Unspecified} |
|
private |
'grid': This element is only used in case of isometric orientation, and determines how tile overlays for terrain and collision information are rendered.
◆ m_path
fs::path tson::Tileset::m_path {} |
|
private |
'source': exists only when tileset is contained in an external file
◆ m_properties
'wangsets':Array of Wang sets (since 1.1.5)
◆ m_source
fs::path tson::Tileset::m_source {} |
|
private |
The map who owns this tileset
◆ m_spacing
int tson::Tileset::m_spacing {} |
|
private |
'name': Name given to this tileset
◆ m_terrains
'properties': A list of properties (name, value, type).
◆ m_tileCount
int tson::Tileset::m_tileCount {} |
|
private |
'spacing': Spacing between adjacent tiles in image (pixels)
◆ m_tileOffset
'terrains': Array of Terrains (optional)
◆ m_tileRenderSize
TileRenderSize tson::Tileset::m_tileRenderSize {} |
|
private |
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).
◆ m_tiles
'type': tileset (for tileset files, since 1.0)
◆ m_tileSize
'tilecount': The number of tiles in this tileset
◆ m_transformations
Has the full path to the tileset if 'source' has an existing value
◆ m_transparentColor
x = 'tilewidth' and y = 'tileheight': Maximum size of tiles in this set
◆ m_type
std::string tson::Tileset::m_type |
|
private |
'transparentcolor': Hex-formatted color (#RRGGBB) (optional)
◆ m_wangsets
'tiles': Array of Tiles (optional)
The documentation for this class was generated from the following file: