I have a UIImage containing an image with a whole bunch of smaller pictures on the image (essentially an image strip containing sprites). I'd like to draw a single sprite onto an area of my UIView.
I can't seem to find a way draw only part of the UIImage onto the view. Is there a method that does this?
I think you may be looking for CGImageCreateWithImageInRect(). You can get a CGImage
from a UIImage
with the property of the same name.
EDIT: another option that exists in 2014, that did not in 2009, is SpriteKit. Depending on what you might be doing that needs a sprite sheet, that might be useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With