スプライトをタッチしたときに、複数のスプライトの中からスプライト(ポリゴン)を探したいです。
次のコードを試していますが、機能していません。
CCTouchBegan イベント:
CCPoint point = this->convertTouchToNodeSpace(ptouch);
CCRect bomb11Rect = CCRectMake(bomb->getPosition().x ,
bomb->getPosition().y ,
bomb->getContentSize().width,
bomb->getContentSize().height);
CCRect posRect = CCRectMake(point.x ,
point.y ,
1,
1);
if (bomb11Rect.intersectsRect(posRect))
{
CCLog("Touch the sprite");
}
else
{
CCLog("Not Touch the sprite");
}
上記の問題を解決するためのアイデアを教えてください。