나는 severals 레이어가 있고 그들에게 약간의 스프라이트가 추가되었습니다. 이 방식으로 액세서 시도 :시차가있는 코코스 2D 터치
-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
return YES;
}
내 애플 I 화면을 터치 할 때 충돌 :
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:[touch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
if(CGRectContainsPoint([[self getChildByTag:tagNumber] boundingBox], location)) {
CCLOG(@"You've touched the sprite!");
}
}
이상한 점은이 방법이없는 경우이다. 어떤 아이디어 일지 몰라?
UPDATE :
-(void) registerWithTouchDispatcher
{
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self
priority:0 swallowsTouches:YES];
}
[여기 내 로그] (http://pastie.org/private/qndnex0pgflefwhfuxlxpw); 네가 나에게 말했던 것과'ccTouchesBegan' 메서드가 호출되지 않았다. –