#include <tb_sprite_map.h>
Public Member Functions | |
SpriteMap (const TextureHandle &textureHandle, const PixelSpace &frameWidth, const PixelSpace &frameHeight, const PixelSpace &spacingX=0, const PixelSpace &spacingY=0, const PixelSpace &offsetX=0, const PixelSpace &offsetY=0) | |
virtual | ~SpriteMap (void) |
SpriteFrame | GetSpriteFrameAtIndex (const size_t &frameIndex) const |
SpriteFrame | GetSpriteFrameAtLocation (const size_t &frameColumn, const size_t &frameRow) const |
size_t | GetIndexCount (void) const |
size_t | GetColumnCount (void) const |
size_t | GetRowCount (void) const |
PixelSpace | GetFrameWidth (void) const |
PixelSpace | GetFrameHeight (void) const |
TextureHandle | GetTextureHandle (void) const |
void | RenderSpritesByIndex (const tbCore::uint16 *const spriteArray, const size_t &columnCount, const size_t &rowCount, const tbMath::Vector2 &position=tbMath::Vector2::Zero()) const |
Provides an interface to create sprite frames by index or location for the AnimationSequences or the TileSystem and will contain a way to efficiently render an array of these sprite frames for the TileSystem.
TurtleBrains::Graphics::SpriteMap::SpriteMap | ( | const TextureHandle & | textureHandle, |
const PixelSpace & | frameWidth, | ||
const PixelSpace & | frameHeight, | ||
const PixelSpace & | spacingX = 0 , |
||
const PixelSpace & | spacingY = 0 , |
||
const PixelSpace & | offsetX = 0 , |
||
const PixelSpace & | offsetY = 0 |
||
) |
Creates a SpriteMap of the given texture which will describe where each SpriteFrame is located when given a location (column, row) or index.
textureHandle | The texture that the SpriteMap is referring to, MUST be a valid TextureHandle or an errro condition will be triggered. |
frameWidth | The width of each sprite frame in the map, in pixels, on the texture. |
frameHeight | The height of each sprite frame in the map, in pixels, on the texture. |
spacingX | An optional value for horizontal spacing between each sprite frame in pixels. |
spacingY | An optional value for vertical spacing between each sprite frame in pixels. |
offsetX | An optional horizontal offset to the left edge of the first mapped frame, if used the first row is shifted right horizontally by this amount in pixels. |
offsetY | An optional vertical offset to the top efge of the first mapped frame, if used the first column is shifted down vertically by this amount in pixels. |
|
virtual |
Destroys and cleans up after the SpriteMap, ?which may include deleting an array of indices? TODO: TurtleBrains: Documentation: Teach the user how to use this.
size_t TurtleBrains::Graphics::SpriteMap::GetColumnCount | ( | void | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
PixelSpace TurtleBrains::Graphics::SpriteMap::GetFrameHeight | ( | void | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
PixelSpace TurtleBrains::Graphics::SpriteMap::GetFrameWidth | ( | void | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
size_t TurtleBrains::Graphics::SpriteMap::GetIndexCount | ( | void | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
size_t TurtleBrains::Graphics::SpriteMap::GetRowCount | ( | void | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
SpriteFrame TurtleBrains::Graphics::SpriteMap::GetSpriteFrameAtIndex | ( | const size_t & | frameIndex | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
SpriteFrame TurtleBrains::Graphics::SpriteMap::GetSpriteFrameAtLocation | ( | const size_t & | frameColumn, |
const size_t & | frameRow | ||
) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
TextureHandle TurtleBrains::Graphics::SpriteMap::GetTextureHandle | ( | void | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
void TurtleBrains::Graphics::SpriteMap::RenderSpritesByIndex | ( | const tbCore::uint16 *const | spriteArray, |
const size_t & | columnCount, | ||
const size_t & | rowCount, | ||
const tbMath::Vector2 & | position = tbMath::Vector2::Zero() |
||
) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.