Skip to content
openFrameworks Addon for SpriteSheets and Animated Sprites generated from TexturePacker
C++ Other
  1. C++ 98.2%
  2. Other 1.8%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



OpenFrameworks addon for loading and rendering sprites and animated sprites generated from CodeAndWeb's TexturePacker application.

What is TexturePacker?

  • Allows quick creation of sprite sheets with reference name of the original image
  • Optimises rendering speed and memory usage of an App or Game
  • Mutli-OS (OSX,Linux,Windows)
  • Supports generating sprite sheets for different targets automatically (i.e. retina and non-retina)

What is a Sprite Sheet?

Get Texture Packer (has free to use version)

What this addon does?

  • This addon loads the exported TexturePacker texture and format into a usable data structure for c++ and openFrameworks.

What export settings do I use in TexturePacker Application?

  • Currently use "Generic XML"
  • May look into getting openFrameworks offically supported and have our own defined XML format.

Why use this addon?

  • Easy intergration.
  • Saves memory
  • Optimises rendering
  • Supports animation

How to refactor an ofImage into ofxTPSprite:

// Turn:
ofImage * normal = new ofImage();
// Into:
ofxTPSprite * normal = texturePacker.getSprite("images/normal.png");

How to load an animated sprite

ofxTexturePackerPtr texturepacker;
ofxTPAnimatedSpritePtr spaceship_sprite;

texturepacker = ofxTexturePackerPtr(new ofxTexturePacker());
spaceship_sprite = texturepacker->getAnimatedSprite("spaceship");

Don't forget to update() your sprite.


  • ofxTexturePacker loads the png image designated by the xml file using a path relative to the xml file's location.
  • getAnimationNames requires that you name your sprites with a common prefix
  • disable trimming if you set the pivot

Still a work in progress. Will be maintained.

You can’t perform that action at this time.