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
-
isSelected
returns whether or not the item is selected
property -
releaseBlockAtCleanup
If 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”.
-
– rect
Returns the outside box in points
-
– activate
Activate the item
-
– selected
The item was selected (not activated), similar to “mouse-over”
-
– unselected
The item was unselected
-
– setIsEnabled:
Enable or disabled the CCMenuItem
-
– isEnabled
Returns 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.
-
– cleanup
cleanup 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)cleanup
Declared In
CCMenuItem.h
initWithBlock:
Initializes a CCMenuItem with the specified block. The block will be “copied”.
- (id)initWithBlock:(void ( ^ ) ( id sender ))block
Declared In
CCMenuItem.h
initWithTarget:selector:
Initializes a CCMenuItem with a target/selector
- (id)initWithTarget:(id)target selector:(SEL)selector
Declared In
CCMenuItem.h
isEnabled
Returns whether or not the CCMenuItem is enabled
- (BOOL)isEnabled
Declared In
CCMenuItem.h
selected
The item was selected (not activated), similar to “mouse-over”
- (void)selected
Declared In
CCMenuItem.h
setBlock:
Sets the block that is called when the item is tapped. The block will be “copied”.
- (void)setBlock:(void ( ^ ) ( id sender ))block
Declared In
CCMenuItem.h
setIsEnabled:
Enable or disabled the CCMenuItem
- (void)setIsEnabled:(BOOL)enabled
Declared In
CCMenuItem.h