-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint point1 = [touch previousLocationInView:[touch view]];
CGPoint point2 = [touch locationInView:[touch view]];
point1 = [[CCDirector sharedDirector]convertToGL:point1];
point2 = [[CCDirector sharedDirector]convertToGL:point2];
pre = point1;
curr = point2;
CCLOG(@"the pre location is %@",NSStringFromCGPoint(pre));
CCLOG(@"the curr location is %@",NSStringFromCGPoint(curr));
}
위 코드에 어떤 오류가 있습니까? pre와 curr 변수는 같은 결과를 출력합니까?CCTouchesBegan 문제
내 앱에는 다음과 같은 req가 있습니다. 한 순간에 스프라이트를 선택한 다음 다음 터치 포인트로 이동하고 싶습니다. – user1761217