When I use the
self.isTouchEnabled = YES
in Cocos2d v2.0
for the layer could be touched,the Xcode give me a tip:
setIsTouchEnabled: is deprecated
Now, I just want to know alternative method for isTouchEnabled.
Here is new code:
self.touchEnabled = YES; //In Cocos2d 2.0 self.userInteractionEnabled = YES; //In Cocos2d 3.0
Just wondering why genius people(Cocos2d team) doing this kind of silly change!
But this one is the right call to setup touch in Cocos2d 2.x and above !!!
It seems the setIsTouchEnabled
is located in "CCDeprecated.h" now.
The following method is in the current "CCLayer.h":
[self setTouchEnabled:YES]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With