tmxlite 1.0.0
lightweight parse for Tiled maps
|
Represents a Tileset node as loaded from a *.tmx format tile map via the tmx::Map class. More...
#include <Tileset.hpp>
Classes | |
struct | Terrain |
Terrain information with which one or more tiles may be associated. More... | |
struct | Tile |
Any tiles within a tile set which have special data associated with them such as animation or terrain information will have one of these stored in the tile set. More... | |
Public Types | |
enum class | ObjectAlignment { Unspecified , TopLeft , Top , TopRight , Left , Center , Right , BottomLeft , Bottom , BottomRight } |
Declares the alignment of tile Objects. | |
Public Member Functions | |
Tileset (const std::string &workingDir) | |
void | parse (pugi::xml_node, Map *) |
Attempts to parse the given xml node. If node parsing fails an error is printed in the console and the Tileset remains in an uninitialised state. | |
std::uint32_t | getFirstGID () const |
Returns the first GID of this tile set. This the ID of the first tile in the tile set, so that each tile set guarantees a unique set of IDs. | |
std::uint32_t | getLastGID () const |
Returns the last GID of this tile set. This is the ID of the last tile in the tile set. | |
const std::string & | getName () const |
Returns the name of this tile set. | |
const std::string & | getClass () const |
Returns the class of the Tileset, as defined in the editor Tiled 1.9+. | |
const Vector2u & | getTileSize () const |
Returns the width and height of a tile in the tile set, in pixels. | |
std::uint32_t | getSpacing () const |
Returns the spacing, in pixels, between each tile in the set. | |
std::uint32_t | getMargin () const |
Returns the margin, in pixels, around each tile in the set. | |
std::uint32_t | getTileCount () const |
Returns the number of tiles in the tile set. | |
std::uint32_t | getColumnCount () const |
Returns the number of columns which make up the tile set. This is used when rendering collection of images sets. | |
ObjectAlignment | getObjectAlignment () const |
Returns the alignment of tile objects. The default value is ObjectAlignment::Unspecified for compatibility. When the alignment is Unspecified tile objects use BottomLeft in orthogonal mode and Bottom in isometric mode. | |
const Vector2u & | getTileOffset () const |
Returns the tile offset in pixels. Tile will draw tiles offset from the top left using this value. | |
const std::vector< Property > & | getProperties () const |
Returns a reference to the list of Property objects for this tile set. | |
const std::string & | getImagePath () const |
Returns the file path to the tile set image, relative to the working directory. Use this to load the texture required by whichever method you choose to render the map. | |
const Vector2u & | getImageSize () const |
Returns the size of the tile set image in pixels. | |
const Colour & | getTransparencyColour () const |
Returns the colour used by the tile map image to represent transparency. By default this is a transparent colour (0, 0, 0, 0) | |
bool | hasTransparency () const |
Returns true if the image used by this tileset specifically requests a colour to use as transparency. | |
const std::vector< Terrain > & | getTerrainTypes () const |
Returns a vector of Terrain types associated with one or more tiles within this tile set. | |
const std::vector< Tile > & | getTiles () const |
Returns a reference to the vector of tile data used by tiles which make up this tile set. | |
bool | hasTile (std::uint32_t id) const |
Checks if a tiled ID is in the range of the first ID and the last ID. | |
const Tile * | getTile (std::uint32_t id) const |
queries tiles and returns a tile with the given ID. Checks if the TileID is part of the Tileset with hasTile(id) | |
|
inline |
Returns the alignment of tile objects. The default value is ObjectAlignment::Unspecified for compatibility. When the alignment is Unspecified tile objects use BottomLeft in orthogonal mode and Bottom in isometric mode.
const Tile * tmx::Tileset::getTile | ( | std::uint32_t | id | ) | const |
|
inline |