![]() |
cocos2d-iphone
1.0.1
Improved Cocos2D API Reference (iOS version) for Kobold2D developers
|
#include <CCLayer.h>
Public Member Functions | |
void | registerWithTouchDispatcher () |
Protected Attributes | |
BOOL | isTouchEnabled_ |
BOOL | isAccelerometerEnabled_ |
Properties | |
BOOL | isTouchEnabled |
BOOL | isAccelerometerEnabled |
CCLayer is a subclass of CCNode that implements the TouchEventsDelegate protocol.
All features from CCNode are valid, plus the following new features:
void CCLayer::registerWithTouchDispatcher | ( | ) | [virtual] |
If isTouchEnabled, this method is called onEnter. Override it to change the way CCLayer receives touch events. ( Default: [[TouchDispatcher sharedDispatcher] addStandardDelegate:self priority:0] ) Example: -(void) registerWithTouchDispatcher { [[TouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES]; }
Valid only on iOS. Not valid on Mac.
BOOL CCLayer::isAccelerometerEnabled [read, write, assign] |
whether or not it will receive Accelerometer events You can enable / disable accelerometer events with this property.
Valid only on iOS. Not valid on Mac.
BOOL CCLayer::isTouchEnabled [read, write, assign] |
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.
Valid on iOS and Mac OS X v10.6 and later.