Using CGContext to display a sprite sheet iPhone

后端 未结 2 1542
刺人心
刺人心 2020-12-15 02:30

So I have a spritesheet in png format, and have already worked out the coordinates for what I want to display. I\'m trying to create a method that will return a UIImage when

2条回答
  •  旧时难觅i
    2020-12-15 02:32

    I think the call you want to use is CGImageCreateWithImageInRect

    newImage = [UIImage imageWithCGImage:CGImageCreateWithImageInRect( [spriteSheet CGImage] , imageRect )];
    

提交回复
热议问题