Problem with cocos2D for iPhone and touch detection

后端 未结 7 1090
后悔当初
后悔当初 2021-02-01 09:03

I just don\'t get it. I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to o

7条回答
  •  被撕碎了的回忆
    2021-02-01 09:40

    Have you added this to your layers init method?

        // isTouchEnabled is an property of Layer (the super class).
        // When it is YES, then the touches will be enabled
        self.isTouchEnabled = YES;
    
        // isAccelerometerEnabled is property of Layer (the super class).
        // When it is YES, then the accelerometer will be enabled
        self.isAccelerometerEnabled = YES;
    

提交回复
热议问题