ccTouchesBegan
GameSceneに実装しようとしています。
設定しましisTouchEnabled = YES
た。私も呼びかけaddStandardDelegate
ていtouchDispatcher
ます。最後に、私の中にAppDelegate
はがあり[glView setMultipleTouchEnabled:YES]
ます。
ただし、ccTouchesBeganが呼び出されることはありません。
私は何が間違っているのですか?
ccTouchesBegan
GameSceneに実装しようとしています。
設定しましisTouchEnabled = YES
た。私も呼びかけaddStandardDelegate
ていtouchDispatcher
ます。最後に、私の中にAppDelegate
はがあり[glView setMultipleTouchEnabled:YES]
ます。
ただし、ccTouchesBeganが呼び出されることはありません。
私は何が間違っているのですか?
解決しました!
前のレイヤーでタッチを登録していましたが、メソッドで「登録を解除」する必要があるため、レイヤーの割り当てが解除されませんでしたonExit
。
簡単touchesBegan
に言うと、GameLayerが別のレイヤーに飲み込まれていたため、GameLayerで呼び出されていませんでした。
ダミーアプリケーションを1つ作成し、これを試してください。
@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
それはあなたを助けるかもしれません。