Creates a sprite object based on an image file containing a sprite or a spritesheet.
To create a new Sprite just pass the image name as first parameter:
gfx.CreateSprite( "/Sys/Img/Bunny.png", "bunnies" );
Spritesheets can be loaded in two ways:
The simple one is a specific file pattern
if you have a different amount of sprites than the rectangle of spritesx * spritesy sprites.
Example from the downloadable demo Grannies and Zombies:
zombie = gfx.CreateSprite( "Img/Zombie_strip35_1400x1000x7x5", "zombie" );
The second way is to create a SpriteSheet using the CreateSpriteSheet method which might come handy if a single sprite has multiple animations or if a sprite is reused but using a different sprite sheet.
Methods
The following methods are available on the Sprite object: