-
Notifications
You must be signed in to change notification settings - Fork 28
Tileset
A Tileset contains information about a texture used to draw tiles.
const std::string ldtk::Tileset::nameName of the Tileset.
const int ldtk::Tileset::uidUnique identifier of the Tileset.
const std::string ldtk::Tileset::pathRelative path to the Tileset's texture image file.
const ldtk::IntPoint ldtk::Tileset::texture_sizeSize in pixels of the Tileset's texture.
const int ldtk::Tileset::tile_sizeSize in pixels of a tile in the Tileset. Tiles are always square shaped.
const int ldtk::Tileset::spacingSpacing in pixels between tiles in the Tileset.
const int ldtk::Tileset::paddingPadding in pixels to the first row and column of tiles in the Tileset.
getTileIdAtgetTileTexturePosgetTileCustomDatagetTileEnumTagshasEnumTagsgetEnumTagsEnumgetTilesByEnumTaghasTagallTags
ldtk::Tileset::getTileIdAt(int pos_x, int pos_y) const -> intReturns the tile id at the given position in pixels.
ldtk::Tileset::getTileTexturePos(int tile_id) const -> ldtk::IntPointReturns the texture coordinates of the Tile ID.
ldtk::Tileset::getTileCustomData(int tile_id) const -> const std::string&Returns the custom data associated with the Tile ID.
ldtk::Tileset::getTileEnumTags(int tile_id) const -> const std::vector<std::reference_wrapper<const EnumValue>>&Returns a vector containing the EnumTags associated with the Tile ID.
ldtk::Tileset::hasEnumTags() const -> boolReturns true if the Tileset has enum tags associated to tiles, false otherwise.
ldtk::Tileset::getEnumTagsEnum() const -> const Enum&Returns the Enum type used by this Tileset's EnumTags.
ldtk::Tileset::getTilesByEnumTag(const ldtk::EnumValue& enumvalue) const -> const std::vector<int>&Get a vector of all tiles ID tagged with a given EnumValue.
Throws an invalid_argument exception if the EnumValue argument does not have the right Enum type.
Inherited from TagsContainer
ldtk::Tileset::hasTag(const std::string&) const -> boolReturns true if the Tileset contains the given tag, returns false otherwise.
Inherited from TagsContainer
ldtk::Tileset::allTags() const -> const std::vector<std::string>&Returns a vector containing all the tags in the Tileset.