I’ve been exploring ofxSpriteSheetRenderer but I think its started off being too complicated for most beginners.
All I would like from a sprite sheet class is to load an image, set rect areas for sub images that I can reference by an id/name. I don’t need animation timing control over sprites, or the ability to build sprite sheets from code.
This looks like a really useful bit of software: www.texturepacker.com
My attempt to do this with ofxSpriteSheetRenderer is leading to unknown issues, partly because its hard to get started probably.
So far I’ve done;
// .h
LinearTexture myTexture;
ofxSpriteSheetRenderer * spriteRenderer;
// .cpp setup
myTexture.loadTexture("test.png", GL_RGBA);
spriteRenderer->loadTexture(&myTexture);
bool ok = spriteRenderer->addTile(200.0, 200.0, 500, 501, 0, 100, 200);
Does anyone have an example of how to do this properly? Zachg? Would be much appreciated.
Cocos2d seems a little easier to understand
http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d
An ideal spriteSheet addon that is simple to use could look like this:
spriteSheet.loadImage("blah.png");
spriteSheet.addTile("myname", x, y, w, h);
Then it would be easy to have a function that loads different xml formats, texturePacker native or cocos2d, then cycle through and add the tiles.
Does anyone have any thoughts on this?
All the best