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
CCMenuItem Class Reference

#import <CCMenuItem.h>

Inheritance diagram for CCMenuItem:
Collaboration diagram for CCMenuItem:

Instance Methods

(id) - initWithTarget:selector:
 
(id) - initWithBlock:
 
(CGRect) - rect
 
(void) - activate
 
(void) - selected
 
(void) - unselected
 
(void) - setIsEnabled:
 
(BOOL) - isEnabled
 
(void) - setBlock:
 
(void) - setTarget:selector:
 
(void) - cleanup
 
 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) - 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:
 

Class Methods

(id) + itemWithTarget:selector:
 
(id) + itemWithBlock:
 
 Class Methods inherited from CCNode
(id) + node
 

Protected Attributes

void(^ _block )(id sender)
 
BOOL _isEnabled
 
BOOL _isSelected
 
BOOL _releaseBlockAtCleanup
 
 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 isSelected
 
BOOL releaseBlockAtCleanup
 
 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
 

Detailed Description

CCMenuItem base class

Subclass CCMenuItem (or any subclass) to create your custom CCMenuItem objects.

Method Documentation

- (void) activate

Activate the item

- (void) cleanup

cleanup event. It will release the block and call [super cleanup]

Implements CCNode.

- (id) initWithBlock: (id sender)  block

Initializes a CCMenuItem with the specified block. The block will be "copied".

- (id) initWithTarget: (id)  target
selector: (SEL)  selector 

Initializes a CCMenuItem with a target/selector

- (BOOL) isEnabled

Returns whether or not the CCMenuItem is enabled

+ (id) itemWithBlock: (id sender)  block

Creates a CCMenuItem with the specified block. The block will be "copied".

+ (id) itemWithTarget: (id)  target
selector: (SEL)  selector 

Creates a CCMenuItem with a target/selector. target/selector will be implemented using blocks. "target" won't be retained.

- (CGRect) rect

Returns the outside box in points

- (void) selected

The item was selected (not activated), similar to "mouse-over"

- (void) setBlock: (id sender)  block

Sets the block that is called when the item is tapped. The block will be "copied".

- (void) setIsEnabled: (BOOL)  enabled

Enable or disabled the CCMenuItem

Implemented in CCMenuItemLabel.

- (void) setTarget: (id)  target
selector: (SEL)  selector 

Sets the target and selector that is called when the item is tapped. target/selector will be implemented using blocks. "target" won't be retained.

- (void) unselected

The item was unselected

Property Documentation

- (BOOL) isSelected
readnonatomicassign
returns whether or not the item is selected
Since
v0.8.2
- (BOOL) releaseBlockAtCleanup
readwritenonatomicassign

If enabled, it releases the block at cleanup time.

Since
v2.1

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