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

#import <CCLayer.h>

Inheritance diagram for CCLayer:
Collaboration diagram for CCLayer:

Instance Methods

(void) - setAccelerometerInterval:
 
(void) - setIsTouchEnabled:
 
(void) - setIsAccelerometerEnabled:
 
 Instance Methods inherited from CCNode
(id) - init
 
(void) - onEnter
 
(void) - onEnterTransitionDidFinish
 
(void) - onExit
 
(void) - onExitTransitionDidStart
 
(void) - addChild:
 
(void) - addChild:z:
 
(void) - addChild:z:tag:
 
(void) - removeFromParent
 
(void) - removeFromParentAndCleanup:
 
(void) - removeChild:
 
(void) - removeChild:cleanup:
 
(void) - removeChildByTag:
 
(void) - removeChildByTag:cleanup:
 
(void) - removeAllChildren
 
(void) - removeAllChildrenWithCleanup:
 
(CCNode *) - getChildByTag:
 
(void) - reorderChild:z:
 
(void) - sortAllChildren
 
(void) - cleanup
 
(void) - draw
 
(void) - visit
 
(void) - transform
 
(void) - transformAncestors
 
(CGRect) - boundingBox
 
(CCAction *) - runAction:
 
(void) - stopAllActions
 
(void) - stopAction:
 
(void) - stopActionByTag:
 
(CCAction *) - getActionByTag:
 
(NSUInteger) - numberOfRunningActions
 
(void) - scheduleUpdate
 
(void) - scheduleUpdateWithPriority:
 
(void) - unscheduleUpdate
 
(void) - schedule:
 
(void) - schedule:interval:
 
(void) - schedule:interval:repeat:delay:
 
(void) - scheduleOnce:delay:
 
(void) - unschedule:
 
(void) - unscheduleAllSelectors
 
(void) - resumeSchedulerAndActions
 
(void) - pauseSchedulerAndActions
 
(void) - update:
 
(CGAffineTransform) - nodeToParentTransform
 
(CGAffineTransform) - parentToNodeTransform
 
(CGAffineTransform) - nodeToWorldTransform
 
(CGAffineTransform) - worldToNodeTransform
 
(CGPoint) - convertToNodeSpace:
 
(CGPoint) - convertToWorldSpace:
 
(CGPoint) - convertToNodeSpaceAR:
 
(CGPoint) - convertToWorldSpaceAR:
 
(CGPoint) - convertTouchToNodeSpace:
 
(CGPoint) - convertTouchToNodeSpaceAR:
 
(void) - setIsRelativeAnchorPoint:
 
(BOOL) - DEPRECATED_ATTRIBUTE
 
(void) - setZOrder:
 
 Instance Methods inherited from <CCAccelerometerDelegate>
(void) - accelerometer:didAccelerate:
 
 Instance Methods inherited from <CCTouchAllAtOnceDelegate>
(void) - ccTouchesBegan:withEvent:
 
(void) - ccTouchesMoved:withEvent:
 
(void) - ccTouchesEnded:withEvent:
 
(void) - ccTouchesCancelled:withEvent:
 
 Instance Methods inherited from <CCTouchOneByOneDelegate>
(BOOL) - ccTouchBegan:withEvent:
 
(void) - ccTouchMoved:withEvent:
 
(void) - ccTouchEnded:withEvent:
 
(void) - ccTouchCancelled:withEvent:
 

Protected Attributes

BOOL _touchEnabled
 
BOOL _touchPriority
 
BOOL _touchMode
 
BOOL _accelerometerEnabled
 
 Protected Attributes inherited from CCNode
float rotationX_
 
float rotationY_
 
float scaleX_
 
float scaleY_
 
float vertexZ_
 
CGPoint position_
 
float skewX_
 
float skewY_
 
CGPoint anchorPointInPoints_
 
CGPoint anchorPoint_
 
CGSize contentSize_
 
CGAffineTransform transform_
 
CGAffineTransform inverse_
 
CCCameracamera_
 
CCGridBasegrid_
 
NSInteger zOrder_
 
CCArraychildren_
 
CCNodeparent_
 
NSInteger tag_
 
void * userData_
 
id userObject_
 
CCGLProgramshaderProgram_
 
ccGLServerState glServerState_
 
NSUInteger orderOfArrival_
 
CCSchedulerscheduler_
 
CCActionManageractionManager_
 
BOOL isRunning_
 
BOOL isTransformDirty_
 
BOOL isInverseDirty_
 
BOOL visible_
 
BOOL ignoreAnchorPointForPosition_
 
BOOL isReorderChildDirty_
 

Properties

BOOL accelerometerEnabled
 
BOOL touchEnabled
 
NSInteger touchPriority
 
ccTouchesMode touchMode
 
 Properties inherited from CCNode
NSInteger zOrder
 
float vertexZ
 
float skewX
 
float skewY
 
float rotation
 
float rotationX
 
float rotationY
 
float scale
 
float scaleX
 
float scaleY
 
CGPoint position
 
CCCameracamera
 
CCArraychildren
 
CCGridBasegrid
 
BOOL visible
 
CGPoint anchorPoint
 
CGPoint anchorPointInPoints
 
CGSize contentSize
 
BOOL isRunning
 
CCNodeparent
 
BOOL ignoreAnchorPointForPosition
 
NSInteger tag
 
void * userData
 
id userObject
 
CCGLProgramshaderProgram
 
NSUInteger orderOfArrival
 
ccGLServerState glServerState
 
CCActionManageractionManager
 
CCSchedulerscheduler
 

Additional Inherited Members

 Class Methods inherited from CCNode
(id) + node
 

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 Touches both on iOS and Mac
  • It can receive Accelerometer input on iOS
  • It can receive Keyboard events on Mac
  • It can receive Mouse events on Mac

Method Documentation

- (void) setAccelerometerInterval: (float)  interval

sets the accelerometer's update frequency. A value of 1/2 means that the callback is going to be called twice per second.

Since
v2.1

Property Documentation

- (BOOL) accelerometerEnabled
readwritenonatomicassign

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) touchEnabled
readwritenonatomicassign

whether or not it will receive Touch events

Since
v0.8.1
- (ccTouchesMode) touchMode
readwritenonatomicassign

Touch modes.

  • kCCTouchesAllAtOnce: Receives all the available touches at once.
  • kCCTouchesOneByOne: Receives one touch at the time.
- (NSInteger) touchPriority
readwritenonatomicassign

priority of the touch events. Default is 0


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