Loads a tile sheet image and slices it into a grid of Sprites, accessible by their (x, y) coordinates.
More...
#include <Tileset.hpp>
Loads a tile sheet image and slices it into a grid of Sprites, accessible by their (x, y) coordinates.
◆ Tileset()
| turbo::Tileset::Tileset |
( |
Path * | path, |
|
|
const Vector2< unsigned short > & | tile_size, |
|
|
const Vector2< unsigned short > & | tiles_nbr, |
|
|
const unsigned short & | margin = 0, |
|
|
const unsigned short & | border_offset = 0 ) |
|
explicit |
Create a tileset
- Parameters
-
| path | path to the texture file |
| tile_size | size of the tile |
| tiles_nbr | amount of tiles |
| margin | margin between the tiles |
| border_offset | offset around all the textures |
◆ ~Tileset()
| turbo::Tileset::~Tileset |
( |
| ) |
|
◆ get_size()
| const Vector2< unsigned short > & turbo::Tileset::get_size |
( |
| ) |
const |
◆ get_sprite() [1/2]
| Sprite * turbo::Tileset::get_sprite |
( |
const Vector2< unsigned short > & | coords | ) |
const |
◆ get_sprite() [2/2]
| Sprite * turbo::Tileset::get_sprite |
( |
unsigned short | x, |
|
|
unsigned short | y ) const |
◆ operator()() [1/2]
| Sprite * turbo::Tileset::operator() |
( |
const Vector2< unsigned short > & | coords | ) |
const |
◆ operator()() [2/2]
| Sprite * turbo::Tileset::operator() |
( |
unsigned short | x, |
|
|
unsigned short | y ) const |
The documentation for this class was generated from the following files: