0

I have a sprite sheet containing many images. I used texture packer to create the sprite sheet and it outputs a plist containing each image's dimensions and coordinates. Given this information what steps do I need to take to extract individual UIImages? It seems all the examples I find are in the context of Cocos2d which has it's own data format and helper classes. I am not creating animations or anything fancy nor is this a Cocos2d application. I just need to cut out images.

Thanks!!

Till
  • 27,494
  • 13
  • 87
  • 121
Nick
  • 18,642
  • 49
  • 180
  • 307

1 Answers1

2

I found the answer here

CGImageRef imageRef = CGImageCreateWithImageInRect([largeImage CGImage], cropRect);
UIImage *image = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
Community
  • 1
  • 1
Nick
  • 18,642
  • 49
  • 180
  • 307