|
Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine. GitHub | Vesper Updates | Creator |
Represents a sub-region of a 2D texture, useful for sprite sheets. More...
#include <SubTexture2D.h>
Public Member Functions | |
| SubTexture2D (const Ref< Texture2D > &texture, const glm::vec2 &min, const glm::vec2 &max) | |
| Constructs a SubTexture2D from the given texture and texture coordinates. | |
| const Ref< Texture2D > | GetTexture () |
| Returns the underlying texture of the sub-texture. | |
| glm::vec2 * | GetTexCoords () |
| Returns the texture coordinates of the sub-texture. | |
Static Public Member Functions | |
| static Ref< SubTexture2D > | CreateFromCoords (const Ref< Texture2D > &texture, const glm::vec2 &coords, const glm::vec2 &cellSize, const glm::vec2 &spriteSize={1, 1}) |
| Creates a SubTexture2D from a grid of cells within the given texture. | |
Private Attributes | |
| Ref< Texture2D > | m_Texture |
| The underlying texture of the sub-texture. | |
| glm::vec2 | m_TexCoords [4] |
| The texture coordinates of the sub-texture. | |
Represents a sub-region of a 2D texture, useful for sprite sheets.
| Vesper::SubTexture2D::SubTexture2D | ( | const Ref< Texture2D > & | texture, |
| const glm::vec2 & | min, | ||
| const glm::vec2 & | max ) |
Constructs a SubTexture2D from the given texture and texture coordinates.
| texture | The texture from which the sub-texture is derived. |
| min | The minimum texture coordinates (bottom-left). |
| max | The maximum texture coordinates (top-right). |
References SubTexture2D().
Referenced by SubTexture2D().
|
static |
Creates a SubTexture2D from a grid of cells within the given texture.
| texture | The texture from which the sub-texture is derived. |
| coords | The coordinates of the cell in the grid. |
| cellSize | The size of each cell in the grid. |
| spriteSize | The size of the sprite in cells (default is 1x1). |
|
inline |
Returns the texture coordinates of the sub-texture.
Returns the underlying texture of the sub-texture.
|
private |
The texture coordinates of the sub-texture.