#include <SpriteManager.h>
Public Member Functions | |
| int | addSprite (char *filename) |
| Loads a sprite from disk. | |
| void | freeSprites () |
| Frees all textures. | |
| void | drawSprite (int num, int x, int y, int width, int height, float rotation=0.0f) |
| Draw a given sprite at a given location (in pixels) [2D Only]. | |
| void | setScreenSize (int w, int h) |
| Sets the screen culling size (in pixels) [2D Only]. | |
| int | getScreenWidth () |
| Returns the width of the screen culling size [2D only]. | |
| int | getScreenHeight () |
| Returns the height of the screen culling size [2D only]. | |
| int | size () |
| Returns the count of sprites contained within. | |
| GLuint * | getSprite (int num) |
| Returns a texture handle. | |
| SpriteManager (char *dir) | |
| Constructor. | |
| ~SpriteManager () | |
| Destructor. | |
|
|
Constructor. Create a new SpriteManager based on the sequentially numbered contents of a directory dir. Files should be named [0..n].png, with no gaps.
|
|
|
Loads a sprite from disk. Add a sprite from filename and return the ID that will be used from now on.
|
|
||||||||||||||||||||||||||||
|
Draw a given sprite at a given location (in pixels) [2D Only]. Draws a given sprite with details Set both targetX and targetY to -1337 to draw the sprite at dead centre of the screen (requires you have called SpriteManager::setScreenSize)
|
|
|
Frees all textures. Tells the SpriteManager to dump all textures that it knows about. After calling this function, all sprite IDs will be invalidated. |
|
|
Returns the height of the screen culling size [2D only]. Returns the height of the screen, as SpriteManager knows it. Set this value with SpriteManager::setScreenSize
|
|
|
Returns the width of the screen culling size [2D only]. Returns the width of the screen, as SpriteManager knows it. Set this value with SpriteManager::setScreenSize
|
|
|
Returns a texture handle. Returns the raw texture for a given sprite ID
|
|
||||||||||||
|
Sets the screen culling size (in pixels) [2D Only]. Set the width and height of the viewport. Doing so automatically enables culling by draw()
|
|
|
Returns the count of sprites contained within. Return the count of sprites loaded by this Sprite Manager.
|
1.4.6