CCMenuItem Class Reference
| Inherits from | CCNodeRGBA : CCNode : NSObject |
| Declared in | CCMenuItem.h |
Overview
CCMenuItem base class
Subclass CCMenuItem (or any subclass) to create your custom CCMenuItem objects.
Tasks
-
isSelectedreturns whether or not the item is selected
property -
releaseBlockAtCleanupIf enabled, it releases the block at cleanup time.
property -
+ itemWithTarget:selector:Creates a CCMenuItem with a target/selector. target/selector will be implemented using blocks. “target” won’t be retained.
-
+ itemWithBlock:Creates a CCMenuItem with the specified block. The block will be “copied”.
-
– initWithTarget:selector:Initializes a CCMenuItem with a target/selector
-
– initWithBlock:Initializes a CCMenuItem with the specified block. The block will be “copied”.
-
– rectReturns the outside box in points
-
– activateActivate the item
-
– selectedThe item was selected (not activated), similar to “mouse-over”
-
– unselectedThe item was unselected
-
– setIsEnabled:Enable or disabled the CCMenuItem
-
– isEnabledReturns whether or not the CCMenuItem is enabled
-
– setBlock:Sets the block that is called when the item is tapped. The block will be “copied”.
-
– setTarget: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.
-
– cleanupcleanup event. It will release the block and call [super cleanup]
Properties
Class Methods
Instance Methods
cleanup
cleanup event. It will release the block and call [super cleanup]
- (void)cleanupDeclared In
CCMenuItem.hinitWithBlock:
Initializes a CCMenuItem with the specified block. The block will be “copied”.
- (id)initWithBlock:(void ( ^ ) ( id sender ))blockDeclared In
CCMenuItem.hinitWithTarget:selector:
Initializes a CCMenuItem with a target/selector
- (id)initWithTarget:(id)target selector:(SEL)selectorDeclared In
CCMenuItem.hisEnabled
Returns whether or not the CCMenuItem is enabled
- (BOOL)isEnabledDeclared In
CCMenuItem.hselected
The item was selected (not activated), similar to “mouse-over”
- (void)selectedDeclared In
CCMenuItem.hsetBlock:
Sets the block that is called when the item is tapped. The block will be “copied”.
- (void)setBlock:(void ( ^ ) ( id sender ))blockDeclared In
CCMenuItem.hsetIsEnabled:
Enable or disabled the CCMenuItem
- (void)setIsEnabled:(BOOL)enabledDeclared In
CCMenuItem.h