Class TileSet¶
-
class TileSet : public ISaveable¶
The TileSet class represents a collection of tiles that can be used for a TileMap or another object
See also
TileMap
Public Functions
-
TileSet()¶
Empty constructor.
-
TileSet(const std::string &fileName)¶
Constructor that takes the path to the .rtiles file
-
TileSet(const std::string &textureSource, Vector2 tileSize)¶
Constructor that takes the path of the texture (image file) and a Vector2 that represents the tile size
-
TileSet(const std::string &textureSource, int tileSizeInt)¶
Like TileSet(std::string textureSource, Vector2 tileSize), but takes an int for tile size with identical width and height (square tiles)
-
TileSet(TileSetBin bin)¶
Constructor that takes the TileSetBin binary structure
-
void unload() const¶
Unload routine
-
Vector2 getTileSize() const¶
Get the size of a tile. Since a tile may have different width and height, it returns a Vector2
-
void setTileSize(int size)¶
Set the tile size to an integer value. Both width and height will be this value.
-
void setTileSizeVector(Vector2 vec)¶
Set the tile size to a Vector2 value. The x component is taken for width; the y component is taken for height.
-
void setTileHeight(int value)¶
Set a tile unit height.
-
void setTileWidth(int value)¶
Set a tile unit width.
-
std::string getTextureSource()¶
Get the path to the texture image file.
-
bool areAtlasCoordsValid(Vector2 atlasCoords) const¶
Check whether the given coordinates are valid
-
TileSet()¶