iOS Dev (69) 單點觸摸時 Cocoa Touch API 座標轉換爲 OpenGL 座標
- 博客:http://blog.csdn.net/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];
}
-
轉載請註明來自:http://blog.csdn.net/prevention