CCLayer is a subclass of CCNode that implements the TouchEventsDelegate protocol. All features from CCNode are valid, plus the following new features:
- It can receive iPhone Touches
- It can receive Accelerometer input
#include <Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h>
create one layer
If isTouchEnabled, this method is called onEnter. Override it to change the way CCLayer receives touch events. ( Default: CCTouchDispatcher::sharedDispatcher()->addStandardDelegate(this,0); ) Example: void CCLayer::registerWithTouchDispatcher() { CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this,INT_MIN+1,true); }
Register script touch events handler
Unregister script touch events handler
whether or not it will receive Touch events. You can enable / disable touch events with this property. Only the touches of this node will be affected. This “method” is not propagated to it’s children.
whether or not it will receive Accelerometer events You can enable / disable accelerometer events with this property.
whether or not it will receive keypad events You can enable / disable accelerometer events with this property. it’s new in cocos2d-x
Unregister keypad events handler