开发者

How to make a hole in an image iphone

开发者 https://www.devze.com 2023-04-04 01:53 出处:网络
I have a game that players place their pieces on the screen then press set. I am using cocos 2d to build the iphone app. It is kind of like hide and seek. I then overlay a开发者_StackOverflow backgrou

I have a game that players place their pieces on the screen then press set. I am using cocos 2d to build the iphone app. It is kind of like hide and seek. I then overlay a开发者_StackOverflow background on top of all of that. I want to be able to tap on the screen and create a hole in my background at that spot so that I can see through it. I know I can just create a giant image with a hole in it and move it around, but my background can only be a color it can't be an image. How should I go about doing this.


Instead of trying to see "through" the overlay, place the "background" image on top in circles. Map the screen coordinates on top of the "background" image, then extract a circular region from that image to place on the screen. The biggest challenge would be capturing a circular region from your bitmap. I'm not too familiar with cocos2d, but there should be a library you can use for it.

0

精彩评论

暂无评论...
验证码 换一张
取 消