First i have scaled the layer larger which contains the sprites.
Now I need to sense touch on a sprite.
I have tried as follows, but cant reach to goal-
CGRect tRect= [[aSprite displayedFrame] rect];
if(CGRectContainsPoint(tRect, touchedPosition))
{
NSLog(@"touched:>> touch at (%f,%f)",touchedPosition.x,touchedPosition.y);
// Do something, maybe return kEventHandled;
}
else{
NSLog(@"NOT touched: touch at (%f,%f)",touchedPosition.x,touchedPosition.y);
}
FYI: I have used cocos2d framework
At last I have found the solution :), here is the code
where ‘self’ is the sprite holder layer as I have specified before. This layer is listening the touch event.