我想从UIGestureRecognizer获取我的点击的UITouch位置,但我无法通过查看文档和其他SO问题来确定该如何操作.你们谁能给我指路吗?
- (void)handleTap:(UITapGestureRecognizer *)tapRecognizer
{
CCLOG(@"Single tap");
UITouch *locationOfTap = tapRecognizer; //This doesn't work
CGPoint touchLocation = [_tileMap convertTouchToNodeSpace:locationOfTap];
//convertTouchToNodeSpace requires UITouch
[_cat moveToward:touchLocation];
}
FIXED CODE HERE - THIS ALSO FIXES INVERTED Y AXIS
CGPoint touchLocation = [[CCDirector sharedDirector] convertToGL:[self convertToNodeSpace:[tapRecognizer locationInView:[[CCDirector sharedDirector] openGLView]]]];