A tile layer contain a matrix of global tile id and a list of TileSet.
More...
#include <C_tilelayer.hpp>
|
class | Tile |
| A tile that contain drawing information and its global id. More...
|
|
|
void | draw (fge::RenderTarget &target, fge::RenderStates const &states) const override |
|
void | clear () |
| Clear the matrix of tiles.
|
|
void | setId (TileId id) |
| Set the id of the layer (mostly for "Tiled" map editor compatibility)
|
|
TileId | getId () const |
| Get the id of the layer.
|
|
void | setName (std::string name) |
| Set the name of the layer.
|
|
std::string const & | getName () const |
| Get the name of the layer.
|
|
fge::Matrix< TileLayer::Tile > const & | getTiles () const |
| Get the matrix of tiles.
|
|
void | setGid (std::size_t x, std::size_t y, TileSetList const &tileSets, TileId gid) |
| Shortcut to set a global tile id and a new tileset.
|
|
void | setGid (std::size_t x, std::size_t y, TileId gid) |
| Shortcut to set a global tile id.
|
|
void | setGridSize (std::size_t x, std::size_t y) |
| Set the tiles matrix size.
|
|
void | refreshTextures (TileSetList const &tileSets) |
| Refresh all tiles with a list of tilesets.
|
|
void | setPosition (Vector2f const &position) |
|
Vector2f const & | getPosition () const |
|
void | move (Vector2f const &offset) |
|
void | setRotation (float angle) |
|
float | getRotation () const |
|
void | rotate (float angle) |
|
void | setScale (Vector2f const &factors) |
|
void | setScale (float factor) |
|
Vector2f const & | getScale () const |
|
void | scale (Vector2f const &factor) |
|
void | scale (float factor) |
|
void | setOrigin (Vector2f const &origin) |
|
Vector2f const & | getOrigin () const |
|
glm::mat4 const & | getTransform () const |
|
glm::mat4 const & | getInverseTransform () const |
|
A tile layer contain a matrix of global tile id and a list of TileSet.
This class is compatible with the "Tiled" map editor.
◆ clear()
void fge::TileLayer::clear |
( |
| ) |
|
Clear the matrix of tiles.
◆ draw()
◆ getId()
TileId fge::TileLayer::getId |
( |
| ) |
const |
|
nodiscard |
Get the id of the layer.
- Returns
- The id of the layer
◆ getName()
std::string const & fge::TileLayer::getName |
( |
| ) |
const |
|
nodiscard |
Get the name of the layer.
- Returns
- The name of the layer
◆ getTiles()
Get the matrix of tiles.
- Returns
- The matrix of tiles
◆ refreshTextures()
void fge::TileLayer::refreshTextures |
( |
TileSetList const & | tileSets | ) |
|
Refresh all tiles with a list of tilesets.
- Parameters
-
tileSets | The list of tilesets |
◆ setGid() [1/2]
void fge::TileLayer::setGid |
( |
std::size_t | x, |
|
|
std::size_t | y, |
|
|
TileId | gid ) |
Shortcut to set a global tile id.
- Parameters
-
x | The x position of the tile |
y | The y position of the tile |
gid | The global tile id |
◆ setGid() [2/2]
void fge::TileLayer::setGid |
( |
std::size_t | x, |
|
|
std::size_t | y, |
|
|
TileSetList const & | tileSets, |
|
|
TileId | gid ) |
Shortcut to set a global tile id and a new tileset.
- Parameters
-
x | The x position of the tile |
y | The y position of the tile |
tileSets | The list of tilesets |
gid | The global tile id |
◆ setGridSize()
void fge::TileLayer::setGridSize |
( |
std::size_t | x, |
|
|
std::size_t | y ) |
Set the tiles matrix size.
- Parameters
-
x | The x size of the matrix |
y | The y size of the matrix |
◆ setId()
void fge::TileLayer::setId |
( |
TileId | id | ) |
|
Set the id of the layer (mostly for "Tiled" map editor compatibility)
- Parameters
-
◆ setName()
void fge::TileLayer::setName |
( |
std::string | name | ) |
|
Set the name of the layer.
- Parameters
-
name | The name of the layer |
The documentation for this class was generated from the following file: