нет возврата ничего.
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
и вы должны использовать это для одного касания;
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event;
он также поддерживает мультитач:
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
NSArray *allTouches = [[event allTouches] allObjects];
for (int i=0; i<[allTouches count];i++) {
if ([some conditions]) {
CGPoint position = [(UITouch*)[allTouches objectAtIndex:i] locationInView:[[CCDirector sharedDirector]openGLView]];
position.y = [[CCDirector sharedDirector]winSize].height - position.y;
//deal with the position;
return TRUE;
}
}
return FALSE;
}
Сначала вы должны активировать сенсорное взаимодействие:
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
//if support multi touch you must set swallowsTouches "NO".