#include <spritegrid.h>
◆ SpriteGrid() [1/2]
yourgame::gl::SpriteGrid::SpriteGrid |
( |
| ) |
|
◆ SpriteGrid() [2/2]
yourgame::gl::SpriteGrid::SpriteGrid |
( |
SpriteGrid const & |
| ) |
|
|
delete |
◆ ~SpriteGrid()
yourgame::gl::SpriteGrid::~SpriteGrid |
( |
| ) |
|
◆ geo()
Geometry * yourgame::gl::SpriteGrid::geo |
( |
| ) |
const |
|
inline |
- Returns
- pointer to geometry object (m_geo)
◆ make()
int yourgame::gl::SpriteGrid::make |
( |
const yourgame::gl::Texture * |
atlas, |
|
|
const std::vector< std::string > & |
tiles, |
|
|
unsigned int |
width, |
|
|
float |
gridWidth, |
|
|
float |
gridHeight |
|
) |
| |
creates grid geometry in x-y plane (z = 0)
- planar grid in x-y plane (z=0), 2 ccw trianlges per tile
- drawing: bind texture manually and get geometry for drawing via geo()
- aspect ratio taken from first tile
- atlas is only used for geometry creation, pointer is not kept
- atlas should have only 1 texture
- Parameters
-
atlas | atlas, the coordinates are taken from |
tiles | names of tiles in atlas, in row-major order |
width | number of tiles per row. if = 0, all tiles in 1 row |
gridWidth | desired width of entire grid. if <= 0.0f, aspect ratio and gridHeight (if > 0.0f) used |
gridHeight | desired height of entire grid. if <= 0.0f, aspect ratio and gridWidth (if > 0.0f) used |
- Returns
- error (0 on success)
◆ operator=()
The documentation for this class was generated from the following files: