3.1.1如何获取点击位置是否透明

如何获取点击Sprite上的位置是否为透明的
或者点击在一张图片上,如何判断他是否为透明
我用的是3.1.1,求高人回答,最好有代码示例的

用CCImage处理,在CCImage里添加如下代码
int Image::getAlphaWithPoint(int x, int y)
{
unsigned int* pixel = (unsigned int*)_data;
pixel = pixel + (y * int(_width)) + x;

int alpha = (*pixel >> 24) & 0xff;

return alpha;

}

可以参考:

http://cn.cocos2d-x.org/tutorial/show?id=1156

http://www.cocoachina.com/bbs/read.php?tid=209290