#include <components.hpp>
Using the Tilemap class, you can draw Tiles to the screen. Tiles define a sourceRect, among other things.
Here is a basic example:
std::shared_ptr<Node> node = std::make_shared<Node>("tileNode");
tilemap->addTiles(
);
node->addComponent(map);
Definition definitions.hpp:294
Definition definitions.hpp:509
Definition definitions.hpp:77
Make sure to check out the platformer example too! It uses the Tilemap component for its map rendering.
◆ Tilemap() [1/2]
◆ Tilemap() [2/2]
◆ addTile()
| int Tilemap::addTile |
( |
const Tile & |
tile | ) |
|
◆ addTiles()
template<typename... Args>
| void Tilemap::addTiles |
( |
Args... |
tiles | ) |
|
|
inline |
◆ bake()
◆ initialize()
| void Tilemap::initialize |
( |
| ) |
|
|
inlinevirtual |
◆ load()
template<class Archive >
| void Tilemap::load |
( |
Archive & |
ar | ) |
|
|
inline |
◆ removeTile()
| void Tilemap::removeTile |
( |
int |
index | ) |
|
◆ render()
| void Tilemap::render |
( |
std::shared_ptr< Window > |
window | ) |
|
|
overridevirtual |
◆ save()
template<class Archive >
| void Tilemap::save |
( |
Archive & |
ar | ) |
const |
|
inline |
◆ update()
◆ indexBuffer
| std::vector<int> Tilemap::indexBuffer |
◆ texture
◆ tiles
| std::vector<Tile> Tilemap::tiles |
◆ tileSize
◆ vertexBuffer
| std::vector<SDL_Vertex> Tilemap::vertexBuffer |
◆ visible
| bool Tilemap::visible = true |
The documentation for this class was generated from the following files: