2012-12-07 99 views
1

我試圖在我的GameScene中實現ccTouchesBeganccTouchesBegin not called

我設置isTouchEnabled = YES。我還打電話addStandardDelegatetouchDispatcher。最後,在我的AppDelegate我有[glView setMultipleTouchEnabled:YES]

但是,ccTouchesBegan永遠不會被調用。

我在做什麼錯?

回答

1

解決它!

我正在註冊上一層的觸摸,但該層並沒有被處理,因爲您必須使用onExit方法「取消註冊」。

長話短說:touchesBegan,因爲它正被另一個層吞食沒有被叫上我的GameLayer。

0

創建一個虛擬應用程序並嘗試這個辦法:

@protocol CCStandardTouchDelegate <NSObject> 
@optional 
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; 
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; 
- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; 
- (void)ccTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; 
@end 

可能它會幫助你..