Class TileMap¶
-
class TileMap¶
A TileMap represents a map of the placed tiles in a Room.
Public Functions
-
TileMap(const std::string &fileName)¶
Construct from a file name/path
-
TileMap(const std::string &tileSetSource, int width, int height, int atlasTileSize, int worldTileSize)¶
Construct using a TileSet path, width, height
-
TileMap(const TileSet &tileSet, int width, int height, int atlasTileSize, int worldTileSize)¶
Constructor using a TileSet object
-
TileMap(std::unique_ptr<TileSet> tileSetPtr, int width, int height, int atlasTileSize, int worldTileSize)¶
Constructor using a unique_ptr of a TileSet
-
void unload() const¶
Unload routine. Typically calls raylib’s UnloadTexture.
-
void update() const¶
Update routine.
-
void draw() const¶
Draw routine.
-
void setTileSet(const std::string &tileSetSource)¶
Set a new TileSet for this TileMap using a path for the new TileSet
-
void setTile(Vector2 worldPos, Vector2 atlasPos)¶
Set the tile at the specified world position to be a tile at the specified atlas position from the TileSet.
-
void setEmptyTile(Vector2 worldPos)¶
Set the tile at the specified world position to be empty (not drawn).
-
void drawTile(int x, int y) const¶
Draw the tile at the specified world x and y coordinates.
-
TileMap(const std::string &fileName)¶