cocos2d-iphone  2.0
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCLayer Class Reference

#import <CCLayer.h>

Inheritance diagram for CCLayer:
Collaboration diagram for CCLayer:

List of all members.

Public Member Functions

(void) - registerWithTouchDispatcher

Protected Attributes

BOOL isTouchEnabled_
BOOL isAccelerometerEnabled_

Properties

BOOL isTouchEnabled
BOOL isAccelerometerEnabled

Detailed Description

CCLayer is a subclass of CCNode that implements the CCTouchEventsDelegate protocol.

All features from CCNode are valid, plus the following new features:

  • It can receive iPhone Touches
  • It can receive Accelerometer input

Member Function Documentation

If isTouchEnabled, this method is called onEnter. Override it to change the way CCLayer receives touch events. ( Default: [touchDispatcher addStandardDelegate:self priority:0] ) Example: -(void) registerWithTouchDispatcher { [touchDispatcher addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES]; }

Valid only on iOS. Not valid on Mac.

Since:
v0.8.0

Property Documentation

- (BOOL) 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.

Since:
v0.8.1
- (BOOL) 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 its children.

Valid on iOS and Mac OS X v10.6 and later.

Since:
v0.8.1

The documentation for this class was generated from the following file: