我是客观C和iPhone游戏开发的新手。我在理解在cocos中实现触摸的代码时遇到了一些困难。请问有人给我一些解释吗?
-(BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)events
{
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView: [touch view]];
CGPoint convertedLocation = [[Director sharedDirector] convertCoordinate:location];
lady.position = convertedLocation;
return kEventHandled;
}
请解释这些代码。我想知道它是如何一行一行的。 提前致谢
答案 0 :(得分:0)
UITouch ref http://developer.apple.com/iphone/library/documentation/UIKit/Reference/...
Example code使用UITouch
您可以google获取更多
它看起来像标准UITouch
处理代码。
lady
)的位置设置为触摸事件的位置