geSpriteSheet
From GriffinEngine
geSpriteSheet allows to create individual sprites from a large texture. The class assumes that all sprites have same dimensions and are arranged on a grid.
Usage
Inheritance
Base classes
- geObject
- geResource
- geSpriteSheet
- geResource
Reference
Constructors
Cut a texture into sprites; expects sprite dimensions and offset to be in pixels; offset is optional.
geSpriteSheet( geMaterial* _texture, UINT _spriteWidth, UINT _spriteHeight, UINT offsetX = 0, UINT offsetY = 0 );
Accessors
- ↖
int getID(){ return 0x0312; }
- ↖
virtual string getName() const;
UINT getWidth(); // get width of the whole underlying texture (in pixels)
UINT getHeight(); // get height of the whole underlying texture (in pixels)
UINT getSpriteWidth(); // get width of an individual sprite (in pixels)
UINT getSpriteHeight(); // get height of an individual sprite (in pixels)
float getSpriteWidthf(); // get width of an indivudual sprite as a fraction of the overall texture width
float getSpriteHeightf(); // get height of an indivudual sprite as a fraction of the overall texture height
UINT getSpriteCount(); // get the total number of sprites on this sheet
UINT getRows(); // get the number of rows (y-divisions) sprite rows on this sheet
UINT getColumns(); // get the number of columns (x-divisions) sprite rows on this sheet
geSprite* getSprite( const UINT spriteNumber ); // get sprite by its ordinal number
geSprite* getSprite( const UINT spriteRow, const UINT spriteColumn ); // get sprite by its row and column
Resources |
---|
geResourceManager · geResource |
geAnimation · geBitmap · geFont · geMaterial · geMesh · GeSound · GeSprite · GeSpriteSheet |