|
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCMenuItem.h>
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_ |
| CCCamera * | camera_ |
| CCGridBase * | grid_ |
| NSInteger | zOrder_ |
| CCArray * | children_ |
| CCNode * | parent_ |
| NSInteger | tag_ |
| void * | userData_ |
| id | userObject_ |
| CCGLProgram * | shaderProgram_ |
| ccGLServerState | glServerState_ |
| NSUInteger | orderOfArrival_ |
| CCScheduler * | scheduler_ |
| CCActionManager * | actionManager_ |
| 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 |
| CCCamera * | camera |
| CCArray * | children |
| CCGridBase * | grid |
| BOOL | visible |
| CGPoint | anchorPoint |
| CGPoint | anchorPointInPoints |
| CGSize | contentSize |
| BOOL | isRunning |
| CCNode * | parent |
| BOOL | ignoreAnchorPointForPosition |
| NSInteger | tag |
| void * | userData |
| id | userObject |
| CCGLProgram * | shaderProgram |
| NSUInteger | orderOfArrival |
| ccGLServerState | glServerState |
| CCActionManager * | actionManager |
| CCScheduler * | scheduler |
CCMenuItem base class
Subclass CCMenuItem (or any subclass) to create your custom CCMenuItem objects.
| - (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
|
readnonatomicassign |
returns whether or not the item is selected
|
readwritenonatomicassign |
If enabled, it releases the block at cleanup time.