We are currently building a lot of game prototypes as part of our Ünterplay project at the Media Design department of the HEAD —Genève. A lot of these games require sprites of some sort. So here is a simple demo project showing how to integrate ofxSprite into a basic OpenFrameworks project for iOS. This same technique should also work fine on Mac OS X, Windows and Linux, as the only other dependency is ofxAssets.
1. Start with a copy of a basic EmptyExample from the OpenFrameworks examples folder
3. Drag the two new addons into your XCode project. Delete the references to the « README » files if you want to:
4. If you encouter problems with the « ofxExtras.h » addon, you can safely de-activate it as in the following illustration:
5. Copy the « testApp.h » and « testApp.cpp » files from the SpriteDemo.zip example provided here.
6. Make sure to copy the included « Personnage » folder with the eight PNG images of the sprite. You can obviously replace this image sequence with any sequence of your own, in which case you will need to change line no.24 of « testApp.cpp », using your own file/folder name.
7. Compile and run the example.