How to pick CCSprite area by transparency?

How to pick CCSprite area by transparency?
0.0 0



I try to search cocos2d-x class or method for picking by transparency.

I use a png image. png image has a transparency area.

I don’t want to click transparency area. Just only click and pick my object when I got a non transparency area.

for this. I searched a lot of sites and communities. but I just got a this sites.

but it was Opengl function. It is not cocos2d-x.

anybody knows cocos2d-x class for picking?
almost solution is make CCRect. but I don’t want to that.

Because circle, star or triangle is not rectangle.

if cocos2d-x doesn’t support it, I must got a different way like box2d, opengl method.
I attached two picture file.

pixel_picking.jpg (21.8 KB)


Cocos2d-x is also based on OpenGL ES 1.1, so the approach in “fast pixel collision detection” article can be use here, too.
But be ware that adjusting transparency by pixels would be very expensive on time.


Thank you. very much.
Your mention is all right.

It is expensive way. When my skill will be upgrade, I will make it.