2011-09-12 101 views

回答

4

你真的沒有問過那裏的問題,我編輯了你的問題。我認爲這應該會給你一個好的開始。

實現CCTargetedTouchDelegateProtocol並關注此方法。

-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event 
{ 
    if (CGRectContainsPoint(GCRectMake(/*Define a rect to represent the center of your sprite*/), [touch locationInView:/*View where you want the touch to be located, usually linked to the CCDirectors OpenGL view*/]) 
    { 
     [sprite stopAllActions]; 
    } 
}