Aims:- Provide developers with a standard cross-platform and cross-application format for 2D sprites (osf file format).
- Provide artists with a GUI tool to create sprites
So basically the idea is that people make sprites on a GUI, mainly by importing images and defining animations, and developers just load and use the resulting files. People can share sprites to be used on games, etc.
Planned for first version- Static frames - each one is an image with an origin. Frames can be stored either as discrete images or as a tileset.
- Layered frames - each one is composed by several static frames (layers), each layer can have geometric transformations (translation, rotation, scale)
- Animations - each one is composed by either static and/or composed frames. Each animation frame has a delay in milliseconds (unsigned int)
- Support for indexed color images and palette swaps.
- Save/load to/from file, from memory etc
- Compression and encryption
The last two features are from
Codex.
The layered frames are optional, can be used for
.
Sometime I'd like to support frames based on text, shapes/SVG, not just images, maybe one day..
Currently I'm working on a core abstract lib, and a binding for SFML. I should be releasing a first build soon so I can have your feedback and help.
Bindings for SDL etc should be easy to create but I don't plan to do it myself.
Currently using an existing sprite looks like this:
osf::SpriteResource resource;
resource.loadFromFile("MySprite.osf");
osf::Sprite sprite(resource); // inherits from sf::Sprite, so you can move, rotate, etc
...
// set sprite to static frame number 10
sprite.setFrame(10);
...
// set animation with the key 31.
sprite.setAnimation(31);
...
// update animation (time passed in milliseconds
sprite.update( window.GetFrameTime() );
...
// set animation progress to 30%
sprite.setProgress(0.3f);
The GUI will probably have to wait, or if someone want to volunteer for it it would be cool too. I did a prototype some months ago (it's not compatible with the new format)
Please let me know what you think of the idea and if you think people would use it :wink: