I would like to know how do you remove part of an image in games like Where’s my water. Is there any open classes that handle such things like CCblade or would anyone shed some light and provide me some guidance.
Thanks
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.
Based on the screenshots for that game, it looks like they might be using GCPaths to cut out pieces of the image dynamically.
Here is the reference material for Paths and Quartz 2D: https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211-TPXREF101
Basically you would do something like:
1) take your source image
2) draw it into a CGContext
3) create a path in the shape of the area you want to remove
3) set the blend mode of the context to kCGBlendModeClear
4) fill your path
5) export the image and replace the current image