cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCMenuItemToggle Class Reference

#import <CCMenuItem.h>

+ Inheritance diagram for CCMenuItemToggle:
+ Collaboration diagram for CCMenuItemToggle:

List of all members.

Public Member Functions

(id) - initWithItems:block:
(CCMenuItem *) - selectedItem

Static Public Member Functions

(id) + itemWithTarget:selector:items:
(id) + itemWithTarget:selector:items:vaList:
(id) + itemWithItems:
(id) + itemWithItems:block:

Protected Attributes

NSUInteger _selectedIndex
NSMutableArray * _subItems


NSUInteger selectedIndex
NSMutableArray * subItems

Detailed Description

A CCMenuItemToggle A simple container class that "toggles" its inner items The inner itmes can be any MenuItem

Member Function Documentation

- (id) initWithItems: (NSArray *)  arrayOfItems
block: (id)  block 

initializes a menu item from a list of items with a block. The block will be "copied".

+ (id) itemWithItems: (NSArray *)  arrayOfItems

creates a menu item from a list of items.

+ (id) itemWithItems: (NSArray *)  arrayOfItems
block: (id sender)  block 

creates a menu item from a list of items and executes the given block when the item is selected. The block will be "copied".

+ (id) itemWithTarget: (id)  target
selector: (SEL)  selector
items: (CCMenuItem *)  item

creates a menu item from a list of items with a target/selector

return the selected item

Property Documentation

- (NSUInteger) selectedIndex [read, write, assign]

returns the selected item

- (NSMutableArray*) subItems [read, write, retain]

NSMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one.


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