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

Properties

isSelected

returns whether or not the item is selected

@property (nonatomic, readonly) BOOL isSelected

Availability

Declared In

CCMenuItem.h

releaseBlockAtCleanup

If enabled, it releases the block at cleanup time.

@property (nonatomic) BOOL releaseBlockAtCleanup

Availability

Declared In

CCMenuItem.h

Class Methods

itemWithBlock:

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

+ (id)itemWithBlock:(void ( ^ ) ( id sender ))block

Declared In

CCMenuItem.h

itemWithTarget:selector:

Creates a CCMenuItem with a target/selector. target/selector will be implemented using blocks. “target” won’t be retained.

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

Declared In

CCMenuItem.h

Instance Methods

activate

Activate the item

- (void)activate

Declared In

CCMenuItem.h

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

rect

Returns the outside box in points

- (CGRect)rect

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

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.

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

Declared In

CCMenuItem.h

unselected

The item was unselected

- (void)unselected

Declared In

CCMenuItem.h