|
Muto 0.0.1
|
Represents a sub-region of a 2D texture, useful for sprite sheets. More...
#include <SubTexture2D.h>
Public Member Functions | |
| glm::vec2 * | GetTexCoords () |
| Returns the texture coordinates of the sub-texture. | |
| const Ref< Texture2D > | GetTexture () |
| Returns the underlying texture of the sub-texture. | |
| SubTexture2D (const Ref< Texture2D > &texture, const glm::vec2 &min, const glm::vec2 &max) | |
| Constructs a SubTexture2D from the given texture and texture coordinates. | |
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 | |
| glm::vec2 | m_TexCoords [4] |
| The texture coordinates of the sub-texture. | |
| Ref< Texture2D > | m_Texture |
| The underlying texture of the sub-texture. | |
Represents a sub-region of a 2D texture, useful for sprite sheets.
| Muto::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.