iOS Dev (69) 单点触摸时 Cocoa Touch API 坐标转换为 OpenGL 坐标
- 博客:http://blog.youkuaiyun.com/prevention
- 作者:大锐哥
- 摘自:
Learn iPhone and iPad cocos2d Game Development
-
-(CGPoint) locationFromTouches:(NSSet *)touches
{
UITouch *touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView: [touch view]];
return [[CCDirector sharedDirector] convertToGL:touchLocation];
}
-