i'm working on kid's game cocos2d, , 1 of stages involves user clearing sand/snow covering box. thus, i'm implementing eraser tool based on i've seen here: http://muhammedalee.wordpress.com/2012/09/21/erasing-pixels-from-ccrendertexture/. basically, have pilesprite (a pile of sand) on call:
[rendertexture begin]; [pilesprite visit]; [rendertexture end];
so it's rendered rendertexture. when eraser dragged on sprite, do:
[rendertexture begin]; [erasersprite visit]; [rendertexture end];
i want know when entire pilesprite has been erased (opacity = 0) in order trigger completion of task. call checking method every cctouchended. supposed go on pixels in rendertexture's uiimage? there way iterate on sprite's pixels , check whether each pixel transparent? appreciate help. i've looked this: how pixel data uiimage (cocoa touch) or cgimage (core graphics)? well, don't know values set count, xx, yy.
Comments
Post a Comment