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

#import <CCMenu.h>

+ Inheritance diagram for CCMenu:
+ Collaboration diagram for CCMenu:

List of all members.

Public Member Functions

(id) - initWithArray:
(void) - alignItemsVertically
(void) - alignItemsVerticallyWithPadding:
(void) - alignItemsHorizontally
(void) - alignItemsHorizontallyWithPadding:
(void) - alignItemsInColumns:
(void) - alignItemsInColumns:vaList:
(void) - alignItemsInColumnsWithArray:
(void) - alignItemsInRows:
(void) - alignItemsInRows:vaList:
(void) - alignItemsInRowsWithArray:
(void) - setHandlerPriority:

Static Public Member Functions

(id) + menuWithItems:
(id) + menuWithItems:vaList:
(id) + menuWithArray:

Protected Attributes

tCCMenuState _state
BOOL _enabled


BOOL enabled

Detailed Description

A CCMenu

Features and Limitation:

  • You can add MenuItem objects in runtime using addChild:
  • But the only accecpted children are MenuItem objects

Member Function Documentation

align items horizontally

- (void) alignItemsHorizontallyWithPadding: (float)  padding

align items horizontally with padding

- (void) alignItemsInColumns: (NSNumber *)  columns

align items in rows of columns

- (void) alignItemsInRows: (NSNumber *)  rows

align items in columns of rows

align items vertically

- (void) alignItemsVerticallyWithPadding: (float)  padding

align items vertically with padding

- (id) initWithArray: (NSArray *)  arrayOfItems

initializes a CCMenu with a NSArray of CCMenuItem objects

+ (id) menuWithArray: (NSArray *)  arrayOfItems

creates a CCMenu with a NSArray of CCMenuItem objects

+ (id) menuWithItems: (CCMenuItem *)  item

creates a CCMenu with CCMenuItem objects

+ (id) menuWithItems: (CCMenuItem *)  firstItem
vaList: (va_list)  args 

creates a CCMenu with CCMenuItem objects

- (void) setHandlerPriority: (NSInteger)  newPriority

set event handler priority. By default it is: kCCMenuTouchPriority

Property Documentation

- (BOOL) enabled [read, write, assign]

whether or not the menu will receive events

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