Skip to content

Tileset

Modar Nasser edited this page Feb 23, 2024 · 17 revisions

In file LDtkLoader/Tileset.hpp

Struct : ldtk::Tileset

A Tileset contains information about a texture used to draw tiles.

Fields

name

const std::string ldtk::Tileset::name

Name of the Tileset.

πŸ”

uid

const int ldtk::Tileset::uid

Unique identifier of the Tileset.

πŸ”

path

const std::string ldtk::Tileset::path

Relative path to the image file.

πŸ”

texture_size

const ldtk::IntPoint ldtk::Tileset::texture_size

Size in pixels of the Texture.

πŸ”

tile_size

const int ldtk::Tileset::tile_size

Size in pixels of a tile in the Tileset. Tiles are always square shaped.

πŸ”

spacing

const int ldtk::Tileset::spacing

Spacing in pixels between tiles in the Tileset

πŸ”

padding

const int ldtk::Tileset::padding

Padding in pixels to the first row and column of tiles in the Tileset.

πŸ”

Methods

getTileTexturePos

ldtk::Tileset::getTileTexturePos(int tile_id) const -> ldtk::IntPoint

Returns the texture coordinates of the tile ID.

πŸ”

getTileCustomData

ldtk::Tileset::getTileCustomData(int tile_id) const -> const std::string&

Returns the custom data of the tile ID.

πŸ”

hasTagsEnum

ldtk::Tileset::hasTagsEnum() const -> bool

Returns true if the Tileset has enum tags associated to tiles, false otherwise.

πŸ”

getTagsEnum

ldtk::Tileset::getTagsEnum() const -> const Enum&

Returns the Enum type used by this Tileset's tags.

πŸ”

getTilesWithTagEnum

ldtk::Tileset::getTilesWithTagEnum(const ldtk::EnumValue& enumvalue) const -> const std::vector<int>&

Get a vector of all tiles ID tagged with a given EnumValue.

Throws and exception if the enumvalue argument does not have the right Enum type.

πŸ”

Clone this wiki locally