How do I make a sprite graphic using CoreGraphics in Cocos2d?
I’m trying to make a sprite that uses the graphics that are made with core graphics.
Thanks for any insights and help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This solved it.
Answer below is copied from a reply I received on the Game Dev site: https://gamedev.stackexchange.com/questions/38071/how-to-make-a-sprite-using-coregraphics-ios-cocos2d-iphone
I don’t know cocos2d, so i just can just give you some tricks about CoreGraphics on iOS.
First, the simple case, if you can create sprite from a UIImage or a CGImageRef.
If you need to provide a buffer of data, and create your own CGContextRef :
See Apple documentation for all CGContext functions : https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGContext/Reference/reference.html
Hope this help.
End users answer.